[DTrace-devel] [PATCH v2] test: add test for probe* bvar support for pid probes

Kris Van Hees kris.van.hees at oracle.com
Thu Sep 8 21:11:28 UTC 2022


This test exercises the correct support for probefunc for pid probes.
The test is marked @@xfail until probefunc works for pid probes.

Signed-off-by: Kris Van Hees <kris.van.hees at oracle.com>
---
 test/unittest/pid/tst.probefunc.d | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)
 create mode 100644 test/unittest/pid/tst.probefunc.d

diff --git a/test/unittest/pid/tst.probefunc.d b/test/unittest/pid/tst.probefunc.d
new file mode 100644
index 00000000..a8f273cf
--- /dev/null
+++ b/test/unittest/pid/tst.probefunc.d
@@ -0,0 +1,26 @@
+/*
+ * Oracle Linux DTrace.
+ * Copyright (c) 2005, 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.
+ */
+
+/* @@runtest-opts: -c /bin/date */
+/* @@trigger: none */
+/* @@xfail: dtv2 -- probe* builtin variables do not work for pid probes yet */
+
+pid$target:libc.so:malloc:entry
+{
+	trace(probefunc);
+}
+
+pid$target:libc.so:malloc:entry
+/probefunc == "malloc"/
+{
+	exit(0);
+}
+
+pid$target:libc.so:malloc:entry
+{
+	exit(1);
+}
-- 
2.34.1




More information about the DTrace-devel mailing list