From d19fb94d428db93465c50c4284bc50315871933a Mon Sep 17 00:00:00 2001 From: Alex Van Brunt Date: Wed, 7 May 2014 11:04:41 -0700 Subject: syscalls: add trace events for system calls Add trace events for the entry point and exit point of all system calls. This makes it possible to account for the time spent in each system call. Change-Id: Iba88c0a38424ea8e986954e23f13f4417578379d Signed-off-by: Alex Van Brunt Reviewed-on: http://git-master/r/407691 GVS: Gerrit_Virtual_Submit --- include/linux/syscalls.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'include/linux/syscalls.h') diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h index 84662ecc7b51..6e24400b5346 100644 --- a/include/linux/syscalls.h +++ b/include/linux/syscalls.h @@ -77,6 +77,8 @@ struct sigaltstack; #include #include #include +#undef CREATE_TRACE_POINTS +#include /* * __MAP - apply a macro to syscall arguments @@ -188,7 +190,10 @@ extern struct trace_event_functions exit_syscall_print_funcs; static inline long SYSC##name(__MAP(x,__SC_DECL,__VA_ARGS__)); \ asmlinkage long SyS##name(__MAP(x,__SC_LONG,__VA_ARGS__)) \ { \ - long ret = SYSC##name(__MAP(x,__SC_CAST,__VA_ARGS__)); \ + long ret; \ + trace_syscall_enter(""#name); \ + ret = SYSC##name(__MAP(x,__SC_CAST,__VA_ARGS__)); \ + trace_syscall_exit(""#name); \ __MAP(x,__SC_TEST,__VA_ARGS__); \ __PROTECT(x, ret,__MAP(x,__SC_ARGS,__VA_ARGS__)); \ return ret; \ -- cgit v1.2.3