perf trace: Print the name of a syscall when failing to read its info
authorArnaldo Carvalho de Melo <[email protected]>
Wed, 24 Oct 2012 20:44:13 +0000 (18:44 -0200)
committerArnaldo Carvalho de Melo <[email protected]>
Wed, 24 Oct 2012 20:44:13 +0000 (18:44 -0200)
When failing to read the tracepoint event format, like currently with
sys_execve, that is not defined via SYSCALL_DEFINE macros and thus
doesn't have an entry in:

  $ ls -d /sys/kernel/debug/tracing/events/syscalls/sys_enter_*exec*
  /sys/kernel/debug/tracing/events/syscalls/sys_enter_kexec_load
  $

Cc: David Ahern <[email protected]>
Cc: Frederic Weisbecker <[email protected]>
Cc: Jiri Olsa <[email protected]>
Cc: Mike Galbraith <[email protected]>
Cc: Namhyung Kim <[email protected]>
Cc: Paul Mackerras <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Stephane Eranian <[email protected]>
Cc: Steven Rostedt <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Link: http://lkml.kernel.org/n/tip-`ranpwd
Link: http://lkml.kernel.org/n/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
tools/perf/builtin-trace.c

index fb83cfe472e3ed7211ff6ab4707ca5e480601d23..ba055103b52507a0f204f69e6bb6a8179f31a37d 100644 (file)
@@ -278,7 +278,10 @@ static struct syscall *trace__syscall_info(struct trace *trace,
        return &trace->syscalls.table[id];
 
 out_cant_read:
-       printf("Problems reading syscall %d information\n", id);
+       printf("Problems reading syscall %d", id);
+       if (id <= trace->syscalls.max && trace->syscalls.table[id].name != NULL)
+               printf("(%s)", trace->syscalls.table[id].name);
+       puts(" information");
        return NULL;
 }