Skip to contentSkip to conversation

tracing/probe: Fix same probe event argument matching

GIT PULL Merged Steven Rostedt 2 participants 2 messages Sep 26, 2019 Tracing

lore
Share & tools
lore

Steven Rostedt

author maintainer
#0 lore raw

Linus,

Srikar Dronamraju fixed a bug in the new multi probe code.

Please pull the latest trace-v5.4-2 tree, which can be found at:

git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace.git
trace-v5.4-2

Tag SHA1: ba75d3b05b6e1e995b9c934f8e387c93e879c18b Head SHA1: f8d7ab2bded897607bff6324d5c6ea6b4aecca0c

Srikar Dronamraju (1):
tracing/probe: Fix same probe event argument matching

----

 kernel/trace/trace_kprobe.c | 5 +++--
 kernel/trace/trace_uprobe.c | 5 +++--
 2 files changed, 6 insertions(+), 4 deletions(-)
---------------------------
commit f8d7ab2bded897607bff6324d5c6ea6b4aecca0c
Author: Srikar Dronamraju <[email protected]>
Date:   Tue Sep 24 17:19:06 2019 +0530

tracing/probe: Fix same probe event argument matching

Commit fe60b0ce8e73 ("tracing/probe: Reject exactly same probe event") tries to reject a event which matches an already existing probe.

However it currently continues to match arguments and rejects adding a probe even when the arguments don't match. Fix this by only rejecting a probe if and only if all the arguments match.

Fixes fe60b0ce8e73 ("tracing/probe: Reject exactly same probe event")
kernel/trace/trace_kprobe.c +3 -2
index a6697e28ddda..402dc3ce88d3 100644
@@ -549,10 +549,11 @@ static bool trace_kprobe_has_same_kprobe(struct trace_kprobe *orig,
 		for (i = 0; i < orig->tp.nr_args; i++) {
 			if (strcmp(orig->tp.args[i].comm,
 				   comp->tp.args[i].comm))
-				continue;
+				break;
 		}
 
-		return true;
+		if (i == orig->tp.nr_args)
+			return true;
 	}
 
 	return false;
kernel/trace/trace_uprobe.c +3 -2
index 34dd6d0016a3..dd884341f5c5 100644
@@ -431,10 +431,11 @@ static bool trace_uprobe_has_same_uprobe(struct trace_uprobe *orig,
 		for (i = 0; i < orig->tp.nr_args; i++) {
 			if (strcmp(orig->tp.args[i].comm,
 				   comp->tp.args[i].comm))
-				continue;
+				break;
 		}
 
-		return true;
+		if (i == orig->tp.nr_args)
+			return true;
 	}
 
 	return false;
merge bot Merged
#1 lore raw
The pull request you sent on Thu, 26 Sep 2019 05:09:26 -0400:

The pull request you sent on Thu, 26 Sep 2019 05:09:26 -0400:

Quoted 1 line

git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace.git trace-v5.4-2

has been merged into torvalds/linux.git:
https://git.kernel.org/torvalds/c/7897c04ad09f815aea1f2dbb05825887d4494a74

Thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.wiki.kernel.org/userdoc/prtracker