Commit 883a1e86 authored by Minfei Huang's avatar Minfei Huang Committed by Steven Rostedt

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.comSigned-off-by: default avatarMinfei Huang <mnfhuang@gmail.com>
Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
parent 30616929
...@@ -556,6 +556,7 @@ void ftrace_replace_code(int enable) ...@@ -556,6 +556,7 @@ void ftrace_replace_code(int enable)
run_sync(); run_sync();
report = "updating code"; report = "updating code";
count = 0;
for_ftrace_rec_iter(iter) { for_ftrace_rec_iter(iter) {
rec = ftrace_rec_iter_record(iter); rec = ftrace_rec_iter_record(iter);
...@@ -563,11 +564,13 @@ void ftrace_replace_code(int enable) ...@@ -563,11 +564,13 @@ void ftrace_replace_code(int enable)
ret = add_update(rec, enable); ret = add_update(rec, enable);
if (ret) if (ret)
goto remove_breakpoints; goto remove_breakpoints;
count++;
} }
run_sync(); run_sync();
report = "removing breakpoints"; report = "removing breakpoints";
count = 0;
for_ftrace_rec_iter(iter) { for_ftrace_rec_iter(iter) {
rec = ftrace_rec_iter_record(iter); rec = ftrace_rec_iter_record(iter);
...@@ -575,6 +578,7 @@ void ftrace_replace_code(int enable) ...@@ -575,6 +578,7 @@ void ftrace_replace_code(int enable)
ret = finish_update(rec, enable); ret = finish_update(rec, enable);
if (ret) if (ret)
goto remove_breakpoints; goto remove_breakpoints;
count++;
} }
run_sync(); run_sync();
......
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