public inbox for dtrace@lists.linux.dev
 help / color / mirror / Atom feed
From: Nick Alcock <nick.alcock@oracle.com>
To: Eugene Loh <eugene.loh@oracle.com>
Cc: <dtrace@lists.linux.dev>, <dtrace-devel@oss.oracle.com>
Subject: Re: [PATCH] test: Suppress some white space
Date: Tue, 22 Jul 2025 14:41:04 +0100	[thread overview]
Message-ID: <8734ao5onj.fsf@esperi.org.uk> (raw)
In-Reply-To: <10ca48a3-7e72-f0dd-4fdc-72baf3d52ac6@oracle.com> (Eugene Loh's message of "Mon, 23 Jun 2025 16:33:28 -0400")

On 23 Jun 2025, Eugene Loh outgrape:

> On 6/13/25 10:10, Nick Alcock wrote:
>
>> On 9 Jun 2025, eugene loh spake thusly:
>>
>>> From: Eugene Loh <eugene.loh@oracle.com>
>>>
>>> The test suite turns pointers into "{ptr}" so that results
>>> comparisons will not be sensitive to particular pointer offset
>>> values.
>>>
>>> If these offsets change in width -- say, from 0xf0 to 0x100 --
>>> the amount of white space in the postprocessed output can change.
>>>
>>> Add additional postprocessing to a test that sometimes fails due
>>> to this problem.
>> Hmm... this would work for this test, but maybe we should change the
>> {ptr} substitution in runtest.sh itself so that it gets this right in
>> the general case?
>>
>> Something like
>>
>> diff --git a/runtest.sh b/runtest.sh
>> index 156e7dec8a1c3..c5703a81bc6d4 100755
>> --- a/runtest.sh
>> +++ b/runtest.sh
>> @@ -509,7 +509,7 @@ postprocess()
>>       # TODO: may need adjustment or making optional if scripts emit hex
>>       # values which are not continuously variable.
>>   -    sed -e '/^==[0-9][0-9]*== /!s,0x[0-9a-f][0-9a-f]*,{ptr},g' \
>> +    sed -e '/^==[0-9][0-9]*== /!s,0x[0-9a-f][0-9a-f]*\([ \t]*\),{ptr}\1,g' \
>>   	-e 's,at BPF pc [1-9][0-9]*,at BPF pc NNN,' < $tmpdir/pp.out > $final
>>         return $retval
>>
>> might work. (Obviously the lines would no longer line up, but the number
>> of spaces would remain the same as they were before the substitution.)
>>
>> Lots and lots of expected results would need regenerating after this,
>> of course...
>
> I agree that one can make a case for a broader change, but I'm not convinced that that would be the better way.  FWIW, there were
> these two commits
>         6f398f229 test: Make tests more resilient to different prid widths
>         72a79b784 test: Improve resilience of tests to ptr widths
> that took the narrower, more tactical approach to such a problem.
>
> I vote for the expedient route:  a "Reviewed-by" and we move on. But then, in this case, my vote doesn't count!

I think doing the narrow approach for now makes sense, but doing the
wider one makes more sense in future :) I tried and it's a nest of
thorns, though, unlike hex number replacement there are many places
where we don't want to totally ignore the amount of whitespace in use.
So...

Reviewed-by: Nick Alcock <nick.alcock@oracle.com>

-- 
NULL && (void)

      reply	other threads:[~2025-07-22 13:41 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-09 18:06 [PATCH] test: Suppress some white space eugene.loh
2025-06-13 14:10 ` Nick Alcock
2025-06-23 20:33   ` Eugene Loh
2025-07-22 13:41     ` Nick Alcock [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=8734ao5onj.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 \
    /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