Open luosheng opened 9 months ago
Hi @luosheng
Thank you so much for the detailed issue.
It seems that your powermetrics
didn't include smc info in powermetrics
, apple didn't keep any compatibility for powermetrics
and ioreg
tools, it's very hard for us to write tools based on that.
That's my powermetrics, compare to yours.
For now I think you can try mactop -t m1.xml
to run based on another theme without the sensors panel? (Or create your own themes!)
I am planning to use https://github.com/dkorunic/iSMC to fetch more data instead of depend on powermetrics.
Args issue fixed. Released in 0.1.10, upgrade by pip install -U mactop
.
Btw, you can use the build-in debug feature to get powermetrics samples, I update the doc here: https://github.com/laixintao/mactop#debug
Thank you again for trying mactop and file issues. ;D
As mentioned in Twitter yesterday, the
Sensors
section always shows loading progress bars. Upon some investigations, I think it's related topowermetrics
' arguments not being passed correctly on my machine.powermetrics -h
``` Usage: powermetrics [-i sample_interval] [-r order] [-t wakeup_cost] Gather and display CPU usage statistics (divided into time spent in user mode and supervisor mode), timer and interrupt wakeup frequency (total and, for near-idle workloads, those that resulted in package C-state exits), and on supported platforms, interrupt frequencies (categorized by CPU number), package C-state statistics (an indication of the time the core complex + integrated graphics, if any, were in low-power idle states), CPU frequency distribution during the sample. The tool may also display estimated power consumed by various SoC subsystems, such as CPU, GPU, ANE (Apple Neural Engine). Note: Average power values reported by powermetrics are estimated and may be inaccurate - hence they should not be used for any comparison between devices, but can be used to help optimize apps for energy efficiency. The following command-line options are supported: -h | --help show this message -A | --show-all Enables all samplers and displays all the available information for each sampler. -a | --poweravgAs you can see above, the option and value are separate by a space rather than
=
sign. So the command here might need to be adapted. I'm assuming the=
sign style works on your machine. So it might be necessary to runpowermetrics -h
prior to thesudo powermetrics ...
to determine the argument style.A simple change of the arguments style doesn't fix the problems though. I think it's much likely related to the output format differences between
powermetrics
distributions, but I didn't dig further. However I did gather a sample json output (by converting from plist) so you might take a look at.mactop_debug_20231206_15:11:31.json
BTW, this is also the root cause of 'q' key not being responsive. Because
powermetrics
failed to output the desired output, the readline part just infinitely loops there.