diff options
author | Li Zefan <lizf@cn.fujitsu.com> | 2009-08-31 04:49:41 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-08-31 04:58:08 -0400 |
commit | 8e254c1d183f0225ad21f9049641529e56cce4da (patch) | |
tree | 5b559726a38b60c6bc92b3c8667c676db1038701 /include | |
parent | 73222acf966792c7fda219724af963339be32e62 (diff) |
tracing/filters: Defer pred allocation
init_preds() allocates about 5392 bytes of memory (on x86_32) for
a TRACE_EVENT. With my config, at system boot total memory occupied
is:
5392 * (642 + 15) == 3459KB
642 == cat available_events | wc -l
15 == number of dirs in events/ftrace
That's quite a lot, so we'd better defer memory allocation util
it's needed, that's when filter is used.
Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Tom Zanussi <tzanussi@gmail.com>
Cc: Masami Hiramatsu <mhiramat@redhat.com>
LKML-Reference: <4A9B8EA5.6020700@cn.fujitsu.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/ftrace_event.h | 1 | ||||
-rw-r--r-- | include/linux/syscalls.h | 2 | ||||
-rw-r--r-- | include/trace/ftrace.h | 1 |
3 files changed, 0 insertions, 4 deletions
diff --git a/include/linux/ftrace_event.h b/include/linux/ftrace_event.h index ace2da9e0a0d..755480484eb6 100644 --- a/include/linux/ftrace_event.h +++ b/include/linux/ftrace_event.h | |||
@@ -133,7 +133,6 @@ struct ftrace_event_call { | |||
133 | #define MAX_FILTER_PRED 32 | 133 | #define MAX_FILTER_PRED 32 |
134 | #define MAX_FILTER_STR_VAL 128 | 134 | #define MAX_FILTER_STR_VAL 128 |
135 | 135 | ||
136 | extern int init_preds(struct ftrace_event_call *call); | ||
137 | extern void destroy_preds(struct ftrace_event_call *call); | 136 | extern void destroy_preds(struct ftrace_event_call *call); |
138 | extern int filter_match_preds(struct ftrace_event_call *call, void *rec); | 137 | extern int filter_match_preds(struct ftrace_event_call *call, void *rec); |
139 | extern int filter_current_check_discard(struct ftrace_event_call *call, | 138 | extern int filter_current_check_discard(struct ftrace_event_call *call, |
diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h index f124c8995555..a8e37821cc60 100644 --- a/include/linux/syscalls.h +++ b/include/linux/syscalls.h | |||
@@ -177,7 +177,6 @@ static void prof_sysexit_disable_##sname(struct ftrace_event_call *event_call) \ | |||
177 | event_enter_##sname.id = id; \ | 177 | event_enter_##sname.id = id; \ |
178 | set_syscall_enter_id(num, id); \ | 178 | set_syscall_enter_id(num, id); \ |
179 | INIT_LIST_HEAD(&event_enter_##sname.fields); \ | 179 | INIT_LIST_HEAD(&event_enter_##sname.fields); \ |
180 | init_preds(&event_enter_##sname); \ | ||
181 | return 0; \ | 180 | return 0; \ |
182 | } \ | 181 | } \ |
183 | TRACE_SYS_ENTER_PROFILE(sname); \ | 182 | TRACE_SYS_ENTER_PROFILE(sname); \ |
@@ -214,7 +213,6 @@ static void prof_sysexit_disable_##sname(struct ftrace_event_call *event_call) \ | |||
214 | event_exit_##sname.id = id; \ | 213 | event_exit_##sname.id = id; \ |
215 | set_syscall_exit_id(num, id); \ | 214 | set_syscall_exit_id(num, id); \ |
216 | INIT_LIST_HEAD(&event_exit_##sname.fields); \ | 215 | INIT_LIST_HEAD(&event_exit_##sname.fields); \ |
217 | init_preds(&event_exit_##sname); \ | ||
218 | return 0; \ | 216 | return 0; \ |
219 | } \ | 217 | } \ |
220 | TRACE_SYS_EXIT_PROFILE(sname); \ | 218 | TRACE_SYS_EXIT_PROFILE(sname); \ |
diff --git a/include/trace/ftrace.h b/include/trace/ftrace.h index 57c56a998ee6..bfbc842600a1 100644 --- a/include/trace/ftrace.h +++ b/include/trace/ftrace.h | |||
@@ -622,7 +622,6 @@ static int ftrace_raw_init_event_##call(void) \ | |||
622 | return -ENODEV; \ | 622 | return -ENODEV; \ |
623 | event_##call.id = id; \ | 623 | event_##call.id = id; \ |
624 | INIT_LIST_HEAD(&event_##call.fields); \ | 624 | INIT_LIST_HEAD(&event_##call.fields); \ |
625 | init_preds(&event_##call); \ | ||
626 | return 0; \ | 625 | return 0; \ |
627 | } \ | 626 | } \ |
628 | \ | 627 | \ |