public inbox for dtrace@lists.linux.dev
 help / color / mirror / Atom feed
From: Kris Van Hees <kris.van.hees@oracle.com>
To: Eugene Loh <eugene.loh@oracle.com>
Cc: Kris Van Hees <kris.van.hees@oracle.com>,
	dtrace@lists.linux.dev, dtrace-devel@oss.oracle.com
Subject: Re: [DTrace-devel] [PATCH] test: account for member name change in mm_struct
Date: Tue, 3 Feb 2026 16:03:07 -0500	[thread overview]
Message-ID: <aYJii0z2t9FrFSJF@oracle.com> (raw)
In-Reply-To: <08203c21-d9fa-99a1-1b4c-b0f1bf794c99@oracle.com>

On Tue, Feb 03, 2026 at 03:41:52PM -0500, Eugene Loh wrote:
> I'm curious, does this introduce a new dependency on bpftool that should be
> reflected in the .spec file, or can we take it for granted that bpftool will
> be there?

Hm, yes, that should be listed as a new dependency.  Thanks.

> The "new" .d file needs an updated copyright year.

Thanks.

> Is it possible that both .x files "fail"?  For some bad reason, I don't know
> what.  I guess I would have imagined turning the .d test into a .sh test
> that checks for a member name, then chooses it or else the alternative, then
> runs the script.  So the test would have to run, one way or the other.

Yes, that is possible if they rename it yet again to something different.  I
can change the test to be a .sh to avoid that yes.  I was hoping not having
to do that because they are always a bit more cumbersome but here it does make
sense.

> On 2/3/26 11:23, Kris Van Hees via DTrace-devel wrote:
> > mm_struct->cpu_bitmap has been renamed mm_struct->flexible_array
> > 
> > Add support for both variants.
> > 
> > Signed-off-by: Kris Van Hees <kris.van.hees@oracle.com>
> > ---
> >   ....d => tst.ctf-dynsized-bounds-runtime-1.d} |  0
> >   .../tst.ctf-dynsized-bounds-runtime-1.x       | 17 +++++++++++++
> >   .../tst.ctf-dynsized-bounds-runtime-2.d       | 25 +++++++++++++++++++
> >   .../tst.ctf-dynsized-bounds-runtime-2.x       | 17 +++++++++++++
> >   4 files changed, 59 insertions(+)
> >   rename test/unittest/arrays/{tst.ctf-dynsized-bounds-runtime.d => tst.ctf-dynsized-bounds-runtime-1.d} (100%)
> >   create mode 100755 test/unittest/arrays/tst.ctf-dynsized-bounds-runtime-1.x
> >   create mode 100644 test/unittest/arrays/tst.ctf-dynsized-bounds-runtime-2.d
> >   create mode 100755 test/unittest/arrays/tst.ctf-dynsized-bounds-runtime-2.x
> > 
> > diff --git a/test/unittest/arrays/tst.ctf-dynsized-bounds-runtime.d b/test/unittest/arrays/tst.ctf-dynsized-bounds-runtime-1.d
> > similarity index 100%
> > rename from test/unittest/arrays/tst.ctf-dynsized-bounds-runtime.d
> > rename to test/unittest/arrays/tst.ctf-dynsized-bounds-runtime-1.d
> > diff --git a/test/unittest/arrays/tst.ctf-dynsized-bounds-runtime-1.x b/test/unittest/arrays/tst.ctf-dynsized-bounds-runtime-1.x
> > new file mode 100755
> > index 00000000..264fa150
> > --- /dev/null
> > +++ b/test/unittest/arrays/tst.ctf-dynsized-bounds-runtime-1.x
> > @@ -0,0 +1,17 @@
> > +#!/bin/bash
> > +#
> > +# Oracle Linux DTrace.
> > +# Copyright (c) 2026, 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.
> > +
> > +# Skip this test if mm_struct does not have a cpu_bitmap member.
> > +
> > +type_id=`bpftool btf dump id 1 | \
> > +		awk '/\047mm_struct\047/ { print int(substr($1, 2)); }'`
> > +
> > +if bpftool btf dump id 1 root_id ${type_id} | grep "'cpu_bitmap'" &>/dev/null; then
> > +	exit 0
> > +fi
> > +
> > +exit 2
> > diff --git a/test/unittest/arrays/tst.ctf-dynsized-bounds-runtime-2.d b/test/unittest/arrays/tst.ctf-dynsized-bounds-runtime-2.d
> > new file mode 100644
> > index 00000000..5e296d60
> > --- /dev/null
> > +++ b/test/unittest/arrays/tst.ctf-dynsized-bounds-runtime-2.d
> > @@ -0,0 +1,25 @@
> > +/*
> > + * Oracle Linux DTrace.
> > + * Copyright (c) 2023, 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.
> > + */
> > +
> > +/*
> > + * ASSERTION: Array accesses work for CTF-declared arrays of dynamic size
> > + *	      (ensuring the bounds checking is also bypassed at runtime).
> > + *
> > + * SECTION: Pointers and Arrays/Array Declarations and Storage
> > + */
> > +
> > +BEGIN
> > +{
> > +	i = pid - pid;			/* Non-constant 0 value. */
> > +	trace(curthread->mm->flexible_array[i]);
> > +	exit(0);
> > +}
> > +
> > +ERROR
> > +{
> > +	exit(1);
> > +}
> > diff --git a/test/unittest/arrays/tst.ctf-dynsized-bounds-runtime-2.x b/test/unittest/arrays/tst.ctf-dynsized-bounds-runtime-2.x
> > new file mode 100755
> > index 00000000..17aa06df
> > --- /dev/null
> > +++ b/test/unittest/arrays/tst.ctf-dynsized-bounds-runtime-2.x
> > @@ -0,0 +1,17 @@
> > +#!/bin/bash
> > +#
> > +# Oracle Linux DTrace.
> > +# Copyright (c) 2026, 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.
> > +
> > +# Skip this test if mm_struct does not have a flexible_array member.
> > +
> > +type_id=`bpftool btf dump id 1 | \
> > +		awk '/\047mm_struct\047/ { print int(substr($1, 2)); }'`
> > +
> > +if bpftool btf dump id 1 root_id ${type_id} | grep "'flexible_array'" &>/dev/null; then
> > +	exit 0
> > +fi
> > +
> > +exit 2

      reply	other threads:[~2026-02-03 21:03 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-03 16:23 [PATCH] test: account for member name change in mm_struct Kris Van Hees
2026-02-03 20:41 ` [DTrace-devel] " Eugene Loh
2026-02-03 21:03   ` 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=aYJii0z2t9FrFSJF@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox