perf stat: Better report failure to collect system wide stats
authorArnaldo Carvalho de Melo <acme@redhat.com>
Mon, 22 Mar 2010 16:10:28 +0000 (13:10 -0300)
committerIngo Molnar <mingo@elte.hu>
Mon, 22 Mar 2010 17:47:35 +0000 (18:47 +0100)
commit084ab9f862416b2ddb4bb9804884de19bf09774d
tree3e6bf779f4e7f75da57a381fab2aa9f60316fb01
parentca721e45b39209415d2288dbac3667b26d9d1def
perf stat: Better report failure to collect system wide stats

Before:

[acme@doppio linux-2.6-tip]$ perf stat -a sleep 1s

 Performance counter stats for 'sleep 1s':

  <not counted>  task-clock-msecs
  <not counted>  context-switches
  <not counted>  CPU-migrations
  <not counted>  page-faults
  <not counted>  cycles
  <not counted>  instructions
  <not counted>  branches
  <not counted>  branch-misses
  <not counted>  cache-references
  <not counted>  cache-misses

    1.016998463  seconds time elapsed

[acme@doppio linux-2.6-tip]$

Now:

[acme@doppio linux-2.6-tip]$ perf stat -a sleep 1s
No permission to collect system-wide stats.
Consider tweaking /proc/sys/kernel/perf_event_paranoid.
[acme@doppio linux-2.6-tip]$

Reported-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Frédéric Weisbecker <fweisbec@gmail.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Paul Mackerras <paulus@samba.org>
LKML-Reference: <1269274229-20442-4-git-send-email-acme@infradead.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
tools/perf/builtin-stat.c