[DTrace-devel] [PATCH v2] test: Clean up tst.coverage.d

eugene.loh at oracle.com eugene.loh at oracle.com
Wed Jan 24 19:17:33 UTC 2024


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

The .t file was not executable and therefore not being used.
Further, the .d test specifies another @@trigger explicitly.
So remove the unused .t file.

Clean the .d file up a little, mostly to use aggregations and
thereby reduce the volume of output.

Signed-off-by: Eugene Loh <eugene.loh at oracle.com>
---
 test/unittest/pid/tst.coverage.d | 23 ++++++++++-------------
 test/unittest/pid/tst.coverage.t |  8 --------
 2 files changed, 10 insertions(+), 21 deletions(-)
 delete mode 100644 test/unittest/pid/tst.coverage.t

diff --git a/test/unittest/pid/tst.coverage.d b/test/unittest/pid/tst.coverage.d
index 9670665a..4d93033e 100644
--- a/test/unittest/pid/tst.coverage.d
+++ b/test/unittest/pid/tst.coverage.d
@@ -1,6 +1,6 @@
 /*
  * Oracle Linux DTrace.
- * Copyright (c) 2006, 2021, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 2024, 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.
  */
@@ -10,25 +10,22 @@
 /* @@trigger-timing: before */
 
 /*
- * ASSERTION: test that we can trace every instruction safely
+ * ASSERTION: test that we can trace some instructions safely
  *
  * SECTION: pid provider
- *
  */
 
-BEGIN
+pid$1:a.out::
 {
-	/*
-	 * Let's just do this for 2 seconds.
-	 */
-	timeout = timestamp + 2000000000;
+	n++;
 }
 
-pid$1:a.out::
-{}
+profile:::tick-2sec
+{
+	exit(n > 0 ? 0 : 1);
+}
 
-profile:::tick-4
-/timestamp > timeout/
+ERROR
 {
-	exit(0);
+	exit(1);
 }
diff --git a/test/unittest/pid/tst.coverage.t b/test/unittest/pid/tst.coverage.t
deleted file mode 100644
index ac05014b..00000000
--- a/test/unittest/pid/tst.coverage.t
+++ /dev/null
@@ -1,8 +0,0 @@
-#!/bin/bash
-#
-# Oracle Linux DTrace.
-# Copyright (c) 2006, 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.
-#
-while true; do env > /dev/null; done
-- 
2.18.4




More information about the DTrace-devel mailing list