[DTrace-devel] [PATCH] test: Test disassembly annotation of variable access

Kris Van Hees kris.van.hees at oracle.com
Thu Jan 27 18:57:40 UTC 2022


Two things...

1. Please update the tests to match the one I have for TLS vars in my patch
   (for consistency).
2. No need to do TLS vars (tvar) because I already have that one in my patch.

On Thu, Jan 27, 2022 at 01:34:25PM -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>
> ---
>  test/unittest/variables/gvar/tst.dis-ann.r  |  2 ++
>  test/unittest/variables/gvar/tst.dis-ann.sh | 20 ++++++++++++++++++++
>  test/unittest/variables/lvar/tst.dis-ann.r  |  2 ++
>  test/unittest/variables/lvar/tst.dis-ann.sh | 20 ++++++++++++++++++++
>  test/unittest/variables/tvar/tst.dis-ann.r  |  2 ++
>  test/unittest/variables/tvar/tst.dis-ann.sh | 20 ++++++++++++++++++++
>  6 files changed, 66 insertions(+)
>  create mode 100644 test/unittest/variables/gvar/tst.dis-ann.r
>  create mode 100755 test/unittest/variables/gvar/tst.dis-ann.sh
>  create mode 100644 test/unittest/variables/lvar/tst.dis-ann.r
>  create mode 100755 test/unittest/variables/lvar/tst.dis-ann.sh
>  create mode 100644 test/unittest/variables/tvar/tst.dis-ann.r
>  create mode 100755 test/unittest/variables/tvar/tst.dis-ann.sh
> 
> diff --git a/test/unittest/variables/gvar/tst.dis-ann.r b/test/unittest/variables/gvar/tst.dis-ann.r
> new file mode 100644
> index 00000000..95586362
> --- /dev/null
> +++ b/test/unittest/variables/gvar/tst.dis-ann.r
> @@ -0,0 +1,2 @@
> +ldw foo
> +stw foo
> diff --git a/test/unittest/variables/gvar/tst.dis-ann.sh b/test/unittest/variables/gvar/tst.dis-ann.sh
> new file mode 100755
> index 00000000..291c64e8
> --- /dev/null
> +++ b/test/unittest/variables/gvar/tst.dis-ann.sh
> @@ -0,0 +1,20 @@
> +#!/bin/bash
> +# 
> +# Oracle Linux DTrace.
> +# Copyright (c) 2022, 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
> +
> +$dtrace $dt_flags -Sen '
> +BEGIN
> +{
> +	foo = 42;
> +	trace(foo);
> +	exit(0);
> +}
> +' 2>&1 | awk '/foo/ && !/D type/ { print $8, $NF }'
> +
> +exit $?
> diff --git a/test/unittest/variables/lvar/tst.dis-ann.r b/test/unittest/variables/lvar/tst.dis-ann.r
> new file mode 100644
> index 00000000..a10af5a8
> --- /dev/null
> +++ b/test/unittest/variables/lvar/tst.dis-ann.r
> @@ -0,0 +1,2 @@
> +ldw this->foo
> +stw this->foo
> diff --git a/test/unittest/variables/lvar/tst.dis-ann.sh b/test/unittest/variables/lvar/tst.dis-ann.sh
> new file mode 100755
> index 00000000..bf3b9b83
> --- /dev/null
> +++ b/test/unittest/variables/lvar/tst.dis-ann.sh
> @@ -0,0 +1,20 @@
> +#!/bin/bash
> +# 
> +# Oracle Linux DTrace.
> +# Copyright (c) 2022, 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
> +
> +$dtrace $dt_flags -Sen '
> +BEGIN
> +{
> +	this->foo = 42;
> +	trace(this->foo);
> +	exit(0);
> +}
> +' 2>&1 | awk '/foo/ && !/D type/ { print $8, $NF }'
> +
> +exit $?
> diff --git a/test/unittest/variables/tvar/tst.dis-ann.r b/test/unittest/variables/tvar/tst.dis-ann.r
> new file mode 100644
> index 00000000..f02effb1
> --- /dev/null
> +++ b/test/unittest/variables/tvar/tst.dis-ann.r
> @@ -0,0 +1,2 @@
> +call self->foo
> +call self->foo
> diff --git a/test/unittest/variables/tvar/tst.dis-ann.sh b/test/unittest/variables/tvar/tst.dis-ann.sh
> new file mode 100755
> index 00000000..9d28ab3b
> --- /dev/null
> +++ b/test/unittest/variables/tvar/tst.dis-ann.sh
> @@ -0,0 +1,20 @@
> +#!/bin/bash
> +# 
> +# Oracle Linux DTrace.
> +# Copyright (c) 2022, 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
> +
> +$dtrace $dt_flags -Sen '
> +BEGIN
> +{
> +	self->foo = 42;
> +	trace(self->foo);
> +	exit(0);
> +}
> +' 2>&1 | awk '/foo/ && !/D type/ { print $8, $NF }'
> +
> +exit $?
> -- 
> 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