summaryrefslogtreecommitdiffstats
path: root/kernel/trace/trace_syscalls.c
diff options
context:
space:
mode:
authorTom Zanussi <tom.zanussi@linux.intel.com>2015-12-10 19:50:46 +0100
committerSteven Rostedt <rostedt@goodmis.org>2016-03-08 17:19:32 +0100
commitdbfeaa7abae4f105afdf8ed4f85b5879cff136ea (patch)
treed9dc6d2f9d1336bd817c6fc4a8f6af1b797a505e /kernel/trace/trace_syscalls.c
parenttracing: Add event record param to trigger_ops.func() (diff)
downloadlinux-dbfeaa7abae4f105afdf8ed4f85b5879cff136ea.tar.xz
linux-dbfeaa7abae4f105afdf8ed4f85b5879cff136ea.zip
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.com Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com> Tested-by: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com> Reviewed-by: Namhyung Kim <namhyung@kernel.org> Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Diffstat (limited to 'kernel/trace/trace_syscalls.c')
-rw-r--r--kernel/trace/trace_syscalls.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/kernel/trace/trace_syscalls.c b/kernel/trace/trace_syscalls.c
index 0655afbea83f..50be5602217c 100644
--- a/kernel/trace/trace_syscalls.c
+++ b/kernel/trace/trace_syscalls.c
@@ -106,6 +106,17 @@ static struct syscall_metadata *syscall_nr_to_meta(int 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
print_syscall_enter(struct trace_iterator *iter, int flags,
struct trace_event *event)