Commit eeac19a7 authored by Jason Baron's avatar Jason Baron Committed by Frederic Weisbecker

tracing: Map syscall name to number

Add a new function to support translating a syscall name to number at
runtime.
This allows the syscall event tracer to map syscall names to number.
Signed-off-by: default avatarJason Baron <[email protected]>
Cc: Lai Jiangshan <[email protected]>
Cc: Steven Rostedt <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Mathieu Desnoyers <[email protected]>
Cc: Jiaying Zhang <[email protected]>
Cc: Martin Bligh <[email protected]>
Cc: Li Zefan <[email protected]>
Cc: Masami Hiramatsu <[email protected]>
Signed-off-by: default avatarFrederic Weisbecker <[email protected]>
parent 7770841e
......@@ -500,6 +500,22 @@ struct syscall_metadata *syscall_nr_to_meta(int nr)
return syscalls_metadata[nr];
}
int syscall_name_to_nr(char *name)
{
int i;
if (!syscalls_metadata)
return -1;
for (i = 0; i < FTRACE_SYSCALL_MAX; i++) {
if (syscalls_metadata[i]) {
if (!strcmp(syscalls_metadata[i]->name, name))
return i;
}
}
return -1;
}
void arch_init_ftrace_syscalls(void)
{
int i;
......
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