tracing/syscall for 2.6.32
Subsystems (6)
Hi Ingo,
Please pull the latest syscall tracing patches from:
git://git.kernel.org/pub/scm/linux/kernel/git/frederic/random-tracing.git \
tracing/core
The tree gathers fixes, renamings and adds a new pair of tracepoints for generic sysenter/sysexit tracing.
Some other patches are pending, beeing discussed. So there are probably more to come soon.
Josh Stone (4):
tracing: Rename FTRACE_SYSCALLS for tracepoints
tracing: Make syscall tracepoints conditional
tracing: Move tracepoint callbacks from declaration to definition
tracing: Create generic syscall TRACE_EVENTs
arch/s390/Kconfig | 2 +- arch/s390/defconfig | 2 +- arch/s390/include/asm/thread_info.h | 4 +- arch/s390/kernel/entry.S | 2 +- arch/s390/kernel/entry64.S | 2 +- arch/s390/kernel/ptrace.c | 12 +++--- arch/x86/Kconfig | 2 +- arch/x86/configs/i386_defconfig | 2 +- arch/x86/configs/x86_64_defconfig | 2 +- arch/x86/include/asm/thread_info.h | 13 +++--- arch/x86/kernel/ptrace.c | 16 +++---- include/linux/tracepoint.h | 46 +++++++++-------------- include/trace/define_trace.h | 5 ++ include/trace/events/syscalls.h | 70 +++++++++++++++++++++++++++++++++++ include/trace/ftrace.h | 9 ++++ include/trace/syscall.h | 17 -------- kernel/trace/Kconfig | 4 +- kernel/trace/trace_syscalls.c | 17 ++++---- kernel/tracepoint.c | 20 ++++++---- 19 files changed, 154 insertions(+), 93 deletions(-) create mode 100644 include/trace/events/syscalls.h
PATCH 1/4 tracing: Rename FTRACE_SYSCALLS for tracepoints
From: Josh Stone <[email protected]>
s/HAVE_FTRACE_SYSCALLS/HAVE_SYSCALL_TRACEPOINTS/g
s/TIF_SYSCALL_FTRACE/TIF_SYSCALL_TRACEPOINT/g
The syscall enter/exit tracing is no longer specific to just ftrace, so they now have names that reflect their tie to tracepoints instead.
LKML-Reference: <[email protected]>
--- arch/s390/Kconfig | 2 +- arch/s390/defconfig | 2 +- arch/s390/include/asm/thread_info.h | 4 ++-- arch/s390/kernel/entry.S | 2 +- arch/s390/kernel/entry64.S | 2 +- arch/s390/kernel/ptrace.c | 4 ++-- arch/x86/Kconfig | 2 +- arch/x86/configs/i386_defconfig | 2 +- arch/x86/configs/x86_64_defconfig | 2 +- arch/x86/include/asm/thread_info.h | 13 +++++++------ arch/x86/kernel/ptrace.c | 4 ++-- kernel/trace/Kconfig | 4 ++-- kernel/tracepoint.c | 4 ++-- 13 files changed, 24 insertions(+), 23 deletions(-)
arch/s390/Kconfig +1 -1
@@ -84,7 +84,7 @@ config S390 select HAVE_FUNCTION_TRACER select HAVE_FUNCTION_TRACE_MCOUNT_TEST select HAVE_FTRACE_MCOUNT_RECORD - select HAVE_FTRACE_SYSCALLS + select HAVE_SYSCALL_TRACEPOINTS select HAVE_DYNAMIC_FTRACE select HAVE_FUNCTION_GRAPH_TRACER select HAVE_DEFAULT_NO_SPIN_MUTEXES
arch/s390/defconfig +1 -1
@@ -900,7 +900,7 @@ CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y CONFIG_HAVE_FUNCTION_TRACE_MCOUNT_TEST=y CONFIG_HAVE_DYNAMIC_FTRACE=y CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y -CONFIG_HAVE_FTRACE_SYSCALLS=y +CONFIG_HAVE_SYSCALL_TRACEPOINTS=y CONFIG_TRACING_SUPPORT=y CONFIG_FTRACE=y # CONFIG_FUNCTION_TRACER is not set
arch/s390/include/asm/thread_info.h +2 -2
@@ -92,7 +92,7 @@ static inline struct thread_info *current_thread_info(void)#define TIF_SYSCALL_TRACE 8/* syscall trace active */ #define TIF_SYSCALL_AUDIT 9/* syscall auditing active */ #define TIF_SECCOMP 10/* secure computing */ -#define TIF_SYSCALL_FTRACE 11/* ftrace syscall instrumentation */ +#define TIF_SYSCALL_TRACEPOINT 11/* syscall tracepoint instrumentation */ #define TIF_USEDFPU 16/* FPU was used by this task this quantum (SMP) */ #define TIF_POLLING_NRFLAG 17/* true if poll_idle() is polling TIF_NEED_RESCHED */
@@ -111,7 +111,7 @@ static inline struct thread_info *current_thread_info(void)#define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE)#define _TIF_SYSCALL_AUDIT (1<<TIF_SYSCALL_AUDIT)#define _TIF_SECCOMP (1<<TIF_SECCOMP) -#define _TIF_SYSCALL_FTRACE (1<<TIF_SYSCALL_FTRACE) +#define _TIF_SYSCALL_TRACEPOINT (1<<TIF_SYSCALL_TRACEPOINT)#define _TIF_USEDFPU (1<<TIF_USEDFPU)#define _TIF_POLLING_NRFLAG (1<<TIF_POLLING_NRFLAG)#define _TIF_31BIT (1<<TIF_31BIT)
arch/s390/kernel/entry.S +1 -1
@@ -54,7 +54,7 @@ _TIF_WORK_SVC = (_TIF_SIGPENDING | _TIF_NOTIFY_RESUME | _TIF_NEED_RESCHED | \ _TIF_WORK_INT = (_TIF_SIGPENDING | _TIF_NOTIFY_RESUME | _TIF_NEED_RESCHED | \ _TIF_MCCK_PENDING) _TIF_SYSCALL = (_TIF_SYSCALL_TRACE>>8 | _TIF_SYSCALL_AUDIT>>8 | \ - _TIF_SECCOMP>>8 | _TIF_SYSCALL_FTRACE>>8) + _TIF_SECCOMP>>8 | _TIF_SYSCALL_TRACEPOINT>>8) STACK_SHIFT = PAGE_SHIFT + THREAD_ORDER STACK_SIZE = 1 << STACK_SHIFT
arch/s390/kernel/entry64.S +1 -1
@@ -57,7 +57,7 @@ _TIF_WORK_SVC = (_TIF_SIGPENDING | _TIF_NOTIFY_RESUME | _TIF_NEED_RESCHED | \ _TIF_WORK_INT = (_TIF_SIGPENDING | _TIF_NOTIFY_RESUME | _TIF_NEED_RESCHED | \ _TIF_MCCK_PENDING) _TIF_SYSCALL = (_TIF_SYSCALL_TRACE>>8 | _TIF_SYSCALL_AUDIT>>8 | \ - _TIF_SECCOMP>>8 | _TIF_SYSCALL_FTRACE>>8) + _TIF_SECCOMP>>8 | _TIF_SYSCALL_TRACEPOINT>>8) #define BASED(name) name-system_call(%r13)
arch/s390/kernel/ptrace.c +2 -2
@@ -664,7 +664,7 @@ asmlinkage long do_syscall_trace_enter(struct pt_regs *regs) ret =-1 ; } -if (unlikely (test_thread_flag (TIF_SYSCALL_FTRACE ))) +if (unlikely (test_thread_flag (TIF_SYSCALL_TRACEPOINT )))trace_syscall_enter (regs, regs->gprs[2 ]);if (unlikely (current->audit_context))
@@ -682,7 +682,7 @@ asmlinkage void do_syscall_trace_exit(struct pt_regs *regs)audit_syscall_exit (AUDITSC_RESULT (regs->gprs[2 ]), regs->gprs[2 ]); -if (unlikely (test_thread_flag (TIF_SYSCALL_FTRACE ))) +if (unlikely (test_thread_flag (TIF_SYSCALL_TRACEPOINT )))trace_syscall_exit (regs, regs->gprs[2 ]);if (test_thread_flag (TIF_SYSCALL_TRACE ))
arch/x86/Kconfig +1 -1
@@ -37,7 +37,7 @@ config X86 select HAVE_FUNCTION_GRAPH_FP_TEST select HAVE_FUNCTION_TRACE_MCOUNT_TEST select HAVE_FTRACE_NMI_ENTER if DYNAMIC_FTRACE - select HAVE_FTRACE_SYSCALLS + select HAVE_SYSCALL_TRACEPOINTS select HAVE_KVM select HAVE_ARCH_KGDB select HAVE_ARCH_TRACEHOOK
arch/x86/configs/i386_defconfig +1 -1
@@ -2355,7 +2355,7 @@ CONFIG_HAVE_FUNCTION_TRACE_MCOUNT_TEST=y CONFIG_HAVE_DYNAMIC_FTRACE=y CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y CONFIG_HAVE_HW_BRANCH_TRACER=y -CONFIG_HAVE_FTRACE_SYSCALLS=y +CONFIG_HAVE_SYSCALL_TRACEPOINTS=y CONFIG_RING_BUFFER=y CONFIG_TRACING=y CONFIG_TRACING_SUPPORT=y
arch/x86/configs/x86_64_defconfig +1 -1
@@ -2329,7 +2329,7 @@ CONFIG_HAVE_FUNCTION_TRACE_MCOUNT_TEST=y CONFIG_HAVE_DYNAMIC_FTRACE=y CONFIG_HAVE_FTRACE_MCOUNT_RECORD=y CONFIG_HAVE_HW_BRANCH_TRACER=y -CONFIG_HAVE_FTRACE_SYSCALLS=y +CONFIG_HAVE_SYSCALL_TRACEPOINTS=y CONFIG_RING_BUFFER=y CONFIG_TRACING=y CONFIG_TRACING_SUPPORT=y
arch/x86/include/asm/thread_info.h +7 -6
@@ -95,7 +95,7 @@ struct thread_info {#define TIF_DEBUGCTLMSR 25/* uses thread_struct.debugctlmsr */ #define TIF_DS_AREA_MSR 26/* uses thread_struct.ds_area_msr */ #define TIF_LAZY_MMU_UPDATES 27/* task is updating the mmu lazily */ -#define TIF_SYSCALL_FTRACE 28/* for ftrace syscall instrumentation */ +#define TIF_SYSCALL_TRACEPOINT 28/* syscall tracepoint instrumentation */ #define _TIF_SYSCALL_TRACE (1 << TIF_SYSCALL_TRACE)#define _TIF_NOTIFY_RESUME (1 << TIF_NOTIFY_RESUME)
@@ -118,17 +118,17 @@ struct thread_info {#define _TIF_DEBUGCTLMSR (1 << TIF_DEBUGCTLMSR)#define _TIF_DS_AREA_MSR (1 << TIF_DS_AREA_MSR)#define _TIF_LAZY_MMU_UPDATES (1 << TIF_LAZY_MMU_UPDATES) -#define _TIF_SYSCALL_FTRACE (1 << TIF_SYSCALL_FTRACE) +#define _TIF_SYSCALL_TRACEPOINT (1 << TIF_SYSCALL_TRACEPOINT)/* work to do in syscall_trace_enter() */ #define _TIF_WORK_SYSCALL_ENTRY \ - (_TIF_SYSCALL_TRACE | _TIF_SYSCALL_EMU | _TIF_SYSCALL_FTRACE | \ - _TIF_SYSCALL_AUDIT | _TIF_SECCOMP | _TIF_SINGLESTEP) + (_TIF_SYSCALL_TRACE | _TIF_SYSCALL_EMU | _TIF_SYSCALL_AUDIT | \ + _TIF_SECCOMP | _TIF_SINGLESTEP | _TIF_SYSCALL_TRACEPOINT)/* work to do in syscall_trace_leave() */ #define _TIF_WORK_SYSCALL_EXIT \ (_TIF_SYSCALL_TRACE | _TIF_SYSCALL_AUDIT | _TIF_SINGLESTEP | \ - _TIF_SYSCALL_FTRACE) + _TIF_SYSCALL_TRACEPOINT)/* work to do on interrupt/exception return */ #define _TIF_WORK_MASK \
@@ -137,7 +137,8 @@ struct thread_info { _TIF_SINGLESTEP|_TIF_SECCOMP|_TIF_SYSCALL_EMU))/* work to do on any return to user space */ -#define _TIF_ALLWORK_MASK ((0x0000FFFF & ~_TIF_SECCOMP) | _TIF_SYSCALL_FTRACE) +#define _TIF_ALLWORK_MASK \ + ((0x0000FFFF & ~_TIF_SECCOMP) | _TIF_SYSCALL_TRACEPOINT)/* Only used for 64 bit */ #define _TIF_DO_NOTIFY_MASK \
arch/x86/kernel/ptrace.c +2 -2
@@ -1500,7 +1500,7 @@ asmregparm long syscall_trace_enter(struct pt_regs *regs) tracehook_report_syscall_entry(regs)) ret =-1L ; -if (unlikely (test_thread_flag (TIF_SYSCALL_FTRACE ))) +if (unlikely (test_thread_flag (TIF_SYSCALL_TRACEPOINT )))trace_syscall_enter (regs, regs->orig_ax);if (unlikely (current->audit_context)) {
@@ -1526,7 +1526,7 @@ asmregparm void syscall_trace_leave(struct pt_regs *regs)if (unlikely (current->audit_context))audit_syscall_exit (AUDITSC_RESULT (regs->ax), regs->ax); -if (unlikely (test_thread_flag (TIF_SYSCALL_FTRACE ))) +if (unlikely (test_thread_flag (TIF_SYSCALL_TRACEPOINT )))trace_syscall_exit (regs, regs->ax);if (test_thread_flag (TIF_SYSCALL_TRACE ))
kernel/trace/Kconfig +2 -2
@@ -41,7 +41,7 @@ config HAVE_FTRACE_MCOUNT_RECORD config HAVE_HW_BRANCH_TRACER bool -config HAVE_FTRACE_SYSCALLS +config HAVE_SYSCALL_TRACEPOINTS bool config TRACER_MAX_TRACE
@@ -211,7 +211,7 @@ config ENABLE_DEFAULT_TRACERS config FTRACE_SYSCALLS bool "Trace syscalls" - depends on HAVE_FTRACE_SYSCALLS + depends on HAVE_SYSCALL_TRACEPOINTS select GENERIC_TRACER select KALLSYMS help
kernel/tracepoint.c +2 -2
@@ -590,7 +590,7 @@ void syscall_regfunc(void)if (!sys_tracepoint_refcount) {read_lock_irqsave (&tasklist_lock, flags); do_each_thread(g, t) { -set_tsk_thread_flag (t,TIF_SYSCALL_FTRACE ); +set_tsk_thread_flag (t,TIF_SYSCALL_TRACEPOINT ); }while_each_thread (g, t);read_unlock_irqrestore (&tasklist_lock, flags); }
@@ -608,7 +608,7 @@ void syscall_unregfunc(void)if (!sys_tracepoint_refcount) {read_lock_irqsave (&tasklist_lock, flags); do_each_thread(g, t) { -clear_tsk_thread_flag (t,TIF_SYSCALL_FTRACE ); +clear_tsk_thread_flag (t,TIF_SYSCALL_TRACEPOINT ); }while_each_thread (g, t);read_unlock_irqrestore (&tasklist_lock, flags); }
Signature · 1 line
1.6.2.3
PATCH 2/4 tracing: Make syscall tracepoints conditional
In reply to Frederic WeisbeckerFrom: Josh Stone <[email protected]>
The syscall enter/exit tracepoints are only supported on archs that HAVE_SYSCALL_TRACEPOINTS, so the declarations should be #ifdef'ed. Also, the definition of syscall_regfunc and syscall_unregfunc should depend on this same config, rather than the ftrace-specific one.
LKML-Reference: <[email protected]>
--- include/trace/syscall.h | 4 ++++ kernel/tracepoint.c | 2 +- 2 files changed, 5 insertions(+), 1 deletions(-)
include/trace/syscall.h +4 -0
@@ -8,6 +8,8 @@#include <asm/ptrace.h> +#ifdef CONFIG_HAVE_SYSCALL_TRACEPOINTS +extern void syscall_regfunc (void );extern void syscall_unregfunc (void );
@@ -25,6 +27,8 @@ DECLARE_TRACE_WITH_CALLBACK(syscall_exit,syscall_unregfunc ); +#endif +/* * A syscall entry in the ftrace syscalls array. *
kernel/tracepoint.c +1 -1
@@ -576,7 +576,7 @@ __initcall(init_tracepoints);#endif /* CONFIG_MODULES */ -#ifdef CONFIG_FTRACE_SYSCALLS +#ifdef CONFIG_HAVE_SYSCALL_TRACEPOINTS static DEFINE_MUTEX (regfunc_mutex);static int sys_tracepoint_refcount;
Signature · 1 line
1.6.2.3
PATCH 3/4 tracing: Move tracepoint callbacks from declaration to definition
In reply to Frederic WeisbeckerFrom: Josh Stone <[email protected]>
It's not strictly correct for the tracepoint reg/unreg callbacks to occur when a client is hooking up, because the actual tracepoint may not be present yet. This happens to be fine for syscall, since that's in the core kernel, but it would cause problems for tracepoints defined in a module that hasn't been loaded yet. It also means the reg/unreg has to be EXPORTed for any modules to use the tracepoint (as in SystemTap).
This patch removes DECLARE_TRACE_WITH_CALLBACK, and instead introduces DEFINE_TRACE_FN which stores the callbacks in struct tracepoint. The callbacks are used now when the active state of the tracepoint changes in set_tracepoint & disable_tracepoint.
This also introduces TRACE_EVENT_FN, so ftrace events can also provide registration callbacks if needed.
LKML-Reference: <[email protected]>
--- arch/s390/kernel/ptrace.c | 4 +- arch/x86/kernel/ptrace.c | 4 +- include/linux/tracepoint.h | 46 ++++++++++++++++------------------------- include/trace/define_trace.h | 5 ++++ include/trace/ftrace.h | 9 ++++++++ include/trace/syscall.h | 12 +++------- kernel/tracepoint.c | 14 ++++++++---- 7 files changed, 49 insertions(+), 45 deletions(-)
arch/s390/kernel/ptrace.c +2 -2
@@ -51,8 +51,8 @@#include "compat_ptrace.h" #endif -DEFINE_TRACE (syscall_enter); -DEFINE_TRACE (syscall_exit); +DEFINE_TRACE_FN (syscall_enter, syscall_regfunc, syscall_unregfunc); +DEFINE_TRACE_FN (syscall_exit, syscall_regfunc, syscall_unregfunc);enum s390_regset {REGSET_GENERAL ,
arch/x86/kernel/ptrace.c +2 -2
@@ -37,8 +37,8 @@#include <trace/syscall.h> -DEFINE_TRACE (syscall_enter); -DEFINE_TRACE (syscall_exit); +DEFINE_TRACE_FN (syscall_enter, syscall_regfunc, syscall_unregfunc); +DEFINE_TRACE_FN (syscall_exit, syscall_regfunc, syscall_unregfunc);#include "tls.h"
include/linux/tracepoint.h +18 -28
97 lines not on this page · raw message
include/trace/define_trace.h +5 -0
@@ -26,6 +26,11 @@#define TRACE_EVENT (name, proto, args, tstruct, assign, print) \ DEFINE_TRACE(name) +#undef TRACE_EVENT_FN +#define TRACE_EVENT_FN (name, proto, args, tstruct, \ + assign, print, reg, unreg) \ + DEFINE_TRACE_FN(name, reg, unreg) +#undef DECLARE_TRACE#define DECLARE_TRACE (name, proto, args) \ DEFINE_TRACE(name)
include/trace/ftrace.h +9 -0
@@ -42,6 +42,15 @@ }; \ static struct ftrace_event_call event_##name +/* Callbacks are meaningless to ftrace. */ +#undef TRACE_EVENT_FN +#define TRACE_EVENT_FN (name, proto, args, tstruct, \ + assign, print, reg, unreg) \ + TRACE_EVENT(name, TP_PROTO(proto), TP_ARGS(args), \ + TP_STRUCT__entry(tstruct), \ + TP_fast_assign(assign), \ + TP_printk(print)) +#include TRACE_INCLUDE (TRACE_INCLUDE_FILE )
include/trace/syscall.h +4 -8
@@ -13,18 +13,14 @@extern void syscall_regfunc (void );extern void syscall_unregfunc (void ); -DECLARE_TRACE_WITH_CALLBACK (syscall_enter, +DECLARE_TRACE (syscall_enter, TP_PROTO(struct pt_regs *regs, long id), -TP_ARGS (regs, id), - syscall_regfunc, - syscall_unregfunc +TP_ARGS (regs, id) ); -DECLARE_TRACE_WITH_CALLBACK (syscall_exit, +DECLARE_TRACE (syscall_exit, TP_PROTO(struct pt_regs *regs, long ret), -TP_ARGS (regs, ret), - syscall_regfunc, - syscall_unregfunc +TP_ARGS (regs, ret) );#endif
kernel/tracepoint.c +9 -5
@@ -243,6 +243,11 @@ static void set_tracepoint(struct tracepoint_entry **entry, {WARN_ON (strcmp ((*entry)->name, elem->name) !=0 ); +if (elem->regfunc && !elem->state && active) + elem->regfunc (); +else if (elem->unregfunc && elem->state && !active) + elem->unregfunc (); +/* * rcu_assign_pointer has a smp_wmb() which makes sure that the new * probe callbacks array is consistent before setting a pointer to it.
@@ -262,6 +267,9 @@ static void set_tracepoint(struct tracepoint_entry **entry,*/ static void disable_tracepoint (struct tracepoint *elem) { +if (elem->unregfunc && elem->state) + elem->unregfunc (); + elem->state =0 ;rcu_assign_pointer (elem->funcs,NULL ); }
@@ -578,7 +586,7 @@ __initcall(init_tracepoints);#ifdef CONFIG_HAVE_SYSCALL_TRACEPOINTS -static DEFINE_MUTEX (regfunc_mutex); +/* NB: reg/unreg are called while guarded with the tracepoints_mutex */ static int sys_tracepoint_refcount;void syscall_regfunc (void )
@@ -586,7 +594,6 @@ void syscall_regfunc(void)unsigned long flags;struct task_struct *g, *t; -mutex_lock (®func_mutex);if (!sys_tracepoint_refcount) {read_lock_irqsave (&tasklist_lock, flags); do_each_thread(g, t) {
@@ -595,7 +602,6 @@ void syscall_regfunc(void)read_unlock_irqrestore (&tasklist_lock, flags); } sys_tracepoint_refcount++; -mutex_unlock (®func_mutex); }void syscall_unregfunc (void )
@@ -603,7 +609,6 @@ void syscall_unregfunc(void)unsigned long flags;struct task_struct *g, *t; -mutex_lock (®func_mutex); sys_tracepoint_refcount--;if (!sys_tracepoint_refcount) {read_lock_irqsave (&tasklist_lock, flags);
@@ -612,6 +617,5 @@ void syscall_unregfunc(void) } while_each_thread(g, t);read_unlock_irqrestore (&tasklist_lock, flags); } -mutex_unlock (®func_mutex); }#endif
Signature · 1 line
1.6.2.3
PATCH 4/4 tracing: Create generic syscall TRACE_EVENTs
In reply to Frederic WeisbeckerFrom: Josh Stone <[email protected]>
This converts the syscall_enter/exit tracepoints into TRACE_EVENTs, so you can have generic ftrace events that capture all system calls with arguments and return values. These generic events are also renamed to sys_enter/exit, so they're more closely aligned to the specific sys_enter_foo events.
LKML-Reference: <[email protected]>
--- arch/s390/kernel/ptrace.c | 8 ++-- arch/x86/kernel/ptrace.c | 12 +++---- include/trace/events/syscalls.h | 70 +++++++++++++++++++++++++++++++++++++++ include/trace/syscall.h | 17 --------- kernel/trace/trace_syscalls.c | 17 +++++---- 5 files changed, 88 insertions(+), 36 deletions(-) create mode 100644 include/trace/events/syscalls.h
arch/s390/kernel/ptrace.c +4 -4
@@ -51,8 +51,8 @@#include "compat_ptrace.h" #endif -DEFINE_TRACE_FN (syscall_enter, syscall_regfunc, syscall_unregfunc); -DEFINE_TRACE_FN (syscall_exit, syscall_regfunc, syscall_unregfunc); +#define CREATE_TRACE_POINTS +#include <trace/events/syscalls.h> enum s390_regset {REGSET_GENERAL ,
@@ -665,7 +665,7 @@ asmlinkage long do_syscall_trace_enter(struct pt_regs *regs) }if (unlikely (test_thread_flag (TIF_SYSCALL_TRACEPOINT ))) -trace_syscall_enter (regs, regs->gprs[2 ]); +trace_sys_enter (regs, regs->gprs[2 ]);if (unlikely (current->audit_context)) audit_syscall_entry(is_compat_task() ?
@@ -683,7 +683,7 @@ asmlinkage void do_syscall_trace_exit(struct pt_regs *regs) regs->gprs[2]);if (unlikely (test_thread_flag (TIF_SYSCALL_TRACEPOINT ))) -trace_syscall_exit (regs, regs->gprs[2 ]); +trace_sys_exit (regs, regs->gprs[2 ]);if (test_thread_flag (TIF_SYSCALL_TRACE ))tracehook_report_syscall_exit (regs,0 );
arch/x86/kernel/ptrace.c +5 -7
@@ -35,13 +35,11 @@#include <asm/proto.h> #include <asm/ds.h> -#include <trace/syscall.h> - -DEFINE_TRACE_FN (syscall_enter, syscall_regfunc, syscall_unregfunc); -DEFINE_TRACE_FN (syscall_exit, syscall_regfunc, syscall_unregfunc); -#include "tls.h" +#define CREATE_TRACE_POINTS +#include <trace/events/syscalls.h> +enum x86_regset {REGSET_GENERAL ,REGSET_FP ,
@@ -1501,7 +1499,7 @@ asmregparm long syscall_trace_enter(struct pt_regs *regs) ret =-1L ;if (unlikely (test_thread_flag (TIF_SYSCALL_TRACEPOINT ))) -trace_syscall_enter (regs, regs->orig_ax); +trace_sys_enter (regs, regs->orig_ax);if (unlikely (current->audit_context)) {if (IS_IA32 )
@@ -1527,7 +1525,7 @@ asmregparm void syscall_trace_leave(struct pt_regs *regs)audit_syscall_exit (AUDITSC_RESULT (regs->ax), regs->ax);if (unlikely (test_thread_flag (TIF_SYSCALL_TRACEPOINT ))) -trace_syscall_exit (regs, regs->ax); +trace_sys_exit (regs, regs->ax);if (test_thread_flag (TIF_SYSCALL_TRACE ))tracehook_report_syscall_exit (regs,0 );
include/trace/events/syscalls.h new file +70 -0
70 lines not on this page · raw message
include/trace/syscall.h +0 -17
@@ -8,23 +8,6 @@#include <asm/ptrace.h> -#ifdef CONFIG_HAVE_SYSCALL_TRACEPOINTS - -extern void syscall_regfunc (void ); -extern void syscall_unregfunc (void ); - -DECLARE_TRACE (syscall_enter, - TP_PROTO(struct pt_regs *regs, long id), -TP_ARGS (regs, id) -); - -DECLARE_TRACE (syscall_exit, - TP_PROTO(struct pt_regs *regs, long ret), -TP_ARGS (regs, ret) -); - -#endif -/* * A syscall entry in the ftrace syscalls array. *
kernel/trace/trace_syscalls.c +9 -8
@@ -1,4 +1,5 @@#include <trace/syscall.h> +#include <trace/events/syscalls.h> #include <linux/kernel.h> #include <linux/ftrace.h> #include <linux/perf_counter.h>
@@ -286,7 +287,7 @@ int reg_event_syscall_enter(void *ptr)return -ENOSYS ;mutex_lock (&syscall_trace_lock);if (!sys_refcount_enter) - ret =register_trace_syscall_enter (ftrace_syscall_enter); + ret =register_trace_sys_enter (ftrace_syscall_enter);if (ret) {pr_info ("event trace: Could not activate" "syscall entry trace point" );
@@ -311,7 +312,7 @@ void unreg_event_syscall_enter(void *ptr) sys_refcount_enter--;clear_bit (num, enabled_enter_syscalls);if (!sys_refcount_enter) -unregister_trace_syscall_enter (ftrace_syscall_enter); +unregister_trace_sys_enter (ftrace_syscall_enter);mutex_unlock (&syscall_trace_lock); }
@@ -327,7 +328,7 @@ int reg_event_syscall_exit(void *ptr)return -ENOSYS ;mutex_lock (&syscall_trace_lock);if (!sys_refcount_exit) - ret =register_trace_syscall_exit (ftrace_syscall_exit); + ret =register_trace_sys_exit (ftrace_syscall_exit);if (ret) {pr_info ("event trace: Could not activate" "syscall exit trace point" );
@@ -352,7 +353,7 @@ void unreg_event_syscall_exit(void *ptr) sys_refcount_exit--;clear_bit (num, enabled_exit_syscalls);if (!sys_refcount_exit) -unregister_trace_syscall_exit (ftrace_syscall_exit); +unregister_trace_sys_exit (ftrace_syscall_exit);mutex_unlock (&syscall_trace_lock); }
@@ -418,7 +419,7 @@ int reg_prof_syscall_enter(char *name)mutex_lock (&syscall_trace_lock);if (!sys_prof_refcount_enter) - ret =register_trace_syscall_enter (prof_syscall_enter); + ret =register_trace_sys_enter (prof_syscall_enter);if (ret) {pr_info ("event trace: Could not activate" "syscall entry trace point" );
@@ -442,7 +443,7 @@ void unreg_prof_syscall_enter(char *name) sys_prof_refcount_enter--;clear_bit (num, enabled_prof_enter_syscalls);if (!sys_prof_refcount_enter) -unregister_trace_syscall_enter (prof_syscall_enter); +unregister_trace_sys_enter (prof_syscall_enter);mutex_unlock (&syscall_trace_lock); }
@@ -479,7 +480,7 @@ int reg_prof_syscall_exit(char *name)mutex_lock (&syscall_trace_lock);if (!sys_prof_refcount_exit) - ret =register_trace_syscall_exit (prof_syscall_exit); + ret =register_trace_sys_exit (prof_syscall_exit);if (ret) {pr_info ("event trace: Could not activate" "syscall entry trace point" );
@@ -503,7 +504,7 @@ void unreg_prof_syscall_exit(char *name) sys_prof_refcount_exit--;clear_bit (num, enabled_prof_exit_syscalls);if (!sys_prof_refcount_exit) -unregister_trace_syscall_exit (prof_syscall_exit); +unregister_trace_sys_exit (prof_syscall_exit);mutex_unlock (&syscall_trace_lock); }
Signature · 1 line
1.6.2.3
Quoted 32 lines · Frederic Weisbecker
Hi Ingo,
Please pull the latest syscall tracing patches from:
git://git.kernel.org/pub/scm/linux/kernel/git/frederic/random-tracing.git\
tracing/coreThe tree gathers fixes, renamings and adds a new pair of tracepoints for generic sysenter/sysexit tracing.
Some other patches are pending, beeing discussed. So there are probably more to come soon.
Josh Stone (4):
tracing: RenameFTRACE_SYSCALLSfor tracepoints
tracing: Make syscall tracepoints conditional
tracing: Move tracepoint callbacks from declaration to definition
tracing: Create generic syscallTRACE_EVENTsarch/s390/Kconfig | 2 +- arch/s390/defconfig | 2 +- arch/s390/include/asm/thread_info.h | 4 +- arch/s390/kernel/entry.S | 2 +- arch/s390/kernel/entry64.S | 2 +- arch/s390/kernel/ptrace.c | 12 +++--- arch/x86/Kconfig | 2 +- arch/x86/configs/i386_defconfig | 2 +- arch/x86/configs/x86_64_defconfig | 2 +- arch/x86/include/asm/thread_info.h | 13 +++--- arch/x86/kernel/ptrace.c | 16 +++---- include/linux/tracepoint.h | 46 +++++++++-------------- include/trace/define_trace.h | 5 ++
Quoted 8 lines
include/trace/events/syscalls.h | 70 +++++++++++++++++++++++++++++++++++ include/trace/ftrace.h | 9 ++++ include/trace/syscall.h | 17 -------- kernel/trace/Kconfig | 4 +- kernel/trace/trace_syscalls.c | 17 ++++---- kernel/tracepoint.c | 20 ++++++---- 19 files changed, 154 insertions(+), 93 deletions(-) create mode 100644 include/trace/events/syscalls.h
Pulled, thanks!
Heiko, Martin, do the S390 bits look good to you? I have build tested the S390 defconfig - it built fine beyond to pre-existing warnings:
/home/mingo/tip/net/sched/sch_api.c: In function 'qdisc_watchdog':/home/mingo/tip/net/sched/sch_api.c:460: warning: initialization from incompatible pointer type /home/mingo/tip/fs/ext2/namei.c: In function 'ext2_lookup':/home/mingo/tip/fs/ext2/namei.c:73: warning: format '%lu' expects type 'long unsigned int', but argument 4 has type 'ino_t'
Ingo
Quoted 42 lines · Ingo Molnar
Quoted 32 lines · Frederic Weisbecker
Hi Ingo,
Please pull the latest syscall tracing patches from:
git://git.kernel.org/pub/scm/linux/kernel/git/frederic/random-tracing.git\
tracing/coreThe tree gathers fixes, renamings and adds a new pair of tracepoints for generic sysenter/sysexit tracing.
Some other patches are pending, beeing discussed. So there are probably more to come soon.
Josh Stone (4):
tracing: RenameFTRACE_SYSCALLSfor tracepoints
tracing: Make syscall tracepoints conditional
tracing: Move tracepoint callbacks from declaration to definition
tracing: Create generic syscallTRACE_EVENTsarch/s390/Kconfig | 2 +- arch/s390/defconfig | 2 +- arch/s390/include/asm/thread_info.h | 4 +- arch/s390/kernel/entry.S | 2 +- arch/s390/kernel/entry64.S | 2 +- arch/s390/kernel/ptrace.c | 12 +++--- arch/x86/Kconfig | 2 +- arch/x86/configs/i386_defconfig | 2 +- arch/x86/configs/x86_64_defconfig | 2 +- arch/x86/include/asm/thread_info.h | 13 +++--- arch/x86/kernel/ptrace.c | 16 +++---- include/linux/tracepoint.h | 46 +++++++++-------------- include/trace/define_trace.h | 5 ++Quoted 8 lines
include/trace/events/syscalls.h | 70 +++++++++++++++++++++++++++++++++++ include/trace/ftrace.h | 9 ++++ include/trace/syscall.h | 17 -------- kernel/trace/Kconfig | 4 +- kernel/trace/trace_syscalls.c | 17 ++++---- kernel/tracepoint.c | 20 ++++++---- 19 files changed, 154 insertions(+), 93 deletions(-) create mode 100644 include/trace/events/syscalls.h
Quoted 5 lines
Pulled, thanks!
Heiko, Martin, do the S390 bits look good to you? I have build tested the S390 defconfig - it built fine beyond to pre-existing warnings:
Yes, looks ok to me.
Thanks!