lkml.org 
[lkml]   [2012]   [Oct]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[tip:perf/core] perf trace: Print the name of a syscall when failing to read its info
Commit-ID:  814d7a4d2c33657489f7b45bc0b2dcaa0d88edc0
Gitweb: http://git.kernel.org/tip/814d7a4d2c33657489f7b45bc0b2dcaa0d88edc0
Author: Arnaldo Carvalho de Melo <acme@redhat.com>
AuthorDate: Wed, 24 Oct 2012 18:44:13 -0200
Committer: Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Wed, 24 Oct 2012 18:44:13 -0200

perf trace: Print the name of a syscall when failing to read its info

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 <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Namhyung Kim <namhyung@gmail.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
echo Link: http://lkml.kernel.org/n/tip-`ranpwd -l 24`@git.kernel.org
Link: http://lkml.kernel.org/n/tip-q3ak0j8b81yxylykq5wp2uwi@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/builtin-trace.c | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/tools/perf/builtin-trace.c b/tools/perf/builtin-trace.c
index fb83cfe..ba05510 100644
--- a/tools/perf/builtin-trace.c
+++ b/tools/perf/builtin-trace.c
@@ -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;
}


\
 
 \ /
  Last update: 2012-10-27 05:01    [W:1.593 / U:0.016 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site