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>
1 file changed