perf/tests: fix record+probe_libc_inet_pton test on aarch64
PATCH 1/1 perf/tests: fix record+probe_libc_inet_pton test on aarch64
Since commit 1f85d016768f ("perf test record+probe_libc_inet_pton: Fix call chain match on x86_64") remove function getaddrinfo() on expected file, the test failed on aarch64. On aarch64, function getaddrinfo() show up in the call chain.
$perf script -i /tmp/perf.data.1PV
ping 2588319 [125] 500119.122843: probe_libc:inet_pton: (ffff9a4f7410)
ffff9a4f7410 __GI___inet_pton+0x0 (/usr/lib64/libc-2.32.so)
ffff9a4c5f7c getaddrinfo+0xec (/usr/lib64/libc-2.32.so)
aaaad6d32b38 [unknown] (/usr/bin/ping)So just remove getaddrinfo() on x86_64.
--- tools/perf/tests/shell/record+probe_libc_inet_pton.sh | 4 ++++ 1 file changed, 4 insertions(+)
tools/perf/tests/shell/record+probe_libc_inet_pton.sh +4 -0
@@ -52,8 +52,12 @@ trace_libc_inet_pton_backtrace() { echo "getaddrinfo\+0x[[:xdigit:]]+[[:space:]]\($libc\)$" >> $expected echo ".*(\+0x[[:xdigit:]]+|\[unknown\])[[:space:]]\(.*/bin/ping.*\)$" >> $expected ;; + x86_64) + eventattr='max-stack=3' + echo ".*(\+0x[[:xdigit:]]+|\[unknown\])[[:space:]]\(.*/bin/ping.*\)$" >> $expected *) eventattr='max-stack=3' + echo "getaddrinfo\+0x[[:xdigit:]]+[[:space:]]\($libc\)$" >> $expected echo ".*(\+0x[[:xdigit:]]+|\[unknown\])[[:space:]]\(.*/bin/ping.*\)$" >> $expected ;; esac
Signature · 1 line
1.8.3.1
Namhyung Kim
maintainerHello,
Quoted 10 lines · Jing Zhang
Since commit
1f85d016768f("perf test record+probe_libc_inet_pton: Fix call chain match onx86_64") remove functiongetaddrinfo()on expected file, the test failed on aarch64. On aarch64, functiongetaddrinfo()show up in the call chain.$perf script -i
/tmp/perf.data.1PV
ping 2588319 [125] 500119.122843: probe_libc:inet_pton: (ffff9a4f7410)ffff9a4f7410 __GI___inet_pton+0x0 (/usr/lib64/libc-2.32.so) ffff9a4c5f7c getaddrinfo+0xec (/usr/lib64/libc-2.32.so) aaaad6d32b38 [unknown] (/usr/bin/ping)
I'm curious how other ARM folks don't see this. Does it depend on something other? Then can we make the line optional like we did on s390 recently?
Quoted 2 lines
So just remove
getaddrinfo()onx86_64.
I'm not sure how it works on other archs.
Thanks,
Namhyung
Quoted 27 lines
Fixes 1f85d016768f ("perf test record+probe_libc_inet_pton: Fix call chain match on x86_64")Signed-off-by Jing Zhang <[email protected]>--- tools/perf/tests/shell/record+probe_libc_inet_pton.sh | 4 ++++ 1 file changed, 4 insertions(+)tools/perf/tests/shell/record+probe_libc_inet_pton.sh +4
-0@@ -52,8 +52,12 @@ trace_libc_inet_pton_backtrace() { echo "getaddrinfo\+0x[[:xdigit:]]+[[:space:]]\($libc\)$" >> $expected echo ".*(\+0x[[:xdigit:]]+|\[unknown\])[[:space:]]\(.*/bin/ping.*\)$" >> $expected ;; + x86_64) + eventattr='max-stack=3' + echo ".*(\+0x[[:xdigit:]]+|\[unknown\])[[:space:]]\(.*/bin/ping.*\)$" >> $expected *) eventattr='max-stack=3' + echo "getaddrinfo\+0x[[:xdigit:]]+[[:space:]]\($libc\)$" >> $expected echo ".*(\+0x[[:xdigit:]]+|\[unknown\])[[:space:]]\(.*/bin/ping.*\)$" >> $expected ;; esacSignature · 1 line
1.8.3.1
Leo Yan
Tested-byHi Namhyung, Jing,
Quoted 9 lines · Namhyung Kim
Hello,
Quoted 5 lines · Jing Zhang
Since commit
1f85d016768f("perf test record+probe_libc_inet_pton: Fix call chain match onx86_64") remove functiongetaddrinfo()on expected file, the test failed on aarch64. On aarch64, functiongetaddrinfo()show up in the call chain.
Quoted 8 lines
Quoted 5 lines
$perf script -i
/tmp/perf.data.1PV
ping 2588319 [125] 500119.122843: probe_libc:inet_pton: (ffff9a4f7410)ffff9a4f7410 __GI___inet_pton+0x0 (/usr/lib64/libc-2.32.so) ffff9a4c5f7c getaddrinfo+0xec (/usr/lib64/libc-2.32.so) aaaad6d32b38 [unknown] (/usr/bin/ping)I'm curious how other ARM folks don't see this. Does it depend on something other?
This test has several dependencies. E.g. libtraceevent and IPv6 (one of my machines skips the test due to lack IPv6 interface).
This test is definitely a regression on Arm64 machine. I will go back to check why this test failure is missed in our CI. If have any update, will let you know.
Quoted 1 line
Then can we make the line optional like we did on s390 recently?
I verified two distros (one is libc-2.31 and another is libc-2.37), both of them have the symbol "getaddrinfo":
Machine 1:
# nm -D /usr/lib/aarch64-linux-gnu/libc-2.31.so | grep getaddrinfo
00000000000bdf58 T getaddrinfoMachine 2:
# /usr/lib/aarch64-linux-gnu/libc.so.6 GNU C Library (Debian GLIBC 2.37-16) stable release version 2.37.
# nm -D /usr/lib/aarch64-linux-gnu/libc.so.6 | grep getaddrinfo 00000000000d4da4 T getaddrinfo@@GLIBC_2.17 0000000000114260 T getaddrinfo_a@@GLIBC_2.34 0000000000114260 T getaddrinfo_a@GLIBC_2.17
I don't see the need for making the line optional. And I don't see any requirement for adding conditional check for symbol "gaih_inet".
Quoted 3 lines
Quoted 1 line
So just remove
getaddrinfo()onx86_64.I'm not sure how it works on other archs.
I have no idea neither. Maybe this patch is fine - it just rolls back to old format for rest archs, before if the test can work well on them, then this patch just makes it to work again.
However, this patch has a syntax error. Please see below.
Quoted 6 lines
Quoted 6 lines
Fixes 1f85d016768f ("perf test record+probe_libc_inet_pton: Fix call chain match on x86_64")Signed-off-by Jing Zhang <[email protected]>--- tools/perf/tests/shell/record+probe_libc_inet_pton.sh | 4 ++++ 1 file changed, 4 insertions(+)
Quoted 11 lines
tools/perf/tests/shell/record+probe_libc_inet_pton.sh trace_libc_inet_pton_backtrace() { · line 57
Quoted 11 lines
tools/perf/tests/shell/record+probe_libc_inet_pton.sh +3
-0@@ -52,8 +52,12 @@ trace_libc_inet_pton_backtrace() { echo "getaddrinfo\+0x[[:xdigit:]]+[[:space:]]\($libc\)$" >> $expected echo ".*(\+0x[[:xdigit:]]+|\[unknown\])[[:space:]]\(.*/bin/ping.*\)$" >> $expected ;; + x86_64) + eventattr='max-stack=3' + echo ".*(\+0x[[:xdigit:]]+|\[unknown\])[[:space:]]\(.*/bin/ping.*\)$" >> $expected
Please add ";;" at here to break switch, otherwise, it reports syntax error.
With this change:
Thanks for the fixing!
Quoted 10 lines
Quoted 9 lines
tools/perf/tests/shell/record+probe_libc_inet_pton.sh +1
-1*) eventattr='max-stack=3' + echo "getaddrinfo\+0x[[:xdigit:]]+[[:space:]]\($libc\)$" >> $expected echo ".*(\+0x[[:xdigit:]]+|\[unknown\])[[:space:]]\(.*/bin/ping.*\)$" >> $expected ;; esac --1.8.3.1
Quoted 40 lines · Leo Yan
Hi Namhyung, Jing,
Quoted 9 lines · Namhyung Kim
Hello,
Quoted 5 lines · Jing Zhang
Since commit
1f85d016768f("perf test record+probe_libc_inet_pton: Fix call chain match onx86_64") remove functiongetaddrinfo()on expected file, the test failed on aarch64. On aarch64, functiongetaddrinfo()show up in the call chain.Quoted 8 lines
Quoted 5 lines
$perf script -i
/tmp/perf.data.1PV
ping 2588319 [125] 500119.122843: probe_libc:inet_pton: (ffff9a4f7410)ffff9a4f7410 __GI___inet_pton+0x0 (/usr/lib64/libc-2.32.so) ffff9a4c5f7c getaddrinfo+0xec (/usr/lib64/libc-2.32.so) aaaad6d32b38 [unknown] (/usr/bin/ping)I'm curious how other ARM folks don't see this. Does it depend on something other?
This test has several dependencies. E.g. libtraceevent and IPv6 (one of my machines skips the test due to lack IPv6 interface).
This test is definitely a regression on Arm64 machine. I will go back to check why this test failure is missed in our CI. If have any update, will let you know.
Quoted 1 line
Then can we make the line optional like we did on s390 recently?
I verified two distros (one is libc-2.31 and another is libc-2.37), both of them have the symbol "getaddrinfo":
Machine 1:
# nm -D /usr/lib/aarch64-linux-gnu/libc-2.31.so | grep getaddrinfo 00000000000bdf58 T getaddrinfoMachine 2:
Quoted 7 lines
# /usr/lib/aarch64-linux-gnu/libc.so.6 GNU C Library (Debian GLIBC 2.37-16) stable release version 2.37.# nm -D /usr/lib/aarch64-linux-gnu/libc.so.6 | grep getaddrinfo 00000000000d4da4 T getaddrinfo@@GLIBC_2.17 0000000000114260 T getaddrinfo_a@@GLIBC_2.34 0000000000114260 T getaddrinfo_a@GLIBC_2.17
Update a bit for Arm64. Without this patch, we do see the test can pass on Debian bookworm (with libc 2.36) but failed on older distros.
On the Debian bookworm, it prints out the log same as above. Seems to me, these symbols with suffix "@GLIBC_2.x" are legacy functions for old libc compatible but is not used by the new libc.
So we need to rule out the case for the symbol with suffix. Please check if below change is suitable?
tools/perf/tests/shell/record+probe_libc_inet_pton.sh +5 -0
@@ -54,6 +54,11 @@ trace_libc_inet_pton_backtrace() { ;; *) eventattr='max-stack=3' + # The new version libc (e.g. libc 2.36) contains symbol getaddrinfo@@GLIBC_2.17 + # which is not used. Do strick checking for 'getaddrinfo' without any suffix. + if nm -D $libc | grep -q 'getaddrinfo$'; then + echo "getaddrinfo\+0x[[:xdigit:]]+[[:space:]]\($libc\)$" >> $expected + fi echo ".*(\+0x[[:xdigit:]]+|\[unknown\])[[:space:]]\(.*/bin/ping.*\)$" >> $expected ;; esac
Thanks,
Leo