Skip to content

Commit f8d7ab2

Browse files
srikardrostedt
authored andcommitted
tracing/probe: Fix same probe event argument matching
Commit fe60b0c ("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. Link: http://lkml.kernel.org/r/[email protected] Fixes: fe60b0c ("tracing/probe: Reject exactly same probe event") Acked-by: Masami Hiramatsu <[email protected]> Signed-off-by: Srikar Dronamraju <[email protected]> Signed-off-by: Steven Rostedt (VMware) <[email protected]>
1 parent b78b94b commit f8d7ab2

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

kernel/trace/trace_kprobe.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -549,10 +549,11 @@ static bool trace_kprobe_has_same_kprobe(struct trace_kprobe *orig,
549549
for (i = 0; i < orig->tp.nr_args; i++) {
550550
if (strcmp(orig->tp.args[i].comm,
551551
comp->tp.args[i].comm))
552-
continue;
552+
break;
553553
}
554554

555-
return true;
555+
if (i == orig->tp.nr_args)
556+
return true;
556557
}
557558

558559
return false;

kernel/trace/trace_uprobe.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -431,10 +431,11 @@ static bool trace_uprobe_has_same_uprobe(struct trace_uprobe *orig,
431431
for (i = 0; i < orig->tp.nr_args; i++) {
432432
if (strcmp(orig->tp.args[i].comm,
433433
comp->tp.args[i].comm))
434-
continue;
434+
break;
435435
}
436436

437-
return true;
437+
if (i == orig->tp.nr_args)
438+
return true;
438439
}
439440

440441
return false;

0 commit comments

Comments
 (0)