linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] perf tool: more user-friendly errors from trace
@ 2013-10-03  8:28 Ramkumar Ramachandra
  2013-10-03 16:58 ` Arnaldo Carvalho de Melo
  0 siblings, 1 reply; 5+ messages in thread
From: Ramkumar Ramachandra @ 2013-10-03  8:28 UTC (permalink / raw)
  To: LKML; +Cc: Ingo Molnar, Arnaldo Carvalho de Melo

Currently, execution of 'perf trace' reports the following cryptic
message to the user:

$ perf trace
Couldn't read the raw_syscalls tracepoints information!

Now, it prints a detailed message:

$ perf trace
Error:  No permissions to read $debugfs/tracing/events/raw_syscalls
Hint:   Change the permissions of debugfs: /sys/kernel/debug
        The directory will be present if your kernel was compiled with debugfs support.

Cc: Ingo Molnar <mingo@kernel.org>
Cc: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
---
 tools/perf/builtin-trace.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/tools/perf/builtin-trace.c b/tools/perf/builtin-trace.c
index 71aa3e3..544707a 100644
--- a/tools/perf/builtin-trace.c
+++ b/tools/perf/builtin-trace.c
@@ -916,14 +916,18 @@ static int trace__run(struct trace *trace, int argc, const char **argv)
 
 	if (perf_evlist__add_newtp(evlist, "raw_syscalls", "sys_enter", trace__sys_enter) ||
 	    perf_evlist__add_newtp(evlist, "raw_syscalls", "sys_exit", trace__sys_exit)) {
-		fprintf(trace->output, "Couldn't read the raw_syscalls tracepoints information!\n");
+		fprintf(trace->output, "Error:\tNo permissions to read $debugfs/tracing/events/raw_syscalls\n");
+		fprintf(trace->output, "Hint:\tChange the permissions of debugfs: /sys/kernel/debug\n");
+		fprintf(trace->output, "\tThe directory will be present if your kernel was compiled with debugfs support.\n");
 		goto out_delete_evlist;
 	}
 
 	if (trace->sched &&
 	    perf_evlist__add_newtp(evlist, "sched", "sched_stat_runtime",
 				   trace__sched_stat_runtime)) {
-		fprintf(trace->output, "Couldn't read the sched_stat_runtime tracepoint information!\n");
+		fprintf(trace->output, "Error:\tNo permissions to read $debugfs/tracing/events/sched/sched_stat_runtime\n");
+		fprintf(trace->output, "Hint:\tChange the permissions of debugfs: /sys/kernel/debug\n");
+		fprintf(trace->output, "\tThe directory will be present if your kernel was compiled with debugfs support.\n");
 		goto out_delete_evlist;
 	}
 
-- 
1.8.4.477.g5d89aa9


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2013-10-04  4:53 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-03  8:28 [PATCH] perf tool: more user-friendly errors from trace Ramkumar Ramachandra
2013-10-03 16:58 ` Arnaldo Carvalho de Melo
2013-10-03 17:18   ` David Ahern
2013-10-03 17:27     ` Arnaldo Carvalho de Melo
2013-10-04  4:52   ` Ramkumar Ramachandra

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).