Commit dbfeaa7a authored by Tom Zanussi's avatar Tom Zanussi Committed by Steven Rostedt

tracing: Add get_syscall_name()

Add a utility function to grab the syscall name from the syscall
metadata, given a syscall id.

Link: http://lkml.kernel.org/r/be26a8dfe3f15e16a837799f1c1e2b4d62742843.1449767187.git.tom.zanussi@linux.intel.comSigned-off-by: default avatarTom Zanussi <tom.zanussi@linux.intel.com>
Tested-by: default avatarMasami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Reviewed-by: default avatarNamhyung Kim <namhyung@kernel.org>
Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
parent c4a59230
...@@ -1394,8 +1394,13 @@ int perf_ftrace_event_register(struct trace_event_call *call, ...@@ -1394,8 +1394,13 @@ int perf_ftrace_event_register(struct trace_event_call *call,
#ifdef CONFIG_FTRACE_SYSCALLS #ifdef CONFIG_FTRACE_SYSCALLS
void init_ftrace_syscalls(void); void init_ftrace_syscalls(void);
const char *get_syscall_name(int syscall);
#else #else
static inline void init_ftrace_syscalls(void) { } static inline void init_ftrace_syscalls(void) { }
static inline const char *get_syscall_name(int syscall)
{
return NULL;
}
#endif #endif
#ifdef CONFIG_EVENT_TRACING #ifdef CONFIG_EVENT_TRACING
......
...@@ -106,6 +106,17 @@ static struct syscall_metadata *syscall_nr_to_meta(int nr) ...@@ -106,6 +106,17 @@ static struct syscall_metadata *syscall_nr_to_meta(int nr)
return syscalls_metadata[nr]; return syscalls_metadata[nr];
} }
const char *get_syscall_name(int syscall)
{
struct syscall_metadata *entry;
entry = syscall_nr_to_meta(syscall);
if (!entry)
return NULL;
return entry->name;
}
static enum print_line_t static enum print_line_t
print_syscall_enter(struct trace_iterator *iter, int flags, print_syscall_enter(struct trace_iterator *iter, int flags,
struct trace_event *event) struct trace_event *event)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment