Re: [PATCH v2 2/2] perf/test: Fix test case 89 for x86
From: Thomas Richter
Date: Wed Jan 04 2023 - 04:34:52 EST
On 1/3/23 14:20, Arnaldo Carvalho de Melo wrote:
> Em Wed, Dec 28, 2022 at 03:57:04PM +0100, Thomas Richter escreveu:
>> From: Thomas Richter <richter@xxxxxxxxxx>
>>
>> perf test '89: probe libc's inet_pton & backtrace it with ping'
>> fails on x86. Debugging revealed a changed stack trace for the
>> ping command using probes:
>>
>> ping 35729 [002] 8006.365063: probe_libc:inet_pton: (3ff9603e7c0)
>> 12be50 __GI___inet_pton+0x0 (/usr/lib64/libc.so.6)
>> 4fca main+0x139b (/usr/bin/ping)
>>
>> The line getaddrinfo.... in the call stack is gone.
>> It was introduced with glibc version 2.36.8 released
>> with Fedora 37.
>
> Humm, I'm testing and invetigating this issue and by looking at the
> backtraces I see that it is just on the first entry that the getaddrinfo
> isn't present, i.e. now there are two inet_pton() calls, one of them
> doesn't come from getaddrinfo():
>
> [root@quaco ~]# cat /tmp/perf.script.IUC
> ping 623883 [006] 265438.471610: probe_libc:inet_pton: (7f32bcf314c0)
> 1314c0 __GI___inet_pton+0x0 (/usr/lib64/libc.so.6)
> 29510 __libc_start_call_main+0x80 (/usr/lib64/libc.so.6)
>
> ping 623883 [006] 265438.471664: probe_libc:inet_pton: (7f32bcf314c0)
> 1314c0 __GI___inet_pton+0x0 (/usr/lib64/libc.so.6)
> fa6c6 getaddrinfo+0x126 (/usr/lib64/libc.so.6)
> 491e [unknown] (/usr/bin/ping)
>
> The above is the temp file for the perf script output from the collected
> perf.data file See the second entry? Its as we expect:
>
> [root@quaco ~]# cat /tmp/expected.aT6
> ping[][0-9 \.:]+probe_libc:inet_pton: \([[:xdigit:]]+\)
> .*inet_pton\+0x[[:xdigit:]]+[[:space:]]\(/usr/lib64/libc.so.6|inlined\)$
> getaddrinfo\+0x[[:xdigit:]]+[[:space:]]\(/usr/lib64/libc.so.6\)$
> .*(\+0x[[:xdigit:]]+|\[unknown\])[[:space:]]\(.*/bin/ping.*\)$
> [root@quaco ~]#
>
> But if I just ignore that first one and match against the second event
> instance:
>
> [root@quaco ~]# perf test inet_pton
> 90: probe libc's inet_pton & backtrace it with ping : Ok
> [root@quaco ~]# perf test -v inet_pton
> 90: probe libc's inet_pton & backtrace it with ping :
> --- start ---
> test child forked, pid 626199
> ping 626222 [007] 266979.123047: probe_libc:inet_pton_1: (7f0650d314c0)
> 1314c0 __GI___inet_pton+0x0 (/usr/lib64/libc.so.6)
> fa6c6 getaddrinfo+0x126 (/usr/lib64/libc.so.6)
> 491e n (/usr/bin/ping)
> test child finished with 0
> ---- end ----
> probe libc's inet_pton & backtrace it with ping: Ok
> [root@quaco ~]#
>
> So, can you try with the following patch in your s/390 system?
Thanks Arnaldo,
your patch also works on my s390 system. I applied patch 1/2 which is
necessary and then your change:
# ./perf test 85
85: probe libc's inet_pton & backtrace it with ping : FAILED!
# git am your-patch
# ./perf test 85
85: probe libc's inet_pton & backtrace it with ping : Ok
#
So for patch 2/2 your have my
Tested-by: Thomas Richter <tmricht@xxxxxxxxxxxxx>
>
> I wish 'perf script' had a --skip option that allowed us to ask for just
> the second event, not having that I did a trick with tac + grep -m1 -B :-)
>
> We can try to revisit your approach for the next merge window, as at
> this point, for 6.2 we want for fixes to be as minimal as possible.
>
Yes that would be good to make this test case more rebust.
--
Thomas Richter, Dept 3303, IBM s390 Linux Development, Boeblingen, Germany
--
Vorsitzender des Aufsichtsrats: Gregor Pillen
Geschäftsführung: David Faller
Sitz der Gesellschaft: Böblingen / Registergericht: Amtsgericht Stuttgart, HRB 243294