[DTrace-devel] [PATCH] test: Add test for option "tregs"
Kris Van Hees
kris.van.hees at oracle.com
Fri Feb 24 07:41:20 UTC 2023
On Fri, Feb 17, 2023 at 09:38:18PM -0500, eugene.loh--- via DTrace-devel wrote:
> From: Eugene Loh <eugene.loh at oracle.com>
>
> Signed-off-by: Eugene Loh <eugene.loh at oracle.com>
Reviewed-by: Kris Van Hees <kris.van.hees at oracle.com>
> ---
> test/unittest/options/tst.tregs.r | 11 +++++++++++
> test/unittest/options/tst.tregs.sh | 14 ++++++++++++++
> 2 files changed, 25 insertions(+)
> create mode 100644 test/unittest/options/tst.tregs.r
> create mode 100755 test/unittest/options/tst.tregs.sh
>
> diff --git a/test/unittest/options/tst.tregs.r b/test/unittest/options/tst.tregs.r
> new file mode 100644
> index 00000000..79c16047
> --- /dev/null
> +++ b/test/unittest/options/tst.tregs.r
> @@ -0,0 +1,11 @@
> +tregs 3 gives 1
> +tregs 5 gives 1
> +
> + 1 2 3 4 5 6 7 1
> +tregs 9 gives 0
> +
> + 1 2 3 4 5 6 7 1
> +tregs 11 gives 0
> +-- @@stderr --
> +dtrace: invalid probe specifier BEGIN { @[1, 2, 3, 4, 5, 6, 7] = count(); exit(0) }: Insufficient tuple registers to generate code
> +dtrace: invalid probe specifier BEGIN { @[1, 2, 3, 4, 5, 6, 7] = count(); exit(0) }: Insufficient tuple registers to generate code
> diff --git a/test/unittest/options/tst.tregs.sh b/test/unittest/options/tst.tregs.sh
> new file mode 100755
> index 00000000..85ff18e4
> --- /dev/null
> +++ b/test/unittest/options/tst.tregs.sh
> @@ -0,0 +1,14 @@
> +#!/bin/bash
> +#
> +# Oracle Linux DTrace.
> +# Copyright (c) 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.
> +#
> +
> +dtrace=$1
> +
> +for x in 3 5 9 11; do
> + $dtrace -xtregs=$x -qn 'BEGIN { @[1, 2, 3, 4, 5, 6, 7] = count(); exit(0) }'
> + echo "tregs $x gives $?"
> +done
> --
> 2.18.4
>
>
> _______________________________________________
> 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