context-labs / mactop

mactop - Apple Silicon Monitor Top written in pure Golang! Under 1,000 lines of code.
MIT License
1.46k stars 30 forks source link

P-Core usage bar overflow on M1 Pro #26

Open laclouis5 opened 5 months ago

laclouis5 commented 5 months ago

I'm running mactop v0.1.8 on a M1 Pro MacBook Pro and the P-Core Usage bar randomly spikes and overflows to the right of the terminal and the displayed percentage is absurdly hight (above 2000 %) and does not match with any real workload spike on the system (the system is at rest). During those spikes other tools such as top, Activity Monitor or Mx Power Gadget all show a flat and low P-Core usage and frequency.

Screenshot 2024-05-31 at 18 57 09
metaspartan commented 5 months ago

Fix is up here https://github.com/context-labs/mactop/pull/25 will be merged in for v0.1.9, if you can run the PR locally to confirm it resolves the issue for you, thanks.

laclouis5 commented 5 months ago

I cloned and switched to the development branch and then compiled the program following the instructions but the issue is stil present when launching the program with sudo ./mactop. I uninstalled mactop from brew to be sure to launch the right program. The issue seems to spike less often though.

metaspartan commented 5 months ago

Okay, interesting, can you please post some of your output from powermetrics here, this would also help to assist to see if powermetrics is reporting correctly or if my side of the code. Thank you for debugging 😃

laclouis5 commented 5 months ago

Here is some powermetrics logs during approximately 10 seconds with a sample rate of 1 second. mactop overflowed during that period of time. Thank you for the quick answer and support!

powermetrics.log

laclouis5 commented 5 months ago

A weird thing I noticed is that sometimes powermetrics prints this warning/error in between some samples (on stderr apparently): Second underflow occurred..

Julien-Ben commented 4 months ago

I second this issue, I encountered the same problem (freshly downloaded from brew) I have a M1 PRO chip and 32G RAM

ryul99 commented 2 months ago

I have a M1 Pro with 16 GB ram and encountered the same issue. I dont know why but it seems like this issue doenst happen when mactop is run in tmux session. FYI, I installed mactop with homebrew.

LucasPaivaSilva commented 1 week ago

Same problem here! M1 Pro (base model 2E 6P)

RobinBially commented 5 days ago

This isn't fixed, M2 Pro here with v0.1.9 including the #25 patch

Bildschirmfoto 2024-10-29 um 08 53 44