From: Kris Van Hees <kris.van.hees@oracle.com>
To: eugene.loh@oracle.com
Cc: dtrace@lists.linux.dev, dtrace-devel@oss.oracle.com
Subject: Re: [PATCH] test: Fix post processing of return-action override-pid tests
Date: Wed, 6 Aug 2025 14:18:30 -0400 [thread overview]
Message-ID: <aJOcds9zM5BgejTI@oracle.com> (raw)
In-Reply-To: <20250805181221.17770-1-eugene.loh@oracle.com>
On Tue, Aug 05, 2025 at 02:12:21PM -0400, eugene.loh@oracle.com wrote:
> From: Eugene Loh <eugene.loh@oracle.com>
>
> In commit ee8c066e8 ("rawfbt: selectively allow return() in clauses"),
> tests were introduced to check that return values are overwritten. A
> pid check value is output and used to facilitate comparisons to a .r
> results file.
>
> The post processing logic was flawed in two respects:
>
> 1 The check value was being pulled from the "01" entry. Therefore,
> the "00" entry, typically appearing first, would not be converted.
>
> 2 Values were not sorted. Sometimes this means the disorder just
> described would be avoided and the test would pass. Mostly,
> it means that behavior can be erratic.
>
> Sort results and use the "00" pid value for converting test results.
> Add $dt_flags to the $dtrace line while we're at it.
>
> Signed-off-by: Eugene Loh <eugene.loh@oracle.com>
Reviewed-by: Kris Van Hees <kris.van.hees@oracle.com>
Not sure what happened - other than that I must have forgotten to add the
corrected .r.p files because I did notice this issue and thought I had
committed the fix for it. Oh well...
> ---
> test/unittest/actions/return/tst.override-getpid-entry.r.p | 2 +-
> test/unittest/actions/return/tst.override-getpid-entry.sh | 4 ++--
> test/unittest/actions/return/tst.override-getpid-return.r.p | 2 +-
> test/unittest/actions/return/tst.override-getpid-return.sh | 4 ++--
> 4 files changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/test/unittest/actions/return/tst.override-getpid-entry.r.p b/test/unittest/actions/return/tst.override-getpid-entry.r.p
> index c838391a4..1a9b7b1bf 100755
> --- a/test/unittest/actions/return/tst.override-getpid-entry.r.p
> +++ b/test/unittest/actions/return/tst.override-getpid-entry.r.p
> @@ -4,7 +4,7 @@ BEGIN {
> mypid = -1
> }
>
> -/^01 [1-9][0-9]*$/ {
> +/^00 pid is [1-9][0-9]*$/ {
> mypid = $NF;
> }
>
> diff --git a/test/unittest/actions/return/tst.override-getpid-entry.sh b/test/unittest/actions/return/tst.override-getpid-entry.sh
> index 2282305e7..d9436a532 100755
> --- a/test/unittest/actions/return/tst.override-getpid-entry.sh
> +++ b/test/unittest/actions/return/tst.override-getpid-entry.sh
> @@ -38,7 +38,7 @@ fi
>
> # Trace the trigger. On the 2nd and 5th getpid() calls, modify the result.
>
> -$dtrace -c ./a.out -w -q -n '
> +$dtrace $dt_flags -c ./a.out -w -q -n '
> BEGIN {
> printf("00 pid is %d\n", $target);
> n = 0;
> @@ -58,6 +58,6 @@ rawfbt:vmlinux:__*_sys_getpid:entry
> {
> return(55555);
> }
> -'
> +' | sort
>
> exit $?
> diff --git a/test/unittest/actions/return/tst.override-getpid-return.r.p b/test/unittest/actions/return/tst.override-getpid-return.r.p
> index c838391a4..1a9b7b1bf 100755
> --- a/test/unittest/actions/return/tst.override-getpid-return.r.p
> +++ b/test/unittest/actions/return/tst.override-getpid-return.r.p
> @@ -4,7 +4,7 @@ BEGIN {
> mypid = -1
> }
>
> -/^01 [1-9][0-9]*$/ {
> +/^00 pid is [1-9][0-9]*$/ {
> mypid = $NF;
> }
>
> diff --git a/test/unittest/actions/return/tst.override-getpid-return.sh b/test/unittest/actions/return/tst.override-getpid-return.sh
> index 078d68a4a..835e443dd 100755
> --- a/test/unittest/actions/return/tst.override-getpid-return.sh
> +++ b/test/unittest/actions/return/tst.override-getpid-return.sh
> @@ -38,7 +38,7 @@ fi
>
> # Trace the trigger. On the 2nd and 5th getpid() calls, modify the result.
>
> -$dtrace -c ./a.out -w -q -n '
> +$dtrace $dt_flags -c ./a.out -w -q -n '
> BEGIN {
> printf("00 pid is %d\n", $target);
> n = 0;
> @@ -58,6 +58,6 @@ rawfbt:vmlinux:__*_sys_getpid:return
> {
> return(55555);
> }
> -'
> +' | sort
>
> exit $?
> --
> 2.43.5
>
prev parent reply other threads:[~2025-08-06 18:18 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-05 18:12 [PATCH] test: Fix post processing of return-action override-pid tests eugene.loh
2025-08-06 18:18 ` Kris Van Hees [this message]
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=aJOcds9zM5BgejTI@oracle.com \
--to=kris.van.hees@oracle.com \
--cc=dtrace-devel@oss.oracle.com \
--cc=dtrace@lists.linux.dev \
--cc=eugene.loh@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.