linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* measuring system wide CPU usage ignoring idle process
@ 2017-11-20 14:00 Milian Wolff
  2017-11-20 14:29 ` Jiri Olsa
  0 siblings, 1 reply; 13+ messages in thread
From: Milian Wolff @ 2017-11-20 14:00 UTC (permalink / raw)
  To: linux-perf-users; +Cc: acme, namhyung, Jiri Olsa

Hey all,

colleagues of mine just brought this inconvenient perf stat behavior to my 
attention:

$ perf stat -a -e cpu-clock,task-clock,cycles,instructions sleep 1

 Performance counter stats for 'system wide':

       4004.501439      cpu-clock (msec)          #    4.000 CPUs utilized          
       4004.526474      task-clock (msec)         #    4.000 CPUs utilized          
       945,906,029      cycles                    #    0.236 GHz                    
       461,861,241      instructions              #    0.49  insn per cycle         

       1.001247082 seconds time elapsed

This shows that cpu-clock and task-clock are incremented also for the idle 
processes. Is there some trick to exclude that time, such that the CPU 
utilization drops below 100% when doing `perf stat -a`?

Or should one ignore these clock measurements for system wide stats and only 
look at the cycles/instructions etc.? This does go somewhat in the direction 
of http://www.brendangregg.com/blog/2017-05-09/cpu-utilization-is-wrong.html 
anyways, so I'm not opposed to this.

Thanks
-- 
Milian Wolff | milian.wolff@kdab.com | Senior Software Engineer
KDAB (Deutschland) GmbH&Co KG, a KDAB Group company
Tel: +49-30-521325470
KDAB - The Qt Experts

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2018-04-17 13:41 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-11-20 14:00 measuring system wide CPU usage ignoring idle process Milian Wolff
2017-11-20 14:29 ` Jiri Olsa
2017-11-20 20:24   ` Milian Wolff
2017-11-20 23:44     ` Jiri Olsa
2017-11-23 13:40       ` Milian Wolff
2017-11-23 14:09         ` Jiri Olsa
2017-11-23 14:21           ` Jiri Olsa
2017-11-23 14:42             ` Arnaldo Carvalho de Melo
2017-11-23 15:12               ` Jiri Olsa
2017-11-23 18:59                 ` Arnaldo Carvalho de Melo
2017-11-24  8:14                   ` Jiri Olsa
2017-11-23 15:15               ` Peter Zijlstra
2018-04-17 13:41                 ` Arnaldo Carvalho de Melo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).