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: Clean up tst.errno2.d
Date: Sat, 7 Dec 2024 19:29:06 -0500 [thread overview]
Message-ID: <Z1ToUrUEtcy5otS5@oracle.com> (raw)
In-Reply-To: <20241204065152.2899-1-eugene.loh@oracle.com>
On Wed, Dec 04, 2024 at 01:51:52AM -0500, eugene.loh@oracle.com wrote:
> From: Eugene Loh <eugene.loh@oracle.com>
>
> Check only on the process of interest -- that is, /progenyof(parent)/.
>
> Check that self->fn has been set before applying copyinstr() to it.
>
> Add option zdefs in case open() is deprecated, so that the test will
> run on aarch64.
>
> Signed-off-by: Eugene Loh <eugene.loh@oracle.com>
Reviewed-by: Kris Van Hees <kris.van.hees@oracle.com>
> ---
> test/unittest/builtinvar/tst.errno2.aarch64.x | 2 --
> test/unittest/builtinvar/tst.errno2.d | 6 +++++-
> 2 files changed, 5 insertions(+), 3 deletions(-)
> delete mode 100755 test/unittest/builtinvar/tst.errno2.aarch64.x
>
> diff --git a/test/unittest/builtinvar/tst.errno2.aarch64.x b/test/unittest/builtinvar/tst.errno2.aarch64.x
> deleted file mode 100755
> index 5c66540d1..000000000
> --- a/test/unittest/builtinvar/tst.errno2.aarch64.x
> +++ /dev/null
> @@ -1,2 +0,0 @@
> -#!/bin/sh
> -exit 2
> diff --git a/test/unittest/builtinvar/tst.errno2.d b/test/unittest/builtinvar/tst.errno2.d
> index 22fe8b4a2..939f4c7d7 100644
> --- a/test/unittest/builtinvar/tst.errno2.d
> +++ b/test/unittest/builtinvar/tst.errno2.d
> @@ -15,6 +15,7 @@
>
> #pragma D option quiet
> #pragma D option destructive
> +#pragma D option zdefs
>
> BEGIN
> {
> @@ -27,19 +28,22 @@ BEGIN
> * Record file name pointer arg1 for the 'openat' function and arg0 for 'open'.
> */
> syscall::open:entry
> +/progenyof(parent)/
> {
> self->fn = arg0; /* 'open' arg0 holds a pointer to the file name */
> }
>
> syscall::openat:entry
> +/progenyof(parent)/
> {
> self->fn = arg1; /* 'openat' arg1 holds a pointer to the file name */
> }
>
> syscall::open*:return
> -/copyinstr(self->fn) == "/non/existant/file" && errno != 0/
> +/self->fn && copyinstr(self->fn) == "/non/existant/file" && errno != 0/
> {
> printf("OPEN FAILED with errno %d\n", errno);
> + self->fn = 0;
> }
>
> proc:::exit
> --
> 2.43.5
>
prev parent reply other threads:[~2024-12-08 0:29 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-04 6:51 [PATCH] test: Clean up tst.errno2.d eugene.loh
2024-12-08 0:29 ` 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=Z1ToUrUEtcy5otS5@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.