htop icon indicating copy to clipboard operation
htop copied to clipboard

CPU Frequency shows as "N/A" on macOS 10.14 Catalina 2015 MacBook Pro 4 core, 8 thread.

Open joshuapinter opened this issue 5 years ago • 14 comments

image

Not sure if it's a known issue or something that I'm maybe doing wrong. Anyway, thought I'd post it to get some feedback.

Thanks!

joshuapinter avatar Oct 25 '20 22:10 joshuapinter

Based on this part of the code this does not seem to be implemented on MacOS yet.

BenBE avatar Oct 25 '20 22:10 BenBE

Thanks for the feedback @BenBE! Now that we know should we close this or add something about compatibility in the docs. Your call. Thanks.

joshuapinter avatar Oct 25 '20 22:10 joshuapinter

I think we should keep it open marking it as a feature request/enhancement request to support these information on MacOSX. Simply closing it doesn't feel right for two reasons: First you either should provide the information properly or second don't offer the option to show them if unsupported. As it is now it's in a half-baked state where it should be improved.

BenBE avatar Oct 25 '20 23:10 BenBE

Beauty! Thanks for your help!

joshuapinter avatar Oct 26 '20 00:10 joshuapinter

hint: https://stackoverflow.com/questions/9948987/detect-current-cpu-clock-speed-programmatically-on-os-x

cgzones avatar Oct 26 '20 14:10 cgzones

hint: https://stackoverflow.com/questions/9948987/detect-current-cpu-clock-speed-programmatically-on-os-x

The tl;dr version of this is: Not really possible to get anything but the default frequency on MacOS without very low level measurement loops (which would break again as Apple goes ARM).

Shall we disable the option when compiling for MacOS (and other platforms where we can't get the data well)?

fasterit avatar Oct 30 '20 10:10 fasterit

Disabling/hiding that option for unsupported platforms is probably best.

BenBE avatar Oct 30 '20 11:10 BenBE

The macOS built in powermetrics cli tool is able to show cpu frequency and a lot more information (P/E cluster usage etc.).

ulope avatar Oct 05 '22 17:10 ulope

The macOS built in powermetrics cli tool is able to show cpu frequency and a lot more information (P/E cluster usage etc.).

Do you have a source code reference for this tool to look at?

BenBE avatar Oct 06 '22 08:10 BenBE

You can take a look at https://www.unix.com/man-page/osx/1/powermetrics/

mig8447 avatar Feb 06 '23 15:02 mig8447

You can take a look at https://www.unix.com/man-page/osx/1/powermetrics/

That's not exactly "source code" that could be any reference for an implementation AFAICS …

BenBE avatar Feb 06 '23 16:02 BenBE

You can get the CPU frequency on macOS ARM: sudo /usr/bin/powermetrics -s cpu_power -n 1 image

dontcrash avatar May 06 '23 15:05 dontcrash

@BenBE this looks helpful: https://github.com/freedomtan/test-ioreport

ulope avatar May 06 '23 18:05 ulope

Hi folks!

I just submitted #1272 that implements this for Apple Silicon. I only have vanilla M1 and M2 machines, so if any of you have Pro/Max and especially Ultra versions, and could give this a spin, it would be very helpful. If you can, please also test it with maximum CPU (using something like Endurance) and see if the maximum frequencies and number of P/E cores make sense.

bakaid avatar Jul 26 '23 19:07 bakaid