• David Ahern's avatar
    perf stat: Fix misleading message when specifying cpu list or system wide · 62d3b617
    David Ahern authored
    The "perf stat" tool displays the command run in its summary output
    which is misleading when using a cpu list or system wide collection.
    
    Before:
    
    perf stat -a -- sleep 1
    
     Performance counter stats for 'sleep 1':
    
    16152.670249 task-clock                #   16.132 CPUs utilized
             417 context-switches          #    0.002 M/sec
               7 cpu-migrations            #    0.030 K/sec
    ...
    
    After:
    
    perf stat -a -- sleep 1
    
     Performance counter stats for 'system wide':
    
    16206.931120 task-clock                #   16.144 CPUs utilized
             395 context-switches          #    0.002 M/sec
               5 cpu-migrations            #    0.030 K/sec
    ...
    
    or
    
    perf stat -C1 -- sleep 1
    
     Performance counter stats for 'CPU(s) 1':
    
       1001.669257 task-clock                #    1.000 CPUs utilized
             4,264 context-switches          #    0.004 M/sec
                 3 cpu-migrations            #    0.003 K/sec
    ...
    Signed-off-by: default avatarDavid Ahern <dsahern@gmail.com>
    Cc: Frederic Weisbecker <fweisbec@gmail.com>
    Cc: Ingo Molnar <mingo@kernel.org>
    Cc: Jiri Olsa <jolsa@redhat.com>
    Cc: Namhyung Kim <namhyung.kim@lge.com>
    Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
    Cc: Stephane Eranian <eranian@google.com>
    Link: http://lkml.kernel.org/r/1380400080-9211-2-git-send-email-dsahern@gmail.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
    62d3b617
builtin-stat.c 45.3 KB