[DTrace-devel] [PATCH v7 5/6] usdt: new tests for USDT arg sanity with overlapping pid probes

Eugene Loh eugene.loh at oracle.com
Fri Nov 8 18:30:27 UTC 2024


On 11/8/24 08:13, Nick Alcock wrote:

> On 7 Nov 2024, Eugene Loh uttered the following:
>
>> On 11/6/24 06:29, Nick Alcock wrote:
>>> Signed-off-by: Nick Alcock <nick.alcock at oracle.com>
>>> ---
>>>    .../usdt/{tst.pidprobes.sh => pidprobes.sh}   | 56 +++++++++++++++----
>> Why the renaming?  And, will "./runtest.sh" run pidprobes.sh without any command-line args?
> Nope! It's a library now, called by tst.pid*sh, including, uh, the new
> tst.pidprobes.sh I meant to keep around and call it. Oops!

"Nope"?  It seems to me that runtest.sh does indeed call pidprobes.sh 
without any command-line args.  It looks in test/unittest/usdt and sees 
a .sh file and runs it.  The fact that the .sh does not start with 
"tst." is irrelevant.  Indeed, we have lots of tests that do not start 
with "tst." (nor "err." nor "drp." etc.).  So if pidprobes.sh is not 
supposed to be run by runtest.sh directly, it has to be hidden better 
than simply by stripping tst. from its name.

I suppose there is no harm in runtest.sh running pidprobes.sh directly 
(with no command-line arguments) except generations from now someone 
will be wondering what it's supposed to do.

Incidentally, there is an orphaned tst.pidprobes.r file.
>>> --- a/test/unittest/usdt/tst.pidprobes.sh
>>> +++ b/test/unittest/usdt/pidprobes.sh
>>> @@ -5,9 +5,12 @@
>>>    # Licensed under the Universal Permissive License v 1.0 as shown at
>>>    # http://oss.oracle.com/licenses/upl.
>>>    #
>>> -# This test verifies that USDT and pid probes can share underlying probes.
>>> +# This test verifies various properties of USDT and pid probes sharing
>>> +# underlying probes.
>>>      dtrace=$1
>>> +usdt=$2
>> Why is there a usdt=$2?  It seems that usdt is always "t" and you'd expect that in test/unittest/usdt.
> Oh crap. Sorry sorry this is a bug -- I lost the tst.pidprobes.sh I
> meant to add back. Will fix and repush this patch.

The patch has perhaps already landed.  So, a delta patch might be needed.

> -- which reads, in entirety
>
> exec $(dirname $_test)/pidprobes.sh $1 "" ""

Or, just let runtest.sh call it directly, as it does anyhow.



More information about the DTrace-devel mailing list