perf tools: Fixup exit path when not able to open events
authorArnaldo Carvalho de Melo <acme@redhat.com>
Mon, 28 Mar 2011 12:50:11 +0000 (09:50 -0300)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Tue, 29 Mar 2011 16:40:27 +0000 (13:40 -0300)
commitc286c419c784c238cd699be37fec7a9acc30d89f
tree3c99ba8a937f97dc02df0962a8a72cb26f9d27b5
parent1dfd7b494b3d8fb1e8a7383a8095f77eb058cd83
perf tools: Fixup exit path when not able to open events

We have to deal with the TUI mode in perf top, so that we don't end up
with a garbled screen when, say, a non root user on a machine with a
paranoid setting (the default) tries to use 'perf top'.

Introduce a ui__warning_paranoid() routine shared by top and record that
tells the user the valid values for /proc/sys/kernel/perf_event_paranoid.

Cc: David Ahern <daahern@cisco.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Cc: Tom Zanussi <tzanussi@gmail.com>
LKML-Reference: <new-submission>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/builtin-record.c
tools/perf/builtin-top.c
tools/perf/util/debug.c
tools/perf/util/debug.h