From: Nick Alcock <nick.alcock@oracle.com>
To: Eugene Loh via DTrace-devel <dtrace-devel@oss.oracle.com>
Cc: Kris Van Hees <kris.van.hees@oracle.com>,
dtrace@lists.linux.dev, Eugene Loh <eugene.loh@oracle.com>
Subject: Re: [DTrace-devel] [PATCH] sparc: remove architecture support
Date: Wed, 04 Mar 2026 20:25:32 +0000 [thread overview]
Message-ID: <87a4wn735v.fsf@esperi.org.uk> (raw)
In-Reply-To: <483a8ddf-bc12-d7e5-f7f4-24aff9fcd874@oracle.com> (Eugene Loh via DTrace-devel's message of "Wed, 4 Mar 2026 15:07:44 -0500")
I'm leaving most of this patch to Eugene, but...
On 4 Mar 2026, Eugene Loh via DTrace-devel spake thusly:
>> index 23454d63..6a0e0122 100644
>> --- a/libdtrace/procfs.d.in
>> +++ b/libdtrace/procfs.d.in
>> @@ -286,8 +286,7 @@ define_for_kernel([[on_cpu]], [[(m4_kver(5,16,0), m4_dnl
>> [[((struct thread_info *)T->stack)->cpu]]), m4_dnl
>> (m4_kver(4,9,0), m4_dnl
>> [[if_arch([[x86]],[[T->cpu]])]] m4_dnl
>> - [[if_arch([[arm64]],[[T->cpu]])]] m4_dnl
>> - [[if_arch([[sparc]],[[((struct thread_info *)T->stack)->cpu]])]])]], m4_dnl
>> + [[if_arch([[arm64]],[[T->cpu]])]]l)]], m4_dnl
>> [[((struct thread_info *)T->stack)->cpu]])m4_dnl
>> pr_onpro = on_cpu;
>> };
>
> I can't read M4, but maybe that diff is suspicious? This is what gpt 5.2 says:
*counts painfully*
I think this is fine, modulo the stray 'l' (correctly pointed out by GPT
5.2). The apparently unbalanced closing )]] is closing the "(m4_kver"
and opening "[[if_arch(..." from a few lines earlier: the removed sparc
line above it had the same trailers.
> ### ASSISTANT
> No as shown, that diff does **not** make sense, and the brackets/parentheses are very likely **not balanced** anymore (and
Wrong.
> ### What looks wrong
>
> 1. **Stray `l` and unmatched delimiters**
> ```
> [[if_arch([[arm64]],[[T->cpu]])]]l)]], m4_dnl
> ^^^
> ```
> That `l)` sequence is almost certainly accidental. It also strongly suggests you now have an extra `)` and/or `]` compared to
> what was intended.
Wrong.
> 2. **You removed the `sparc` branch and spliced the default expression oddly**
> Originally you had:
> ```
> ... [[if_arch([[arm64]],[[T->cpu]])]] m4_dnl
> [[if_arch([[sparc]],[[((struct thread_info *)T->stack)->cpu]])]])]], m4_dnl
> ```
> That last line clearly closes a number of nested `[[ ... ]]` / `(...)` constructs.
>
> In the new version, you have:
> ```
> [[if_arch([[arm64]],[[T->cpu]])]]l)]], m4_dnl
> [[((struct thread_info *)T->stack)->cpu]])m4_dnl
> ```
> The default `[[((struct thread_info *)T->stack)->cpu]]` expression now appears outside of the previous nesting, and the
> closers that used to be on the `sparc` line are now partially (and incorrectly) attached to the `arm64` line.
Well, yes, you do have to close the same number of closers in total, not
just the same number that were opened on *that line* :)
> 3. **`m4_dnl` placement**
> `m4_dnl` comments out the rest of the line. Moving delimiters to a new line while also changing where `m4_dnl` lands can easily
> break balanced delimiters, because closers might end up being commented away or no longer part of the intended argument.
Err... the patch didn't do that.
> ### Practical conclusion
> - **Brackets are almost certainly unbalanced** after this edit.
Wrong :)
--
NULL && (void)
next prev parent reply other threads:[~2026-03-04 20:25 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-04 18:50 [PATCH] sparc: remove architecture support Kris Van Hees
2026-03-04 20:07 ` [DTrace-devel] " Eugene Loh
2026-03-04 20:25 ` Nick Alcock [this message]
2026-03-04 20:31 ` 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=87a4wn735v.fsf@esperi.org.uk \
--to=nick.alcock@oracle.com \
--cc=dtrace-devel@oss.oracle.com \
--cc=dtrace@lists.linux.dev \
--cc=eugene.loh@oracle.com \
--cc=kris.van.hees@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.