[DTrace-devel] [PATCH] test: Add test for option "tregs"

eugene.loh at oracle.com eugene.loh at oracle.com
Sat Feb 18 02:38:18 UTC 2023


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

Signed-off-by: Eugene Loh <eugene.loh at oracle.com>
---
 test/unittest/options/tst.tregs.r  | 11 +++++++++++
 test/unittest/options/tst.tregs.sh | 14 ++++++++++++++
 2 files changed, 25 insertions(+)
 create mode 100644 test/unittest/options/tst.tregs.r
 create mode 100755 test/unittest/options/tst.tregs.sh

diff --git a/test/unittest/options/tst.tregs.r b/test/unittest/options/tst.tregs.r
new file mode 100644
index 00000000..79c16047
--- /dev/null
+++ b/test/unittest/options/tst.tregs.r
@@ -0,0 +1,11 @@
+tregs 3 gives 1
+tregs 5 gives 1
+
+        1        2        3        4        5        6        7                1
+tregs 9 gives 0
+
+        1        2        3        4        5        6        7                1
+tregs 11 gives 0
+-- @@stderr --
+dtrace: invalid probe specifier BEGIN { @[1, 2, 3, 4, 5, 6, 7] = count(); exit(0) }: Insufficient tuple registers to generate code
+dtrace: invalid probe specifier BEGIN { @[1, 2, 3, 4, 5, 6, 7] = count(); exit(0) }: Insufficient tuple registers to generate code
diff --git a/test/unittest/options/tst.tregs.sh b/test/unittest/options/tst.tregs.sh
new file mode 100755
index 00000000..85ff18e4
--- /dev/null
+++ b/test/unittest/options/tst.tregs.sh
@@ -0,0 +1,14 @@
+#!/bin/bash
+#
+# Oracle Linux DTrace.
+# Copyright (c) 2023, 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
+
+for x in 3 5 9 11; do
+    $dtrace -xtregs=$x -qn 'BEGIN { @[1, 2, 3, 4, 5, 6, 7] = count(); exit(0) }'
+    echo "tregs $x gives $?"
+done
-- 
2.18.4




More information about the DTrace-devel mailing list