History

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

Tom Zanussi committed 10 years ago

Commit dbfeaa71 parent c4a59232 files · +16 −0Browse files

Unified · Split

2 files
  1. kernel/trace/trace.h +5 −0
  2. kernel/trace/trace_syscalls.c +11 −0
kernel/trace/trace.h+5−0
@@ -1394,8 +1394,13 @@ int perf_ftrace_event_register(struct trace_event_call *call, · 1393 unmodified lines
13941394
13951395 #ifdef CONFIG_FTRACE_SYSCALLS
13961396 void init_ftrace_syscalls(void);
1397+const char *get_syscall_name(int syscall);
13971398 #else
13981399 static inline void init_ftrace_syscalls(void) { }
1400+static inline const char *get_syscall_name(int syscall)
1401+{
1402+ return NULL;
1403+}
13991404 #endif
14001405
14011406 #ifdef CONFIG_EVENT_TRACING
kernel/trace/trace_syscalls.c+11−0
@@ -106,6 +106,17 @@ static struct syscall_metadata *syscall_nr_to_meta(int nr) · 105 unmodified lines
106106 return syscalls_metadata[nr];
107107 }
108108
109+const char *get_syscall_name(int syscall)
110+{
111+ struct syscall_metadata *entry;
112+
113+ entry = syscall_nr_to_meta(syscall);
114+ if (!entry)
115+ return NULL;
116+
117+ return entry->name;
118+}
119+
109120 static enum print_line_t
110121 print_syscall_enter(struct trace_iterator *iter, int flags,
111122 struct trace_event *event)

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t