diff options
author | Lai Jiangshan <laijs@cn.fujitsu.com> | 2009-03-13 05:51:27 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-03-13 06:36:20 -0400 |
commit | e94142a67f8bad494c593f0a07c9fc2fbec98c0e (patch) | |
tree | 75419622606aa186da5592302c91cb93471bec26 /kernel/trace/ftrace.c | |
parent | 850a80cfaa5aec3e626eb3736eff890a80e4fa77 (diff) |
ftrace: remove struct list_head from struct dyn_ftrace
Impact: save memory
The struct dyn_ftrace table is very large, this patch will save
about 50%.
Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com>
Cc: Steven Rostedt <srostedt@redhat.com>
LKML-Reference: <49BA2C9F.8020009@cn.fujitsu.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel/trace/ftrace.c')
-rw-r--r-- | kernel/trace/ftrace.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c index bf78a4c75c67..90d5729afeff 100644 --- a/kernel/trace/ftrace.c +++ b/kernel/trace/ftrace.c | |||
@@ -272,7 +272,7 @@ enum { | |||
272 | 272 | ||
273 | static int ftrace_filtered; | 273 | static int ftrace_filtered; |
274 | 274 | ||
275 | static LIST_HEAD(ftrace_new_addrs); | 275 | static struct dyn_ftrace *ftrace_new_addrs; |
276 | 276 | ||
277 | static DEFINE_MUTEX(ftrace_regex_lock); | 277 | static DEFINE_MUTEX(ftrace_regex_lock); |
278 | 278 | ||
@@ -409,8 +409,8 @@ ftrace_record_ip(unsigned long ip) | |||
409 | return NULL; | 409 | return NULL; |
410 | 410 | ||
411 | rec->ip = ip; | 411 | rec->ip = ip; |
412 | 412 | rec->flags = (unsigned long)ftrace_new_addrs; | |
413 | list_add(&rec->list, &ftrace_new_addrs); | 413 | ftrace_new_addrs = rec; |
414 | 414 | ||
415 | return rec; | 415 | return rec; |
416 | } | 416 | } |
@@ -716,19 +716,21 @@ unsigned long ftrace_update_tot_cnt; | |||
716 | 716 | ||
717 | static int ftrace_update_code(struct module *mod) | 717 | static int ftrace_update_code(struct module *mod) |
718 | { | 718 | { |
719 | struct dyn_ftrace *p, *t; | 719 | struct dyn_ftrace *p; |
720 | cycle_t start, stop; | 720 | cycle_t start, stop; |
721 | 721 | ||
722 | start = ftrace_now(raw_smp_processor_id()); | 722 | start = ftrace_now(raw_smp_processor_id()); |
723 | ftrace_update_cnt = 0; | 723 | ftrace_update_cnt = 0; |
724 | 724 | ||
725 | list_for_each_entry_safe(p, t, &ftrace_new_addrs, list) { | 725 | while (ftrace_new_addrs) { |
726 | 726 | ||
727 | /* If something went wrong, bail without enabling anything */ | 727 | /* If something went wrong, bail without enabling anything */ |
728 | if (unlikely(ftrace_disabled)) | 728 | if (unlikely(ftrace_disabled)) |
729 | return -1; | 729 | return -1; |
730 | 730 | ||
731 | list_del_init(&p->list); | 731 | p = ftrace_new_addrs; |
732 | ftrace_new_addrs = (struct dyn_ftrace *)p->flags; | ||
733 | p->flags = 0L; | ||
732 | 734 | ||
733 | /* convert record (i.e, patch mcount-call with NOP) */ | 735 | /* convert record (i.e, patch mcount-call with NOP) */ |
734 | if (ftrace_code_disable(mod, p)) { | 736 | if (ftrace_code_disable(mod, p)) { |