All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kris Van Hees <kris.van.hees@oracle.com>
To: Nick Alcock <nick.alcock@oracle.com>
Cc: dtrace@lists.linux.dev, dtrace-devel@oss.oracle.com
Subject: Re: [PATCH 1/5] test: fbt return0: work on quiet systems
Date: Mon, 6 Oct 2025 12:09:29 -0400	[thread overview]
Message-ID: <aOPpuSFUk1GWVokj@oracle.com> (raw)
In-Reply-To: <20251006152829.239100-1-nick.alcock@oracle.com>

On Mon, Oct 06, 2025 at 04:28:24PM +0100, Nick Alcock wrote:
> 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.

Why not change the probe to be on hrtimer_nanosleep and use periodic_output
as trigger, rather than adding another trigger executable?

> 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
> 

  parent reply	other threads:[~2025-10-06 16:09 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 ` Kris Van Hees [this message]
2025-10-07 15:36   ` [PATCH 1/5] test: fbt return0: work on quiet systems Nick Alcock
2025-10-08 11:16   ` [PATCH v2 " Nick Alcock
2025-10-08 16:15     ` Kris Van Hees

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aOPpuSFUk1GWVokj@oracle.com \
    --to=kris.van.hees@oracle.com \
    --cc=dtrace-devel@oss.oracle.com \
    --cc=dtrace@lists.linux.dev \
    --cc=nick.alcock@oracle.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.