Commit e94142a6 authored by Lai Jiangshan's avatar Lai Jiangshan Committed by Ingo Molnar

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: default avatarLai Jiangshan <laijs@cn.fujitsu.com>
Cc: Steven Rostedt <srostedt@redhat.com>
LKML-Reference: <49BA2C9F.8020009@cn.fujitsu.com>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
parent 850a80cf
...@@ -145,7 +145,6 @@ enum { ...@@ -145,7 +145,6 @@ enum {
}; };
struct dyn_ftrace { struct dyn_ftrace {
struct list_head list;
unsigned long ip; /* address of mcount call-site */ unsigned long ip; /* address of mcount call-site */
unsigned long flags; unsigned long flags;
struct dyn_arch_ftrace arch; struct dyn_arch_ftrace arch;
......
...@@ -272,7 +272,7 @@ enum { ...@@ -272,7 +272,7 @@ enum {
static int ftrace_filtered; static int ftrace_filtered;
static LIST_HEAD(ftrace_new_addrs); static struct dyn_ftrace *ftrace_new_addrs;
static DEFINE_MUTEX(ftrace_regex_lock); static DEFINE_MUTEX(ftrace_regex_lock);
...@@ -409,8 +409,8 @@ ftrace_record_ip(unsigned long ip) ...@@ -409,8 +409,8 @@ ftrace_record_ip(unsigned long ip)
return NULL; return NULL;
rec->ip = ip; rec->ip = ip;
rec->flags = (unsigned long)ftrace_new_addrs;
list_add(&rec->list, &ftrace_new_addrs); ftrace_new_addrs = rec;
return rec; return rec;
} }
...@@ -716,19 +716,21 @@ unsigned long ftrace_update_tot_cnt; ...@@ -716,19 +716,21 @@ unsigned long ftrace_update_tot_cnt;
static int ftrace_update_code(struct module *mod) static int ftrace_update_code(struct module *mod)
{ {
struct dyn_ftrace *p, *t; struct dyn_ftrace *p;
cycle_t start, stop; cycle_t start, stop;
start = ftrace_now(raw_smp_processor_id()); start = ftrace_now(raw_smp_processor_id());
ftrace_update_cnt = 0; ftrace_update_cnt = 0;
list_for_each_entry_safe(p, t, &ftrace_new_addrs, list) { while (ftrace_new_addrs) {
/* If something went wrong, bail without enabling anything */ /* If something went wrong, bail without enabling anything */
if (unlikely(ftrace_disabled)) if (unlikely(ftrace_disabled))
return -1; return -1;
list_del_init(&p->list); p = ftrace_new_addrs;
ftrace_new_addrs = (struct dyn_ftrace *)p->flags;
p->flags = 0L;
/* convert record (i.e, patch mcount-call with NOP) */ /* convert record (i.e, patch mcount-call with NOP) */
if (ftrace_code_disable(mod, p)) { if (ftrace_code_disable(mod, p)) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment