Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KeyError: 'hw.perflevel1.logicalcpu' #4

Closed
paul-nameless opened this issue Nov 6, 2021 · 3 comments
Closed

KeyError: 'hw.perflevel1.logicalcpu' #4

paul-nameless opened this issue Nov 6, 2021 · 3 comments

Comments

@paul-nameless
Copy link
Contributor

Hello again,

Thanks for merging the fix with powermetrics.

Unfortunately now I am facing another error, maybe that's also because of the different OS versions...
Here is a traceback:

Traceback (most recent call last):
  File "/opt/homebrew/bin/asitop", line 8, in <module>
    sys.exit(main())
  File "/opt/homebrew/lib/python3.9/site-packages/asitop/asitop.py", line 71, in main
    soc_info_dict = get_soc_info()
  File "/opt/homebrew/lib/python3.9/site-packages/asitop/utils.py", line 136, in get_soc_info
    "e_core_count": core_counts_dict["hw.perflevel1.logicalcpu"],
KeyError: 'hw.perflevel1.logicalcpu'

core_counts_dict calls get_core_counts()
and it calls sysctl -a | grep hw.perflevel
which returns nothing on BigSur at least

Here is the output that I could get:

~ > sudo sysctl -a | grep hw.p 
hw.packages: 1
hw.pagesize: 16384
hw.pagesize32: 16384
hw.physicalcpu: 8
hw.physicalcpu_max: 8
@tlkh
Copy link
Owner

tlkh commented Nov 7, 2021

Yeah probably due to OS difference. That’s used to check for the number of E core and P core. I can just catch the error and disable the check I guess.

@tlkh
Copy link
Owner

tlkh commented Nov 7, 2021

Put in a quick and dirty fix, now it will run but the core counts will show up as "?".

@paul-nameless
Copy link
Contributor Author

Looks good to me, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants