Skip to contentSkip to conversation

test: Have tst.ucaller use a predictable trigger

PATCH In review [email protected] 2 participants 2 messages Jan 10, 2025 – Feb 26, 2025

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 test: Have tst.ucaller use a predictable trigger

From: Eugene Loh <[email protected]>

---
 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
test/unittest/vars/tst.ucaller.d new file +16 -0
new file mode 100644
index 000000000..271297fef
@@ -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);
+}
test/unittest/vars/tst.ucaller.r +1 -1
index 9b09daa0c..bfcc80f4d 100644
@@ -1 +1 @@
-  libc.so.6`strdup                                  
+  ustack-tst-basic`myfunc_v                         
test/unittest/vars/tst.ucaller.sh deleted +0 -42

42 lines not on this page · raw message

test/unittest/vars/tst.ucaller.x deleted +0 -1
deleted file mode 120000
index 6507ccd87..000000000
@@ -1 +0,0 @@
-../pid/test.x
\ No newline at end of file
Signature · 1 line
2.43.5
Reviewed-by on v1 1/1
#1 lore raw
Quoted 3 lines · eugene.loh--- via DTrace-devel

From: Eugene Loh <[email protected]>

Quoted 103 lines
---
 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
test/unittest/vars/tst.ucaller.d new file +16 -0
new file mode 100644
index 000000000..271297fef
@@ -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);
+}
test/unittest/vars/tst.ucaller.r +1 -1
index 9b09daa0c..bfcc80f4d 100644
@@ -1 +1 @@
-  libc.so.6`strdup                                  
+  ustack-tst-basic`myfunc_v                         
test/unittest/vars/tst.ucaller.sh deleted +0 -42
deleted file mode 100755
index a6376af46..000000000
@@ -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
test/unittest/vars/tst.ucaller.x deleted +0 -1
deleted file mode 120000
index 6507ccd87..000000000
@@ -1 +0,0 @@
-../pid/test.x
\ No newline at end of file
Signature · 7 lines
2.43.5


_______________________________________________
DTrace-devel mailing list
[email protected]
https://oss.oracle.com/mailman/listinfo/dtrace-devel