[DTrace-devel] [PATCH] test: clean up orphaned tracing events between tests

Nick Alcock nick.alcock at oracle.com
Wed Jun 7 16:39:19 UTC 2023


On 7 Jun 2023, Kris Van Hees verbalised:

> On Wed, Jun 07, 2023 at 11:09:45AM +0100, Nick Alcock wrote:
>> On 7 Jun 2023, Kris Van Hees via DTrace-devel outgrape:
>> 
>> > Signed-off-by: Kris Van Hees <kris.van.hees at oracle.com>
>> 
>> Significant changes suggested below: equally significant reduction in
>> runtime expected :)
>
> The reduction in runtime is actually minimal, but improvements are welcome
> either way.  But... not really significant in the overall cost of the
> testsuite by any means.
>
> I'll send a v2.
>
>> > ---
>> >  runtest.sh                 |   2 +
>> >  test/utils/Build           |   2 +-
>> >  test/utils/clean_probes.sh | 102 +++++++++++++++++++++++++++++++++++++
>> >  3 files changed, 105 insertions(+), 1 deletion(-)
>> >  create mode 100755 test/utils/clean_probes.sh
>> >
>> > diff --git a/runtest.sh b/runtest.sh
>> > index a39a1c91..17589d85 100755
>> > --- a/runtest.sh
>> > +++ b/runtest.sh
>> > @@ -1500,6 +1500,8 @@ for dt in $dtrace; do
>> >              cp -f $tmpdir/test.out $base.r
>> >          fi
>> >  
>> > +	test/utils/clean_probes.sh >> $LOGFILE
>> > +
>> 
>> Total pedantry: runtest.sh uses spaces, not tabs :)
>
> OK - why?

History, I wrote it and I hate using tabs for indentation :P it makes
text editor cursors jump about unpleasantly, doesn't help anything and
the space saving is effectively nil on modern systems. So I do it only
when existing codebases require.

>> > +# Scan the list of events for any orphaned DTrace probes
>> > +(
>> > +	ps -e
>> 
>> Rather than using a ps -e and then parsing the heck out of it, why not
>> do something like
>
> Um... "parsing the heck out of it" ??  The AWK script was checking the number
> of fields in the input line and then looked for /dtrace/.  That's more like
> minimal parsing.

True, it was hyperbolic -- but relying on the number of fields output by
ps is a bit terrifying :)

-- 
NULL && (void)



More information about the DTrace-devel mailing list