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

Showing the changes to kernel/trace (2 of 2 files). Show all

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
1394 1394
1395#ifdef CONFIG_FTRACE_SYSCALLS1395#ifdef CONFIG_FTRACE_SYSCALLS
1396void init_ftrace_syscalls(void);1396void init_ftrace_syscalls(void);
1397const char *get_syscall_name(int syscall);
1397#else1398#else
1398static inline void init_ftrace_syscalls(void) { }1399static inline void init_ftrace_syscalls(void) { }
1400static inline const char *get_syscall_name(int syscall)
1401{
1402 return NULL;
1403}
1399#endif1404#endif
1400 1405
1401#ifdef CONFIG_EVENT_TRACING1406#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
106 return syscalls_metadata[nr];106 return syscalls_metadata[nr];
107}107}
108 108
109const 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
109static enum print_line_t120static enum print_line_t
110print_syscall_enter(struct trace_iterator *iter, int flags,121print_syscall_enter(struct trace_iterator *iter, int flags,
111 struct trace_event *event)122 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