[DTrace-devel] [PATCH] Ensure that sdt/tst.args.d filters on pid correctly

Kris Van Hees kris.van.hees at oracle.com
Tue Dec 14 02:39:45 UTC 2021


The logic in this test was flawed, and would occasionally allow kernel
threads to be reported, causing test failures.  We now explicitly use
a predicate on the data generating clause to ensure that arg0 matches
pid.

Signed-off-by: Kris Van Hees <kris.van.hees at oracle.com>
---
 test/unittest/sdt/tst.args.d | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/test/unittest/sdt/tst.args.d b/test/unittest/sdt/tst.args.d
index f2823a26..5b054628 100644
--- a/test/unittest/sdt/tst.args.d
+++ b/test/unittest/sdt/tst.args.d
@@ -50,12 +50,7 @@ this char v;
 this bool done;
 
 sdt:task::task_rename
-/(int)arg0 != pid/
-{
-	exit(1);
-}
-
-sdt:task::task_rename
+/(int)arg0 == pid/
 {
 #define putchar(c)	this->v = (c); \
 			this->v = this->done ? 0 : this->v; \
-- 
2.34.1




More information about the DTrace-devel mailing list