diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2013-10-17 11:07:58 -0400 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2013-10-17 13:35:20 -0400 |
commit | 6ef068cb8e77784431b6c80adc49d0b0a6a5df66 (patch) | |
tree | 8fa200b1faf042d580cd290c36a8d2e179043acf /tools/perf/builtin-trace.c | |
parent | ba209f856380891a6ea6cdb07b2b068faccbff73 (diff) |
perf evlist: Introduce perf_evlist__strerror_tp method
Out of 'perf trace', should be used by other tools that uses
tracepoints.
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Ramkumar Ramachandra <artagnon@gmail.com>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/n/tip-lyvtxhchz4ga8fwht15x8wou@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/builtin-trace.c')
-rw-r--r-- | tools/perf/builtin-trace.c | 26 |
1 files changed, 5 insertions, 21 deletions
diff --git a/tools/perf/builtin-trace.c b/tools/perf/builtin-trace.c index ec8289570f4f..78b0d6a5fdff 100644 --- a/tools/perf/builtin-trace.c +++ b/tools/perf/builtin-trace.c | |||
@@ -1814,27 +1814,11 @@ out: | |||
1814 | trace->live = false; | 1814 | trace->live = false; |
1815 | return err; | 1815 | return err; |
1816 | out_error_tp: | 1816 | out_error_tp: |
1817 | switch(errno) { | 1817 | { |
1818 | case ENOENT: | 1818 | char errbuf[BUFSIZ]; |
1819 | fputs("Error:\tUnable to find debugfs\n" | 1819 | perf_evlist__strerror_tp(evlist, errno, errbuf, sizeof(errbuf)); |
1820 | "Hint:\tWas your kernel was compiled with debugfs support?\n" | 1820 | fprintf(trace->output, "%s\n", errbuf); |
1821 | "Hint:\tIs the debugfs filesystem mounted?\n" | 1821 | } |
1822 | "Hint:\tTry 'sudo mount -t debugfs nodev /sys/kernel/debug'\n", | ||
1823 | trace->output); | ||
1824 | break; | ||
1825 | case EACCES: | ||
1826 | fprintf(trace->output, | ||
1827 | "Error:\tNo permissions to read %s/tracing/events/raw_syscalls\n" | ||
1828 | "Hint:\tTry 'sudo mount -o remount,mode=755 %s'\n", | ||
1829 | debugfs_mountpoint, debugfs_mountpoint); | ||
1830 | break; | ||
1831 | default: { | ||
1832 | char bf[256]; | ||
1833 | fprintf(trace->output, "Can't trace: %s\n", | ||
1834 | strerror_r(errno, bf, sizeof(bf))); | ||
1835 | } | ||
1836 | break; | ||
1837 | } | ||
1838 | goto out_delete_evlist; | 1822 | goto out_delete_evlist; |
1839 | } | 1823 | } |
1840 | 1824 | ||