aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/trace/ftrace.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/trace/ftrace.c')
-rw-r--r--kernel/trace/ftrace.c14
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
273static int ftrace_filtered; 273static int ftrace_filtered;
274 274
275static LIST_HEAD(ftrace_new_addrs); 275static struct dyn_ftrace *ftrace_new_addrs;
276 276
277static DEFINE_MUTEX(ftrace_regex_lock); 277static 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
717static int ftrace_update_code(struct module *mod) 717static 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)) {