Re: [PATCH] tracing/probe: Test nr_args match in looking for same probe events

From: Srikar Dronamraju
Date: Fri Sep 27 2019 - 13:54:17 EST


> >
> > This has a side-effect where the newer probe has same argument commands, we
> > still end up appending the probe.
>
> ??
>
> How so?
>
> If the two have the same number of arguments we do exactly what we did
> before this patch. Please explain to me how that side effect would happen?
>
> It basically is doing, "if the two probes do not have the same number
> of arguments, don't bother comparing, because they are different."
>

Lets take the first probe has 3 arguments passed to it and the second probe
has just 2 arguments. If the first two arguments are same type, name, and
comm, should we append to the first probe? I think No, I would believe we
should append only if the comm of either of the arguments was different.

Example:
echo p:test _do_fork arg1=%ax arg2=%bx arg3=%cx >> kprobe_events

echo p:test _do_fork arg1=%ax arg2=%bx >> kprobe_events