diff options
author | Frederic Weisbecker <fweisbec@gmail.com> | 2009-09-17 18:54:43 -0400 |
---|---|---|
committer | Frederic Weisbecker <fweisbec@gmail.com> | 2009-09-18 00:14:32 -0400 |
commit | e5e25cf47b0bdd1f7e9b8bb6368ee48e16de0c87 (patch) | |
tree | 043e6215359853812130324a24e3d03511b41e2b /include/linux | |
parent | 0efb4d20723d58edbad29d1ff98a86b631adb5e6 (diff) |
tracing: Factorize the events profile accounting
Factorize the events enabling accounting in a common tracing core
helper. This reduces the size of the profile_enable() and
profile_disable() callbacks for each trace events.
Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Acked-by: Steven Rostedt <rostedt@goodmis.org>
Acked-by: Li Zefan <lizf@cn.fujitsu.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Jason Baron <jbaron@redhat.com>
Cc: Masami Hiramatsu <mhiramat@redhat.com>
Cc: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/ftrace_event.h | 4 | ||||
-rw-r--r-- | include/linux/syscalls.h | 24 |
2 files changed, 10 insertions, 18 deletions
diff --git a/include/linux/ftrace_event.h b/include/linux/ftrace_event.h index bd099ba82ccc..bc103d7b1ca8 100644 --- a/include/linux/ftrace_event.h +++ b/include/linux/ftrace_event.h | |||
@@ -130,8 +130,8 @@ struct ftrace_event_call { | |||
130 | void *data; | 130 | void *data; |
131 | 131 | ||
132 | atomic_t profile_count; | 132 | atomic_t profile_count; |
133 | int (*profile_enable)(struct ftrace_event_call *); | 133 | int (*profile_enable)(void); |
134 | void (*profile_disable)(struct ftrace_event_call *); | 134 | void (*profile_disable)(void); |
135 | }; | 135 | }; |
136 | 136 | ||
137 | #define MAX_FILTER_PRED 32 | 137 | #define MAX_FILTER_PRED 32 |
diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h index a8e37821cc60..7d9803cbb20f 100644 --- a/include/linux/syscalls.h +++ b/include/linux/syscalls.h | |||
@@ -100,33 +100,25 @@ struct perf_counter_attr; | |||
100 | 100 | ||
101 | #ifdef CONFIG_EVENT_PROFILE | 101 | #ifdef CONFIG_EVENT_PROFILE |
102 | #define TRACE_SYS_ENTER_PROFILE(sname) \ | 102 | #define TRACE_SYS_ENTER_PROFILE(sname) \ |
103 | static int prof_sysenter_enable_##sname(struct ftrace_event_call *event_call) \ | 103 | static int prof_sysenter_enable_##sname(void) \ |
104 | { \ | 104 | { \ |
105 | int ret = 0; \ | 105 | return reg_prof_syscall_enter("sys"#sname); \ |
106 | if (!atomic_inc_return(&event_enter_##sname.profile_count)) \ | ||
107 | ret = reg_prof_syscall_enter("sys"#sname); \ | ||
108 | return ret; \ | ||
109 | } \ | 106 | } \ |
110 | \ | 107 | \ |
111 | static void prof_sysenter_disable_##sname(struct ftrace_event_call *event_call)\ | 108 | static void prof_sysenter_disable_##sname(void) \ |
112 | { \ | 109 | { \ |
113 | if (atomic_add_negative(-1, &event_enter_##sname.profile_count)) \ | 110 | unreg_prof_syscall_enter("sys"#sname); \ |
114 | unreg_prof_syscall_enter("sys"#sname); \ | ||
115 | } | 111 | } |
116 | 112 | ||
117 | #define TRACE_SYS_EXIT_PROFILE(sname) \ | 113 | #define TRACE_SYS_EXIT_PROFILE(sname) \ |
118 | static int prof_sysexit_enable_##sname(struct ftrace_event_call *event_call) \ | 114 | static int prof_sysexit_enable_##sname(void) \ |
119 | { \ | 115 | { \ |
120 | int ret = 0; \ | 116 | return reg_prof_syscall_exit("sys"#sname); \ |
121 | if (!atomic_inc_return(&event_exit_##sname.profile_count)) \ | ||
122 | ret = reg_prof_syscall_exit("sys"#sname); \ | ||
123 | return ret; \ | ||
124 | } \ | 117 | } \ |
125 | \ | 118 | \ |
126 | static void prof_sysexit_disable_##sname(struct ftrace_event_call *event_call) \ | 119 | static void prof_sysexit_disable_##sname(void) \ |
127 | { \ | 120 | { \ |
128 | if (atomic_add_negative(-1, &event_exit_##sname.profile_count)) \ | 121 | unreg_prof_syscall_exit("sys"#sname); \ |
129 | unreg_prof_syscall_exit("sys"#sname); \ | ||
130 | } | 122 | } |
131 | 123 | ||
132 | #define TRACE_SYS_ENTER_PROFILE_INIT(sname) \ | 124 | #define TRACE_SYS_ENTER_PROFILE_INIT(sname) \ |