public inbox for dtrace@lists.linux.dev
 help / color / mirror / Atom feed
* [PATCH 1/5] test: fbt return0: work on quiet systems
@ 2025-10-06 15:28 Nick Alcock
  2025-10-06 15:28 ` [PATCH 2/5] test: nfs: don't require a locking daemon Nick Alcock
                   ` (4 more replies)
  0 siblings, 5 replies; 13+ messages in thread
From: Nick Alcock @ 2025-10-06 15:28 UTC (permalink / raw)
  To: dtrace, dtrace-devel

These two tests probe on sys_poll and just hope something calls it.
On sufficiently quiet systems, nothing does.

Define a trivial trigger to do so.

Signed-off-by: Nick Alcock <nick.alcock@oracle.com>
---
 test/triggers/Build                          |  2 +-
 test/triggers/fbt-tst-poll.c                 | 23 ++++++++++++++++++++
 test/unittest/fbtprovider/tst.return0.d      |  6 ++++-
 test/unittest/providers/rawfbt/tst.return0.d |  6 ++++-
 4 files changed, 34 insertions(+), 3 deletions(-)
 create mode 100644 test/triggers/fbt-tst-poll.c

diff --git a/test/triggers/Build b/test/triggers/Build
index 4ff5002a853ed..bd6b0510ba003 100644
--- a/test/triggers/Build
+++ b/test/triggers/Build
@@ -4,7 +4,7 @@
 # http://oss.oracle.com/licenses/upl.
 
 EXTERNAL_64BIT_TRIGGERS = testprobe readwholedir mmap bogus-ioctl open delaydie futex \
-    periodic_output \
+    periodic_output fbt-tst-poll \
     pid-tst-args1 pid-tst-float pid-tst-fork pid-tst-gcc \
     pid-tst-ret1 pid-tst-ret2 pid-tst-vfork pid-tst-weak1 pid-tst-weak2 \
     proc-tst-sigwait proc-tst-omp proc-tst-pthread-exec profile-tst-ufuncsort \
diff --git a/test/triggers/fbt-tst-poll.c b/test/triggers/fbt-tst-poll.c
new file mode 100644
index 0000000000000..8b1e72eddd258
--- /dev/null
+++ b/test/triggers/fbt-tst-poll.c
@@ -0,0 +1,23 @@
+/*
+ * 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.
+ */
+
+/*
+ * Simply loop, polling stdin for something that cannot happen until killed.
+ */
+
+#include <poll.h>
+
+int
+main(int argc, char **argv)
+{
+	struct pollfd fd = {0};
+
+	fd.fd = 0;
+	fd.events = POLLPRI;
+	for (;;)
+		poll(&fd, 1, 100);
+}
diff --git a/test/unittest/fbtprovider/tst.return0.d b/test/unittest/fbtprovider/tst.return0.d
index 0b7091b320904..78a82ffde7473 100644
--- a/test/unittest/fbtprovider/tst.return0.d
+++ b/test/unittest/fbtprovider/tst.return0.d
@@ -11,11 +11,15 @@
  * SECTION: FBT Provider/Probe arguments
  */
 
+/* @@trigger: fbt-tst-poll */
+/* @@trigger-timing: before */
+/* @@runtest-opts: $_pid */
+
 #pragma D option quiet
 #pragma D option statusrate=10ms
 
 fbt::do_sys_poll:return
-/arg1 == 0/
+/pid == $1 && arg1 == 0/
 {
 	printf("%s %x returned 0", probefunc, arg0);
 	exit(0);
diff --git a/test/unittest/providers/rawfbt/tst.return0.d b/test/unittest/providers/rawfbt/tst.return0.d
index 0146d684f1033..915830c800b70 100644
--- a/test/unittest/providers/rawfbt/tst.return0.d
+++ b/test/unittest/providers/rawfbt/tst.return0.d
@@ -9,11 +9,15 @@
  * ASSERTION: simple rawfbt provider arg0 and probefunc print test.
  */
 
+/* @@trigger: fbt-tst-poll */
+/* @@trigger-timing: before */
+/* @@runtest-opts: $_pid */
+
 #pragma D option quiet
 #pragma D option statusrate=10ms
 
 rawfbt::do_sys_poll:return
-/arg1 == 0/
+/pid == $1 && arg1 == 0/
 {
 	printf("%s %x returned 0", probefunc, arg0);
 	exit(0);

base-commit: 877fcdeb25b370be182d51f27fb4bd8e4f739fb1
-- 
2.51.0.284.g117bcb8de7


^ permalink raw reply related	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2025-10-08 16:15 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-06 15:28 [PATCH 1/5] test: fbt return0: work on quiet systems Nick Alcock
2025-10-06 15:28 ` [PATCH 2/5] test: nfs: don't require a locking daemon Nick Alcock
2025-10-06 16:11   ` Kris Van Hees
2025-10-06 15:28 ` [PATCH 3/5] test: preprocessor: work on GCC 16 Nick Alcock
2025-10-07 15:08   ` Kris Van Hees
2025-10-06 15:28 ` [PATCH 4/5] test: tid_pid: don't assume the type of pthread_t Nick Alcock
2025-10-06 16:13   ` Kris Van Hees
2025-10-06 15:28 ` [PATCH 5/5] test: dupstruct: fix extra duplicate identifier case Nick Alcock
2025-10-06 16:14   ` Kris Van Hees
2025-10-06 16:09 ` [PATCH 1/5] test: fbt return0: work on quiet systems Kris Van Hees
2025-10-07 15:36   ` Nick Alcock
2025-10-08 11:16   ` [PATCH v2 " Nick Alcock
2025-10-08 16:15     ` Kris Van Hees

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox