Linux DTrace development list
 help / color / mirror / Atom feed
* [PATCH] test: Have tst.ucaller use a predictable trigger
@ 2025-01-10 19:03 eugene.loh
  2025-02-26 16:54 ` [DTrace-devel] " Kris Van Hees
  0 siblings, 1 reply; 2+ messages in thread
From: eugene.loh @ 2025-01-10 19:03 UTC (permalink / raw)
  To: dtrace, dtrace-devel

From: Eugene Loh <eugene.loh@oracle.com>

Signed-off-by: Eugene Loh <eugene.loh@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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [DTrace-devel] [PATCH] test: Have tst.ucaller use a predictable trigger
  2025-01-10 19:03 [PATCH] test: Have tst.ucaller use a predictable trigger eugene.loh
@ 2025-02-26 16:54 ` Kris Van Hees
  0 siblings, 0 replies; 2+ messages in thread
From: Kris Van Hees @ 2025-02-26 16:54 UTC (permalink / raw)
  To: eugene.loh; +Cc: dtrace, dtrace-devel

On Fri, Jan 10, 2025 at 02:03:06PM -0500, eugene.loh--- via DTrace-devel wrote:
> From: Eugene Loh <eugene.loh@oracle.com>
> 
> Signed-off-by: Eugene Loh <eugene.loh@oracle.com>

Reviewed-by: Kris Van Hees <kris.van.hees@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@oss.oracle.com
> https://oss.oracle.com/mailman/listinfo/dtrace-devel

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-02-26 16:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-10 19:03 [PATCH] test: Have tst.ucaller use a predictable trigger eugene.loh
2025-02-26 16:54 ` [DTrace-devel] " Kris Van Hees

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox