In an attempt to debug system slowness, I've written a rotating log program on my Linux Ubuntu machine to log overall CPU usage, individual CPU usage of each core, and to log the output of ps -eo %cpu,args | awk '$1 >= 30 {print}'
to see all processes which are using > 30% of any single core. However, a Chrome process is very vague, as it shows up as follows in the output of the ps
command above. This particular process is using 30.3% of a single core:
30.3 /opt/google/chrome/chrome --type=renderer --enable-crashpad --crashpad-handler-pid=376 --enable-crash-reporter=268aff53-36a9-4582-a3c8-e90265a8e7eb, --display-capture-permissions-policy-allowed --origin-trial-disabled-features=CaptureHandle --change-stack-guard-on-fork=enable --enable-logging --v=1 --field-trial-handle=16790865900654175629,8097267719301694013,131072 --lang=en-US --num-raster-threads=4 --enable-main-frame-before-activation --renderer-client-id=75 --launch-time-ticks=99466415943 --shared-files=v8_context_snapshot_data:100
Can I tell which tab in Chrome that process pertains to? If not, is there any way to log CPU usage of individual Google Chrome processes or tabs, such as the data shown in the Chrome Task Manager (click 3 dots in top-right of Chrome --> More Tools --> Task manager)?
Here is the Chrome Task Manager, showing some tabs and CPU usage:
Note that I have enabled the Chrome debug logs by closing all Chrome windows and running this:
google-chrome --enable-logging --v=1 &
See here: https://support.google.com/chrome/a/answer/6271282#zippy=%2Clinux
The debug logs then show up in ~/.config/google-chrome/chrome_debug.log
. But, this isn't the same thing. I need to see CPU usage by Chrome tabs, not just general debug messages.
See also:
- [my question] https://unix.stackexchange.com/q/686928/114401
Related:
- [my answer] How to get overall CPU usage (e.g. 57%) on Linux