[DTrace-devel] [PATCH] test: Have tst.ucaller use a predictable trigger

Kris Van Hees kris.van.hees at oracle.com
Wed Feb 26 16:54:38 UTC 2025


On Fri, Jan 10, 2025 at 02:03:06PM -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/vars/tst.ucaller.d  | 16 ++++++++++++
>  test/unittest/vars/tst.ucaller.r  |  2 +-
>  test/unittest/vars/tst.ucaller.sh | 42 -------------------------------
>  test/unittest/vars/tst.ucaller.x  |  1 -
>  4 files changed, 17 insertions(+), 44 deletions(-)
>  create mode 100644 test/unittest/vars/tst.ucaller.d
>  delete mode 100755 test/unittest/vars/tst.ucaller.sh
>  delete mode 120000 test/unittest/vars/tst.ucaller.x
> 
> diff --git a/test/unittest/vars/tst.ucaller.d b/test/unittest/vars/tst.ucaller.d
> new file mode 100644
> index 000000000..271297fef
> --- /dev/null
> +++ b/test/unittest/vars/tst.ucaller.d
> @@ -0,0 +1,16 @@
> +/*
> + * Oracle Linux DTrace.
> + * Copyright (c) 2025, 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.
> + */
> +
> +/* @@trigger: ustack-tst-basic */
> +
> +#pragma D option quiet
> +
> +pid$target:a.out:myfunc_x:entry
> +{
> +        ufunc(ucaller);
> +        exit(0);
> +}
> diff --git a/test/unittest/vars/tst.ucaller.r b/test/unittest/vars/tst.ucaller.r
> index 9b09daa0c..bfcc80f4d 100644
> --- a/test/unittest/vars/tst.ucaller.r
> +++ b/test/unittest/vars/tst.ucaller.r
> @@ -1 +1 @@
> -  libc.so.6`strdup                                  
> +  ustack-tst-basic`myfunc_v                         
> diff --git a/test/unittest/vars/tst.ucaller.sh b/test/unittest/vars/tst.ucaller.sh
> deleted file mode 100755
> index a6376af46..000000000
> --- a/test/unittest/vars/tst.ucaller.sh
> +++ /dev/null
> @@ -1,42 +0,0 @@
> -#!/bin/bash
> -#
> -# Oracle Linux DTrace.
> -# Copyright (c) 2007, 2020, 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.
> -#
> -# This test is a bit naughty; it's assuming that libc.so has an implementation
> -# of strup(3), and that it's implemented in terms of the libc.so
> -# implementation of malloc(3).  If you're reading this comment because
> -# those assumptions have become false, please accept my apologies...
> -#
> -# @@xfail: dtv2
> -
> -if [ $# != 1 ]; then
> -	echo expected one argument: '<'dtrace-path'>'
> -	exit 2
> -fi
> -
> -dtrace=$1
> -
> -$dtrace $dt_flags -qs /dev/stdin -c "/bin/wc -l /dev/zero" <<EOF
> -pid\$target::strdup:entry
> -{
> -	self->strdup = 1;
> -}
> -
> -pid\$target:libc.so:malloc:entry
> -/self->strdup/
> -{
> -	ufunc(ucaller);
> -	exit(0);
> -}
> -
> -pid\$target::strdup:return
> -/self->strdup/
> -{
> -	self->strdup = 0;
> -}
> -EOF
> -
> -exit 0
> diff --git a/test/unittest/vars/tst.ucaller.x b/test/unittest/vars/tst.ucaller.x
> deleted file mode 120000
> index 6507ccd87..000000000
> --- a/test/unittest/vars/tst.ucaller.x
> +++ /dev/null
> @@ -1 +0,0 @@
> -../pid/test.x
> \ No newline at end of file
> -- 
> 2.43.5
> 
> 
> _______________________________________________
> 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