Skip to content

Commit

Permalink
ftrace: fix updating of ftrace_update_cnt
Browse files Browse the repository at this point in the history
Hi Ingo/Steven,

Ftrace currently maintains an update count which includes false updates,
i.e, updates which failed. If anything, such failures should be tracked
by some separate variable, but this patch provides a minimal fix.

Signed-off-by: Abhishek Sagar <sagar.abhishek@gmail.com>
Cc: rostedt@goodmis.org
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
  • Loading branch information
Abhishek Sagar authored and Thomas Gleixner committed May 26, 2008
1 parent ffdaa35 commit 492a7ea
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions kernel/trace/ftrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,7 @@ static void ftrace_shutdown_replenish(void)
ftrace_pages->next = (void *)get_zeroed_page(GFP_KERNEL);
}

static void
static int
ftrace_code_disable(struct dyn_ftrace *rec)
{
unsigned long ip;
Expand All @@ -469,7 +469,9 @@ ftrace_code_disable(struct dyn_ftrace *rec)
if (failed) {
rec->flags |= FTRACE_FL_FAILED;
ftrace_free_rec(rec);
return 0;
}
return 1;
}

static int __ftrace_modify_code(void *data)
Expand Down Expand Up @@ -617,8 +619,8 @@ static int __ftrace_update_code(void *ignore)

/* all CPUS are stopped, we are safe to modify code */
hlist_for_each_entry(p, t, &head, node) {
ftrace_code_disable(p);
ftrace_update_cnt++;
if (ftrace_code_disable(p))
ftrace_update_cnt++;
}

}
Expand Down

0 comments on commit 492a7ea

Please sign in to comment.