[DTrace-devel] [PATCH] test: rework main lockstat test
Eugene Loh
eugene.loh at oracle.com
Wed May 31 15:06:52 UTC 2023
Reviewed-by: Eugene Loh <eugene.loh at oracle.com>
though I do wonder how the copyright year changed from 2017 to
2006,2023. Also, whether instead of a .t file one could use "@@trigger:
sleep" or "@@runtest-opts: sleep" (but maybe the "10" messes those
options up?).
Anyhow, looks fine.
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
> +
More information about the DTrace-devel
mailing list