Skip to contentSkip to conversation

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

PATCH In review Minfei Huang 2 participants 3 messages Jul 22, 2015 – Aug 11, 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

From: Minfei Huang <[email protected]>

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
#1 lore raw

Ping.

Could someone help to review this patch?

Thanks
Minfei

Quoted 55 lines · Minfei Huang

From: Minfei Huang <[email protected]>

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 · 7 lines
2.4.0

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/
maintainer
#2 lore raw
Quoted 4 lines · On Tue, 11 Aug 2015 23:32:38 +0800 Minfei Huang <[email protected]> wrote:

Ping.

Could someone help to review this patch?

I'll take a look at it. I'm also getting ready to go to Seattle for LinuxCon/Plumbers. This isn't urgent. If there's nothing wrong with it, I'll try to get it into 4.3.

-- Steve