0

This question might be specific to gnome-shell, which is constantly using 60-80% CPU on my system. (4.1GHz CPU frequency, arch linux, up-to-date software)

How can I find out what exactly is the cause of this? I'm suspecting that it's one of the extensions I use but how, other than disabling them all one by one (which would be hard in case multiple ones are just adding up), can I make sure of that and find out which? I found this related question but it's not really helpful and over two years old, so maybe by now there's a better way.

The output of strace (run for approx. 25 seconds), as suggested in the other question:

$ sudo strace -c -p 840
strace: Process 840 attached
^Cstrace: Process 840 detached
% time     seconds  usecs/call     calls    errors syscall
------ ----------- ----------- --------- --------- ----------------
 76.08    2.752830           9    299874           clock_gettime
 12.68    0.458897       50988         9         3 clone
  4.34    0.157096       26182         6           rt_sigreturn
  3.51    0.126947         325       390           write
  0.86    0.031007           9      3348      2583 recvmsg
  0.68    0.024611           9      2701           getpid
  0.51    0.018405          10      1839           poll
  0.40    0.014319          13      1026           writev
  0.27    0.009947          46       216           ioctl
  0.17    0.006035           9       656           sched_yield
  0.10    0.003674          10       361           gettimeofday
  0.09    0.003171          13       238           read
  0.05    0.001859          10       176           close
  0.05    0.001845          16       115         1 futex
  0.04    0.001302          16        80           openat
  0.03    0.001210          15        80           munmap
  0.03    0.001116          13        80           mmap
  0.02    0.000793          12        66           mprotect
  0.02    0.000789           9        80           fstat
  0.02    0.000584          12        48           timerfd_create
  0.01    0.000520          10        48           timerfd_settime
  0.01    0.000498          10        48        39 stat
  0.01    0.000291          12        24           pipe2
  0.01    0.000290          58         5         1 recvfrom
  0.01    0.000209          16        13           nanosleep
  0.00    0.000074          12         6           wait4
  0.00    0.000063          10         6         6 lseek
  0.00    0.000036          36         1           restart_syscall
------ ----------- ----------- --------- --------- ----------------
100.00    3.618418                311540      2633 total

However, I don't really know what to do with that or what it says at all either.

Edit: Just disabled all extensions, CPU usage still constantly 70-80%, no change at all.

Edit2: After closing all instances of gnome-terminal, the gnome-shell process' CPU usage dropped from (constant) 90% down to 10%, so I assume it's related to the terminal.

Edit3: It's back to 80%, without me opening a terminal. That's so weird, it's been at ~10% for 10-15 minutes now. I didn't open a new app or anything. Didn't start a new process either. I'm just browsing stackexchange on firefox that's pretty much it.

Edit4: Just closed telegram messenger. It went back to 10% for a minute, then back to 80%. Within that minute I didn't use the computer at all, I just watched the process monitor.

  • lots of calls to clock_gettime suggests a busy wait, clone is for creating threads . it might be worth connecting a debugger and seeing which threads are being created. – Jasen Jul 29 '18 at 4:28
  • Which debugger would I best use for this? I don't have any experience with this kinda stuff at all. – confetti Jul 29 '18 at 4:36
  • gdb... I don't expect it's going to be easy to figure out. – Jasen Jul 29 '18 at 4:44
  • github.com/nixawk/bin-game/wiki/… - yeah this isn't for noobs. – slm Jul 29 '18 at 4:48
  • It's almost easier to look in top and take note of which procname is popping up a lot and then google for it + cpu 100% or some such - google.com/… – slm Jul 29 '18 at 4:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.