Skip to contentSkip to conversation

ftrace: Calculate the correct dyn_ftrace number to report to the userspace

PATCH In review Minfei Huang 2 participants 5 messages Sep 16, 2015 – Oct 22, 2015

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---
 arch/x86/kernel/ftrace.c | 4 ++++
 1 file changed, 4 insertions(+)
arch/x86/kernel/ftrace.c +4 -0
index 8b7b0a5..311bcf3 100644
@@ -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();
Signature · 1 line
2.4.0
maintainer
#1 lore raw
Quoted 6 lines · On Thu, 17 Sep 2015 00:19:42 +0800 Minfei Huang <[email protected]> wrote:

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.

Bah, your emails got lost in my Inbox. Sorry about that.

I'll make an effort to look at this first thing tomorrow.

[ Cc'ing myself to remind me ]

-- Steve

Quoted 39 lines
---
 arch/x86/kernel/ftrace.c | 4 ++++
 1 file changed, 4 insertions(+)
arch/x86/kernel/ftrace.c +4 -0
index 8b7b0a5..311bcf3 100644
@@ -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();
#2 lore raw
Quoted 6 lines · Steven Rostedt
Quoted 3 lines · On Thu, 17 Sep 2015 00:19:42 +0800 Minfei Huang <[email protected]> wrote:

Now, ftrace only calculate the dyn_ftrace number in the adding breakpoint loop, not in adding update and finish update loop.

Quoted 7 lines
Quoted 3 lines

Calculate the correct dyn_ftrace, once ftrace reports the failure message to the userspace.

Bah, your emails got lost in my Inbox. Sorry about that.

I'll make an effort to look at this first thing tomorrow.

Ping. Any comment is appreciate.

Thanks
Minfei

Quoted 45 lines

[ Cc'ing myself to remind me ]

-- Steve

Quoted 39 lines
---
 arch/x86/kernel/ftrace.c | 4 ++++
 1 file changed, 4 insertions(+)
arch/x86/kernel/ftrace.c +4 -0
index 8b7b0a5..311bcf3 100644
@@ -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();
maintainer
#3 lore raw
Quoted 11 lines · On Thu, 22 Oct 2015 13:14:07 +0800 Minfei Huang <[email protected]> wrote:
Quoted 10 lines · Steven Rostedt
Quoted 6 lines · On Thu, 17 Sep 2015 00:19:42 +0800 Minfei Huang <[email protected]> wrote:

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.

Quoted 12 lines
Quoted 3 lines

Bah, your emails got lost in my Inbox. Sorry about that.

I'll make an effort to look at this first thing tomorrow.

Ping. Any comment is appreciate.

Thanks
Minfei

Quoted 3 lines

[ Cc'ing myself to remind me ]

And I still forgot :-/

OK, I'm looking at it now.

-- Steve

maintainer
#4 lore raw
In reply to Minfei Huang
Quoted 11 lines · On Thu, 22 Oct 2015 13:14:07 +0800 Minfei Huang <[email protected]> wrote:
Quoted 10 lines · Steven Rostedt
Quoted 6 lines · On Thu, 17 Sep 2015 00:19:42 +0800 Minfei Huang <[email protected]> wrote:

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.

Quoted 6 lines
Quoted 3 lines

Bah, your emails got lost in my Inbox. Sorry about that.

I'll make an effort to look at this first thing tomorrow.

Ping. Any comment is appreciate.

Looks fine. I'm pulling it into my queue and testing it.

-- Steve