summaryrefslogtreecommitdiffstats
path: root/arch/x86
diff options
context:
space:
mode:
authorMinfei Huang <mnfhuang@gmail.com>2015-09-17 00:19:42 +0800
committerSteven Rostedt <rostedt@goodmis.org>2015-10-22 15:44:24 -0400
commit883a1e867e0fe7c2dc2e5844ef692f80177631d5 (patch)
treeaf404d70021b6563ae8df94726e441e85511298a /arch/x86
parent3061692921f2d701bb09699d16ed780903dd54e2 (diff)
downloadlinux-883a1e867e0fe7c2dc2e5844ef692f80177631d5.tar.gz
linux-883a1e867e0fe7c2dc2e5844ef692f80177631d5.tar.bz2
linux-883a1e867e0fe7c2dc2e5844ef692f80177631d5.zip
ftrace: Calculate the correct dyn_ftrace number to report to the userspace
Now, ftrace only calculate the dyn_ftrace number in the adding breakpoint loop, not in adding update and finish update loop. Calculate the correct dyn_ftrace, once ftrace reports the failure message to the userspace. Link: http://lkml.kernel.org/r/1442420382-13130-1-git-send-email-mnfhuang@gmail.com Signed-off-by: Minfei Huang <mnfhuang@gmail.com> Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Diffstat (limited to 'arch/x86')
-rw-r--r--arch/x86/kernel/ftrace.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/arch/x86/kernel/ftrace.c b/arch/x86/kernel/ftrace.c
index 8b7b0a51e742..311bcf338f07 100644
--- a/arch/x86/kernel/ftrace.c
+++ b/arch/x86/kernel/ftrace.c
@@ -556,6 +556,7 @@ void ftrace_replace_code(int enable)
run_sync();
report = "updating code";
+ count = 0;
for_ftrace_rec_iter(iter) {
rec = ftrace_rec_iter_record(iter);
@@ -563,11 +564,13 @@ void ftrace_replace_code(int enable)
ret = add_update(rec, enable);
if (ret)
goto remove_breakpoints;
+ count++;
}
run_sync();
report = "removing breakpoints";
+ count = 0;
for_ftrace_rec_iter(iter) {
rec = ftrace_rec_iter_record(iter);
@@ -575,6 +578,7 @@ void ftrace_replace_code(int enable)
ret = finish_update(rec, enable);
if (ret)
goto remove_breakpoints;
+ count++;
}
run_sync();