[DTrace-devel] [PATCH] test: rework main lockstat test

Kris Van Hees kris.van.hees at oracle.com
Wed May 31 16:03:45 UTC 2023


On Wed, May 31, 2023 at 11:06:52AM -0400, Eugene Loh via DTrace-devel wrote:
> Reviewed-by: Eugene Loh <eugene.loh at oracle.com>
> 
> though I do wonder how the copyright year changed from 2017 to 2006,2023. 

Oops, cut'n'paste error.  Will change to 2017, 2023 as it ought to be.

> Also, whether instead of a .t file one could use "@@trigger: sleep" or
> "@@runtest-opts: sleep" (but maybe the "10" messes those options up?).

Yes (unless I am doing something really stupidly wrong - which is definitely
possible), I couldn't get it to work using runtest-opts or trigger with the
10s argument.  And since we have .t support anyway...

> Anyhow, looks fine.

Thanks.

> On 5/31/23 01:52, Kris Van Hees via DTrace-devel wrote:
> > diff --git a/test/unittest/lockstat/tst.lockstat.sh b/test/unittest/lockstat/tst.lockstat-summary.d
> > similarity index 72%
> > rename from test/unittest/lockstat/tst.lockstat.sh
> > rename to test/unittest/lockstat/tst.lockstat-summary.d
> > index dfa118e8..70b51ea4 100755
> > --- a/test/unittest/lockstat/tst.lockstat.sh
> > +++ b/test/unittest/lockstat/tst.lockstat-summary.d
> > @@ -1,24 +1,12 @@
> > -#!/bin/bash
> > -#
> > -# Oracle Linux DTrace.
> > -# Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
> > -# Licensed under the Universal Permissive License v 1.0 as shown at
> > -# http://oss.oracle.com/licenses/upl.
> > -#
> > +/*
> > + * Oracle Linux DTrace.
> > + * Copyright (c) 2006, 2023, Oracle and/or its affiliates. All rights reserved.
> > + * Licensed under the Universal Permissive License v 1.0 as shown at
> > + * http://oss.oracle.com/licenses/upl.
> > + */
> > -#
> > -# Test lockstat:::*acquire*, *release probes.
> > -#
> > -#
> > +#pragma D option quiet
> > -if (( $# != 1 )); then
> > -	print -u2 "expected one argument: <dtrace-path>"
> > -	exit 2
> > -fi
> > -
> > -dtrace=$1
> > -
> > -$dtrace $dt_flags -c "sleep 10" -qs /dev/stdin <<EODTRACE
> >   lockstat:::
> >   {
> >   	events[probename]++;
> > @@ -52,4 +40,3 @@ END
> >   	printf("lockstat:::spin-release - %s\n",
> >   	    events["spin-release"] > 0 ? "yes" : "no");
> >   }
> > -EODTRACE
> > diff --git a/test/unittest/lockstat/tst.lockstat-summary.t b/test/unittest/lockstat/tst.lockstat-summary.t
> > new file mode 100755
> > index 00000000..fec0d271
> > --- /dev/null
> > +++ b/test/unittest/lockstat/tst.lockstat-summary.t
> > @@ -0,0 +1,3 @@
> > +#!/bin/sh
> > +
> > +sleep 10s
> > diff --git a/test/unittest/lockstat/tst.lockstat-summary.x86_64.r b/test/unittest/lockstat/tst.lockstat-summary.x86_64.r
> > new file mode 100644
> > index 00000000..5bdc40c6
> > --- /dev/null
> > +++ b/test/unittest/lockstat/tst.lockstat-summary.x86_64.r
> > @@ -0,0 +1,13 @@
> > +Minimum lockstat events seen
> > +
> > +lockstat:::adaptive-spin - yes
> > +lockstat:::adaptive-block - yes
> > +lockstat:::adaptive-acquire - yes
> > +lockstat:::adaptive-release - yes
> > +lockstat:::rw-spin - yes
> > +lockstat:::rw-acquire - yes
> > +lockstat:::rw-release - yes
> > +lockstat:::spin-spin - yes
> > +lockstat:::spin-acquire - yes
> > +lockstat:::spin-release - yes
> > +
> 
> _______________________________________________
> DTrace-devel mailing list
> DTrace-devel at oss.oracle.com
> https://oss.oracle.com/mailman/listinfo/dtrace-devel



More information about the DTrace-devel mailing list