aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorSteven Rostedt <srostedt@redhat.com>2010-04-23 11:12:36 -0400
committerSteven Rostedt <rostedt@goodmis.org>2010-05-14 14:33:22 -0400
commit553552ce1796c32cf4e3d4f45cd5b537de91dd1d (patch)
treea65defc1055bcc3e9f34327d2cc59704e536948b /include/linux
parent32c0edaeaad74a7883e736ae0f3798784cfc2a80 (diff)
tracing: Combine event filter_active and enable into single flags field
The filter_active and enable both use an int (4 bytes each) to set a single flag. We can save 4 bytes per event by combining the two into a single integer. text data bss dec hex filename 4913961 1088356 861512 6863829 68bbd5 vmlinux.orig 4894944 1018052 861512 6774508 675eec vmlinux.id 4894871 1012292 861512 6768675 674823 vmlinux.flags This gives us another 5K in savings. The modification of both the enable and filter fields are done under the event_mutex, so it is still safe to combine the two. Note: Although Mathieu gave his Acked-by, he would like it documented that the reads of flags are not protected by the mutex. The way the code works, these reads will not break anything, but will have a residual effect. Since this behavior is the same even before this patch, describing this situation is left to another patch, as this patch does not change the behavior, but just brought it to Mathieu's attention. v2: Updated the event trace self test to for this change. Acked-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com> Acked-by: Masami Hiramatsu <mhiramat@redhat.com> Acked-by: Frederic Weisbecker <fweisbec@gmail.com> Cc: Tom Zanussi <tzanussi@gmail.com> Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/ftrace_event.h21
1 files changed, 19 insertions, 2 deletions
diff --git a/include/linux/ftrace_event.h b/include/linux/ftrace_event.h
index 0be028527633..5ac97a42950d 100644
--- a/include/linux/ftrace_event.h
+++ b/include/linux/ftrace_event.h
@@ -143,6 +143,16 @@ struct ftrace_event_class {
143 int (*raw_init)(struct ftrace_event_call *); 143 int (*raw_init)(struct ftrace_event_call *);
144}; 144};
145 145
146enum {
147 TRACE_EVENT_FL_ENABLED_BIT,
148 TRACE_EVENT_FL_FILTERED_BIT,
149};
150
151enum {
152 TRACE_EVENT_FL_ENABLED = (1 << TRACE_EVENT_FL_ENABLED_BIT),
153 TRACE_EVENT_FL_FILTERED = (1 << TRACE_EVENT_FL_FILTERED_BIT),
154};
155
146struct ftrace_event_call { 156struct ftrace_event_call {
147 struct list_head list; 157 struct list_head list;
148 struct ftrace_event_class *class; 158 struct ftrace_event_class *class;
@@ -154,8 +164,15 @@ struct ftrace_event_call {
154 void *mod; 164 void *mod;
155 void *data; 165 void *data;
156 166
157 int enabled; 167 /*
158 int filter_active; 168 * 32 bit flags:
169 * bit 1: enabled
170 * bit 2: filter_active
171 *
172 * Must hold event_mutex to change.
173 */
174 unsigned int flags;
175
159 int perf_refcount; 176 int perf_refcount;
160}; 177};
161 178