summaryrefslogtreecommitdiff
path: root/kernel/trace/ftrace.c
diff options
context:
space:
mode:
authorAbhishek Sagar <sagar.abhishek@gmail.com>2008-05-25 00:10:04 +0530
committerThomas Gleixner <tglx@linutronix.de>2008-05-26 22:52:10 +0200
commit492a7ea5bcf263ee02a9eb6a3ab0222a1946fade (patch)
tree9905f9249f975751c1b880154753bb4c02d72ed3 /kernel/trace/ftrace.c
parentffdaa3582b6b39d625d585d07e329ffdc925e971 (diff)
downloadlwn-492a7ea5bcf263ee02a9eb6a3ab0222a1946fade.tar.gz
lwn-492a7ea5bcf263ee02a9eb6a3ab0222a1946fade.zip
ftrace: fix updating of ftrace_update_cnt
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>
Diffstat (limited to 'kernel/trace/ftrace.c')
-rw-r--r--kernel/trace/ftrace.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
index 9b7c54f8a62f..1843edc098a6 100644
--- a/kernel/trace/ftrace.c
+++ b/kernel/trace/ftrace.c
@@ -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;
@@ -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)
@@ -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++;
}
}