perf test record+probe_libc_inet_pton: Fix call chain match on powerpc
PATCH 1/1 perf test record+probe_libc_inet_pton: Fix call chain match on powerpc
The perf test "probe libc's inet_pton & backtrace it with ping" fails on powerpc as below:
root@xxx perf]# perf test -v "probe libc's inet_pton & backtrace it with ping"
85: probe libc's inet_pton & backtrace it with ping :
--- start ---
test child forked, pid 96028
ping 96056 [002] 127271.101961: probe_libc:inet_pton: (7fffa1779a60) 7fffa1779a60 __GI___inet_pton+0x0 (/usr/lib64/glibc-hwcaps/power10/libc.so.6)7fffa172a73c getaddrinfo+0x121c (/usr/lib64/glibc-hwcaps/power10/libc.so.6)
FAIL: expected backtrace entry "gaih_inet.*\+0x[[:xdigit:]]+[[:space:]]\(/usr/lib64/glibc-hwcaps/power10/libc.so.6\)$" got "7fffa172a73c getaddrinfo+0x121c (/usr/lib64/glibc-hwcaps/power10/libc.so.6)"
test child finished with -1
---- end ----
probe libc's inet_pton & backtrace it with ping: FAILED!
This test installs a probe on libc's inet_pton function, which will use uprobes and then uses perf trace on a ping to localhost. It gets 3 levels deep backtrace and checks whether it is what we expected or not.
The test started failing from RHEL 9.4 where as it works in previous distro version (RHEL 9.2). Test expects gaih_inet function to be part of backtrace. But in the glibc version (2.34-86) which is part of distro where it fails, this function is missing and hence the test is failing.
From nm and ping command output we can confirm that gaih_inet function is not present in the expected backtrace for glibc version glibc-2.34-86
[root@xxx perf]# nm /usr/lib64/glibc-hwcaps/power10/libc.so.6 | grep gaih_inet 00000000001273e0 t gaih_inet_serv00000000001cd8d8 r gaih_inet_typeproto
[root@xxx perf]# perf script -i /tmp/perf.data.6E8
ping 104048 [000] 128582.508976: probe_libc:inet_pton: (7fff83779a60)
7fff83779a60 __GI___inet_pton+0x0
(/usr/lib64/glibc-hwcaps/power10/libc.so.6)
7fff8372a73c getaddrinfo+0x121c
(/usr/lib64/glibc-hwcaps/power10/libc.so.6)
11dc73534 [unknown] (/usr/bin/ping)
7fff8362a8c4 __libc_start_call_main+0x84(/usr/lib64/glibc-hwcaps/power10/libc.so.6)
FAIL: expected backtrace entry "gaih_inet.*\+0x[[:xdigit:]]+[[:space:]]\(/usr/lib64/glibc-hwcaps/power10/libc.so.6\)$" got "7fff9d52a73c getaddrinfo+0x121c (/usr/lib64/glibc-hwcaps/power10/libc.so.6)"
With version glibc-2.34-60 gaih_inet function is present as part of the expected backtrace. So we cannot just remove the gaih_inet function from the backtrace.
[root@xxx perf]# nm /usr/lib64/glibc-hwcaps/power10/libc.so.6 | grep gaih_inet 0000000000130490 t gaih_inet.constprop.0000000000012e830 t gaih_inet_serv00000000001d45e4 r gaih_inet_typeproto
[root@xxx perf]# ./perf script -i /tmp/perf.data.b6S
ping 67906 [000] 22699.591699: probe_libc:inet_pton_3: (7fffbdd80820)
7fffbdd80820 __GI___inet_pton+0x0
(/usr/lib64/glibc-hwcaps/power10/libc.so.6)
7fffbdd31160 gaih_inet.constprop.0+0xcd0
(/usr/lib64/glibc-hwcaps/power10/libc.so.6)
7fffbdd31c7c getaddrinfo+0x14c
(/usr/lib64/glibc-hwcaps/power10/libc.so.6)
1140d3558 [unknown] (/usr/bin/ping)This patch solves this issue by doing a conditional skip. If there is a gaih_inet function present in the libc then it will be added to the expected backtrace else the function will be skipped from being added to the expected backtrace.
Output with the patch
[root@xxx perf]# ./perf test -v "probe libc's inet_pton & backtrace it with ping"
83: probe libc's inet_pton & backtrace it with ping :
--- start ---
test child forked, pid 102662
ping 102692 [000] 127935.549973: probe_libc:inet_pton: (7fff93379a60) 7fff93379a60 __GI___inet_pton+0x0 (/usr/lib64/glibc-hwcaps/power10/libc.so.6)7fff9332a73c getaddrinfo+0x121c (/usr/lib64/glibc-hwcaps/power10/libc.so.6)11ef03534 [unknown] (/usr/bin/ping)
test child finished with 0
---- end ----
probe libc's inet_pton & backtrace it with ping: Ok
--- tools/perf/tests/shell/record+probe_libc_inet_pton.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
tools/perf/tests/shell/record+probe_libc_inet_pton.sh +4 -1
@@ -45,7 +45,10 @@ trace_libc_inet_pton_backtrace() { ;; ppc64|ppc64le) eventattr='max-stack=4' - echo "gaih_inet.*\+0x[[:xdigit:]]+[[:space:]]\($libc\)$" >> $expected + # Add gaih_inet to expected backtrace only if it is part of libc. + if nm $libc | grep -F -q gaih_inet.; then + echo "gaih_inet.*\+0x[[:xdigit:]]+[[:space:]]\($libc\)$" >> $expected + fi echo "getaddrinfo\+0x[[:xdigit:]]+[[:space:]]\($libc\)$" >> $expected echo ".*(\+0x[[:xdigit:]]+|\[unknown\])[[:space:]]\(.*/bin/ping.*\)$" >> $expected ;;
Signature · 1 line
2.39.1
Quoted 93 lines · Likhitha Korrapati
The perf test "probe libc's
inet_pton& backtrace it with ping" fails on powerpc as below:root@xxx perf]# perf test -v "probe libc's
inet_pton& backtrace it with ping"
85: probe libc'sinet_pton& backtrace it with ping :
--- start ---
test child forked, pid 96028
ping 96056 [002] 127271.101961: probe_libc:inet_pton: (7fffa1779a60)7fffa1779a60__GI___inet_pton+0x0(/usr/lib64/glibc-hwcaps/power10/libc.so.6)7fffa172a73cgetaddrinfo+0x121c(/usr/lib64/glibc-hwcaps/power10/libc.so.6)
FAIL: expected backtrace entry "gaih_inet.*\+0x[[:xdigit:]]+[[:space:]]\(/usr/lib64/glibc-hwcaps/power10/libc.so.6\)$" got "7fffa172a73cgetaddrinfo+0x121c(/usr/lib64/glibc-hwcaps/power10/libc.so.6)"
test child finished with -1
---- end ----
probe libc'sinet_pton& backtrace it with ping: FAILED!This test installs a probe on libc's
inet_ptonfunction, which will use uprobes and then uses perf trace on a ping to localhost. It gets 3 levels deep backtrace and checks whether it is what we expected or not.The test started failing from RHEL 9.4 where as it works in previous distro version (RHEL 9.2). Test expects
gaih_inetfunction to be part of backtrace. But in the glibc version (2.34-86) which is part of distro where it fails, this function is missing and hence the test is failing.From nm and ping command output we can confirm that
gaih_inetfunction
is not present in the expected backtrace for glibc version glibc-2.34-86[root@xxx perf]# nm
/usr/lib64/glibc-hwcaps/power10/libc.so.6| grepgaih_inet00000000001273e0tgaih_inet_serv00000000001cd8d8rgaih_inet_typeproto[root@xxx perf]# perf script -i
/tmp/perf.data.6E8
ping 104048 [000] 128582.508976: probe_libc:inet_pton: (7fff83779a60)7fff83779a60 __GI___inet_pton+0x0 (/usr/lib64/glibc-hwcaps/power10/libc.so.6) 7fff8372a73c getaddrinfo+0x121c (/usr/lib64/glibc-hwcaps/power10/libc.so.6) 11dc73534 [unknown] (/usr/bin/ping) 7fff8362a8c4 __libc_start_call_main+0x84(
/usr/lib64/glibc-hwcaps/power10/libc.so.6)FAIL: expected backtrace entry "gaih_inet.*\+0x[[:xdigit:]]+[[:space:]]\(/usr/lib64/glibc-hwcaps/power10/libc.so.6\)$" got "
7fff9d52a73cgetaddrinfo+0x121c(/usr/lib64/glibc-hwcaps/power10/libc.so.6)"With version glibc-2.34-60
gaih_inetfunction is present as part of the expected backtrace. So we cannot just remove thegaih_inetfunction from the backtrace.[root@xxx perf]# nm
/usr/lib64/glibc-hwcaps/power10/libc.so.6| grepgaih_inet0000000000130490 t gaih_inet.constprop.0000000000012e830tgaih_inet_serv00000000001d45e4rgaih_inet_typeproto[root@xxx perf]# ./perf script -i
/tmp/perf.data.b6S
ping 67906 [000] 22699.591699: probe_libc:inet_pton_3: (7fffbdd80820)7fffbdd80820 __GI___inet_pton+0x0 (/usr/lib64/glibc-hwcaps/power10/libc.so.6) 7fffbdd31160 gaih_inet.constprop.0+0xcd0 (/usr/lib64/glibc-hwcaps/power10/libc.so.6) 7fffbdd31c7c getaddrinfo+0x14c (/usr/lib64/glibc-hwcaps/power10/libc.so.6) 1140d3558 [unknown] (/usr/bin/ping)This patch solves this issue by doing a conditional skip. If there is a
gaih_inetfunction present in the libc then it will be added to the expected backtrace else the function will be skipped from being added to the expected backtrace.Output with the patch
[root@xxx perf]# ./perf test -v "probe libc's
inet_pton& backtrace it with ping"
83: probe libc'sinet_pton& backtrace it with ping :
--- start ---
test child forked, pid 102662
ping 102692 [000] 127935.549973: probe_libc:inet_pton: (7fff93379a60)7fff93379a60__GI___inet_pton+0x0(/usr/lib64/glibc-hwcaps/power10/libc.so.6)7fff9332a73cgetaddrinfo+0x121c(/usr/lib64/glibc-hwcaps/power10/libc.so.6)11ef03534[unknown] (/usr/bin/ping)
test child finished with 0
---- end ----
probe libc'sinet_pton& backtrace it with ping: Ok
Quoted 2 lines
Signed-off-by Likhitha Korrapati <[email protected]>Reported-by Disha Goel <[email protected]>
Thanks for the fix patch.
I have tested on a Power10 machine, "probe libc's inet_pton & backtrace it with ping" perf test passes with the patch applied.
Output where gaih_inet function is not present
# perf test -v "probe libc's inet_pton & backtrace it with ping" 85: probe libc's inet_pton & backtrace it with ping : --- start --- test child forked, pid 4622 ping 4652 [011] 58.987631: probe_libc:inet_pton: (7fff91b79a60) 7fff91b79a60 __GI___inet_pton+0x0 (/usr/lib64/glibc-hwcaps/power10/libc.so.6) 7fff91b2a73c getaddrinfo+0x121c (/usr/lib64/glibc-hwcaps/power10/libc.so.6) 119e53534 [unknown] (/usr/bin/ping) test child finished with 0 ---- end ---- probe libc's inet_pton & backtrace it with ping: Ok
Output where gaih_inet function is present
# ./perf test -v "probe libc's inet_pton & backtrace it with ping" 83: probe libc's inet_pton & backtrace it with ping : --- start --- test child forked, pid 84831 ping 84861 [000] 79056.019971: probe_libc:inet_pton: (7fff957631e8) 7fff957631e8 __GI___inet_pton+0x8 (/usr/lib64/glibc-hwcaps/power9/libc-2.28.so) 7fff95718760 gaih_inet.constprop.6+0xa90 (/usr/lib64/glibc-hwcaps/power9/libc-2.28.so) 7fff95719974 getaddrinfo+0x164 (/usr/lib64/glibc-hwcaps/power9/libc-2.28.so) 122e732a4 [unknown] (/usr/bin/ping) test child finished with 0 ---- end ---- probe libc's inet_pton & backtrace it with ping: Ok
Quoted 20 lines
--- tools/perf/tests/shell/record+probe_libc_inet_pton.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)tools/perf/tests/shell/record+probe_libc_inet_pton.sh +4
-1@@ -45,7 +45,10 @@ trace_libc_inet_pton_backtrace() { ;; ppc64|ppc64le) eventattr='max-stack=4' - echo "gaih_inet.*\+0x[[:xdigit:]]+[[:space:]]\($libc\)$" >> $expected + # Add gaih_inet to expected backtrace only if it is part of libc. + if nm $libc | grep -F -q gaih_inet.; then + echo "gaih_inet.*\+0x[[:xdigit:]]+[[:space:]]\($libc\)$" >> $expected + fi echo "getaddrinfo\+0x[[:xdigit:]]+[[:space:]]\($libc\)$" >> $expected echo ".*(\+0x[[:xdigit:]]+|\[unknown\])[[:space:]]\(.*/bin/ping.*\)$" >> $expected ;;
Quoted 132 lines · Disha Goel
Quoted 93 lines · Likhitha Korrapati
The perf test "probe libc's
inet_pton& backtrace it with ping" fails on powerpc as below:root@xxx perf]# perf test -v "probe libc's
inet_pton& backtrace it with ping"
85: probe libc'sinet_pton& backtrace it with ping :
--- start ---
test child forked, pid 96028
ping 96056 [002] 127271.101961: probe_libc:inet_pton: (7fffa1779a60)7fffa1779a60__GI___inet_pton+0x0(/usr/lib64/glibc-hwcaps/power10/libc.so.6)7fffa172a73cgetaddrinfo+0x121c(/usr/lib64/glibc-hwcaps/power10/libc.so.6)
FAIL: expected backtrace entry "gaih_inet.*\+0x[[:xdigit:]]+[[:space:]]\(/usr/lib64/glibc-hwcaps/power10/libc.so.6\)$" got "7fffa172a73cgetaddrinfo+0x121c(/usr/lib64/glibc-hwcaps/power10/libc.so.6)"
test child finished with -1
---- end ----
probe libc'sinet_pton& backtrace it with ping: FAILED!This test installs a probe on libc's
inet_ptonfunction, which will use uprobes and then uses perf trace on a ping to localhost. It gets 3 levels deep backtrace and checks whether it is what we expected or not.The test started failing from RHEL 9.4 where as it works in previous distro version (RHEL 9.2). Test expects
gaih_inetfunction to be part of backtrace. But in the glibc version (2.34-86) which is part of distro where it fails, this function is missing and hence the test is failing.From nm and ping command output we can confirm that
gaih_inetfunction
is not present in the expected backtrace for glibc version glibc-2.34-86[root@xxx perf]# nm
/usr/lib64/glibc-hwcaps/power10/libc.so.6| grepgaih_inet00000000001273e0tgaih_inet_serv00000000001cd8d8rgaih_inet_typeproto[root@xxx perf]# perf script -i
/tmp/perf.data.6E8
ping 104048 [000] 128582.508976: probe_libc:inet_pton: (7fff83779a60)7fff83779a60 __GI___inet_pton+0x0 (/usr/lib64/glibc-hwcaps/power10/libc.so.6) 7fff8372a73c getaddrinfo+0x121c (/usr/lib64/glibc-hwcaps/power10/libc.so.6) 11dc73534 [unknown] (/usr/bin/ping) 7fff8362a8c4 __libc_start_call_main+0x84(
/usr/lib64/glibc-hwcaps/power10/libc.so.6)FAIL: expected backtrace entry "gaih_inet.*\+0x[[:xdigit:]]+[[:space:]]\(/usr/lib64/glibc-hwcaps/power10/libc.so.6\)$" got "
7fff9d52a73cgetaddrinfo+0x121c(/usr/lib64/glibc-hwcaps/power10/libc.so.6)"With version glibc-2.34-60
gaih_inetfunction is present as part of the expected backtrace. So we cannot just remove thegaih_inetfunction from the backtrace.[root@xxx perf]# nm
/usr/lib64/glibc-hwcaps/power10/libc.so.6| grepgaih_inet0000000000130490 t gaih_inet.constprop.0000000000012e830tgaih_inet_serv00000000001d45e4rgaih_inet_typeproto[root@xxx perf]# ./perf script -i
/tmp/perf.data.b6S
ping 67906 [000] 22699.591699: probe_libc:inet_pton_3: (7fffbdd80820)7fffbdd80820 __GI___inet_pton+0x0 (/usr/lib64/glibc-hwcaps/power10/libc.so.6) 7fffbdd31160 gaih_inet.constprop.0+0xcd0 (/usr/lib64/glibc-hwcaps/power10/libc.so.6) 7fffbdd31c7c getaddrinfo+0x14c (/usr/lib64/glibc-hwcaps/power10/libc.so.6) 1140d3558 [unknown] (/usr/bin/ping)This patch solves this issue by doing a conditional skip. If there is a
gaih_inetfunction present in the libc then it will be added to the expected backtrace else the function will be skipped from being added to the expected backtrace.Output with the patch
[root@xxx perf]# ./perf test -v "probe libc's
inet_pton& backtrace it with ping"
83: probe libc'sinet_pton& backtrace it with ping :
--- start ---
test child forked, pid 102662
ping 102692 [000] 127935.549973: probe_libc:inet_pton: (7fff93379a60)7fff93379a60__GI___inet_pton+0x0(/usr/lib64/glibc-hwcaps/power10/libc.so.6)7fff9332a73cgetaddrinfo+0x121c(/usr/lib64/glibc-hwcaps/power10/libc.so.6)11ef03534[unknown] (/usr/bin/ping)
test child finished with 0
---- end ----
probe libc'sinet_pton& backtrace it with ping: OkQuoted 2 lines
Signed-off-by Likhitha Korrapati <[email protected]>Reported-by Disha Goel <[email protected]>Thanks for the fix patch.
I have tested on a Power10 machine, "probe libc'sinet_pton& backtrace it with ping" perf test passes with the patch applied.Output where
gaih_inetfunction is not present# perf test -v "probe libc's inet_pton & backtrace it with ping" 85: probe libc's inet_pton & backtrace it with ping : --- start --- test child forked, pid 4622 ping 4652 [011] 58.987631: probe_libc:inet_pton: (7fff91b79a60) 7fff91b79a60 __GI___inet_pton+0x0 (/usr/lib64/glibc-hwcaps/power10/libc.so.6) 7fff91b2a73c getaddrinfo+0x121c (/usr/lib64/glibc-hwcaps/power10/libc.so.6) 119e53534 [unknown] (/usr/bin/ping) test child finished with 0 ---- end ---- probe libc's inet_pton & backtrace it with ping: OkOutput where
gaih_inetfunction is present# ./perf test -v "probe libc's inet_pton & backtrace it with ping" 83: probe libc's inet_pton & backtrace it with ping : --- start --- test child forked, pid 84831 ping 84861 [000] 79056.019971: probe_libc:inet_pton: (7fff957631e8) 7fff957631e8 __GI___inet_pton+0x8 (/usr/lib64/glibc-hwcaps/power9/libc-2.28.so) 7fff95718760 gaih_inet.constprop.6+0xa90 (/usr/lib64/glibc-hwcaps/power9/libc-2.28.so) 7fff95719974 getaddrinfo+0x164 (/usr/lib64/glibc-hwcaps/power9/libc-2.28.so) 122e732a4 [unknown] (/usr/bin/ping) test child finished with 0 ---- end ---- probe libc's inet_pton & backtrace it with ping: Ok
Quoted 1 line
Tested-by Disha Goel <[email protected]>
Thanks,
Ian
Quoted 21 lines
Quoted 21 lines
--- tools/perf/tests/shell/record+probe_libc_inet_pton.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)tools/perf/tests/shell/record+probe_libc_inet_pton.sh +4
-1@@ -45,7 +45,10 @@ trace_libc_inet_pton_backtrace() { ;; ppc64|ppc64le) eventattr='max-stack=4' - echo "gaih_inet.*\+0x[[:xdigit:]]+[[:space:]]\($libc\)$" >> $expected + # Add gaih_inet to expected backtrace only if it is part of libc. + if nm $libc | grep -F -q gaih_inet.; then + echo "gaih_inet.*\+0x[[:xdigit:]]+[[:space:]]\($libc\)$" >> $expected + fi echo "getaddrinfo\+0x[[:xdigit:]]+[[:space:]]\($libc\)$" >> $expected echo ".*(\+0x[[:xdigit:]]+|\[unknown\])[[:space:]]\(.*/bin/ping.*\)$" >> $expected ;;
Quoted 16 lines · Likhitha Korrapati
The perf test "probe libc's
inet_pton& backtrace it with ping" fails on powerpc as below:root@xxx perf]# perf test -v "probe libc's
inet_pton& backtrace it with ping"
85: probe libc'sinet_pton& backtrace it with ping :
--- start ---
test child forked, pid 96028
ping 96056 [002] 127271.101961: probe_libc:inet_pton: (7fffa1779a60)7fffa1779a60__GI___inet_pton+0x0(/usr/lib64/glibc-hwcaps/power10/libc.so.6)7fffa172a73cgetaddrinfo+0x121c
Quoted 8 lines
(
/usr/lib64/glibc-hwcaps/power10/libc.so.6)
FAIL: expected backtrace entry "gaih_inet.*\+0x[[:xdigit:]]+[[:space:]]\(/usr/lib64/glibc-hwcaps/power10/libc.so.6\)$" got "7fffa172a73cgetaddrinfo+0x121c(/usr/lib64/glibc-hwcaps/power10/libc.so.6)"
test child finished with -1
---- end ----
probe libc'sinet_pton& backtrace it with ping: FAILED!
Thanks
Athira
Quoted 98 lines
This test installs a probe on libc's
inet_ptonfunction, which will use uprobes and then uses perf trace on a ping to localhost. It gets 3 levels deep backtrace and checks whether it is what we expected or not.The test started failing from RHEL 9.4 where as it works in previous distro version (RHEL 9.2). Test expects
gaih_inetfunction to be part of backtrace. But in the glibc version (2.34-86) which is part of distro where it fails, this function is missing and hence the test is failing.From nm and ping command output we can confirm that
gaih_inetfunction is not present in the expected backtrace for glibc version glibc-2.34-86[root@xxx perf]# nm
/usr/lib64/glibc-hwcaps/power10/libc.so.6| grepgaih_inet00000000001273e0tgaih_inet_serv00000000001cd8d8rgaih_inet_typeproto[root@xxx perf]# perf script -i
/tmp/perf.data.6E8
ping 104048 [000] 128582.508976: probe_libc:inet_pton: (7fff83779a60)7fff83779a60 __GI___inet_pton+0x0 (/usr/lib64/glibc-hwcaps/power10/libc.so.6) 7fff8372a73c getaddrinfo+0x121c (/usr/lib64/glibc-hwcaps/power10/libc.so.6) 11dc73534 [unknown] (/usr/bin/ping) 7fff8362a8c4 __libc_start_call_main+0x84(
/usr/lib64/glibc-hwcaps/power10/libc.so.6)FAIL: expected backtrace entry "gaih_inet.*\+0x[[:xdigit:]]+[[:space:]]\(/usr/lib64/glibc-hwcaps/power10/libc.so.6\)$" got "
7fff9d52a73cgetaddrinfo+0x121c(/usr/lib64/glibc-hwcaps/power10/libc.so.6)"With version glibc-2.34-60
gaih_inetfunction is present as part of the expected backtrace. So we cannot just remove thegaih_inetfunction from the backtrace.[root@xxx perf]# nm
/usr/lib64/glibc-hwcaps/power10/libc.so.6| grepgaih_inet0000000000130490 t gaih_inet.constprop.0000000000012e830tgaih_inet_serv00000000001d45e4rgaih_inet_typeproto[root@xxx perf]# ./perf script -i
/tmp/perf.data.b6S
ping 67906 [000] 22699.591699: probe_libc:inet_pton_3: (7fffbdd80820)7fffbdd80820 __GI___inet_pton+0x0 (/usr/lib64/glibc-hwcaps/power10/libc.so.6) 7fffbdd31160 gaih_inet.constprop.0+0xcd0 (/usr/lib64/glibc-hwcaps/power10/libc.so.6) 7fffbdd31c7c getaddrinfo+0x14c (/usr/lib64/glibc-hwcaps/power10/libc.so.6) 1140d3558 [unknown] (/usr/bin/ping)This patch solves this issue by doing a conditional skip. If there is a
gaih_inetfunction present in the libc then it will be added to the expected backtrace else the function will be skipped from being added to the expected backtrace.Output with the patch
[root@xxx perf]# ./perf test -v "probe libc's
inet_pton& backtrace it with ping"
83: probe libc'sinet_pton& backtrace it with ping :
--- start ---
test child forked, pid 102662
ping 102692 [000] 127935.549973: probe_libc:inet_pton: (7fff93379a60)7fff93379a60__GI___inet_pton+0x0(/usr/lib64/glibc-hwcaps/power10/libc.so.6)7fff9332a73cgetaddrinfo+0x121c(/usr/lib64/glibc-hwcaps/power10/libc.so.6)11ef03534[unknown] (/usr/bin/ping)
test child finished with 0
---- end ----
probe libc'sinet_pton& backtrace it with ping: OkSigned-off-by Likhitha Korrapati <[email protected]>Reported-by Disha Goel <[email protected]>---
tools/perf/tests/shell/record+probe_libc_inet_pton.sh| 5 ++++-1 file changed, 4 insertions(+), 1 deletion(-)tools/perf/tests/shell/record+probe_libc_inet_pton.sh +0
-0@@ -45,7 +45,10 @@ trace_libc_inet_pton_backtrace() { ;; ppc64|ppc64le)eventattr='max-stack=4'
- echo "gaih_inet.*\+0x[[:xdigit:]]+[[:space:]]\($libc\)$" >> $expected
+ # Addgaih_inetto expected backtrace only if it is part of libc.
+ if nm $libc | grep -F -qgaih_inet.; then
+ echo "gaih_inet.*\+0x[[:xdigit:]]+[[:space:]]\($libc\)$" >> $expected
+ fi
echo "getaddrinfo\+0x[[:xdigit:]]+[[:space:]]\($libc\)$" >> $expected echo ".*(\+0x[[:xdigit:]]+|\[unknown\])[[:space:]]\(.*/bin/ping.*\)$" >> $expected ;;Signature · 1 line
2.39.1
Arnaldo Carvalho de Melo
maintainerEm Sun, Nov 26, 2023 at 02:09:14AM -0500, Likhitha Korrapati escreveu:
Quoted 19 lines
The perf test "probe libc's
inet_pton& backtrace it with ping" fails on powerpc as below:root@xxx perf]# perf test -v "probe libc's
inet_pton& backtrace it with ping"
85: probe libc'sinet_pton& backtrace it with ping :
--- start ---
test child forked, pid 96028
ping 96056 [002] 127271.101961: probe_libc:inet_pton: (7fffa1779a60)7fffa1779a60__GI___inet_pton+0x0(/usr/lib64/glibc-hwcaps/power10/libc.so.6)7fffa172a73cgetaddrinfo+0x121c(/usr/lib64/glibc-hwcaps/power10/libc.so.6)
FAIL: expected backtrace entry "gaih_inet.*\+0x[[:xdigit:]]+[[:space:]]\(/usr/lib64/glibc-hwcaps/power10/libc.so.6\)$" got "7fffa172a73cgetaddrinfo+0x121c(/usr/lib64/glibc-hwcaps/power10/libc.so.6)"
test child finished with -1
---- end ----
Try to have quoted output, the ones separated by ---- at the beginning of the line indented two spaces, so as to avoid:
perf test record+probe_libc_inet_pton: Fix call chain match on powerpc
The perf test "probe libc's inet_pton & backtrace it with ping" fails on powerpc as below:
root@xxx perf]# perf test -v "probe libc's inet_pton & backtrace it with ping"
85: probe libc's inet_pton & backtrace it with ping :
# Please enter the commit message for your changes. Lines starting
# with '#' will be ignored, and an empty message aborts the commit. # # Author: Likhitha Korrapati <[email protected]> # Date: Sun Nov 26 02:09:14 2023 -0500
I'm copy and pasting from the original post, thanks!
- Arnaldo
Quoted 99 lines
probe libc's
inet_pton& backtrace it with ping: FAILED!This test installs a probe on libc's
inet_ptonfunction, which will use uprobes and then uses perf trace on a ping to localhost. It gets 3 levels deep backtrace and checks whether it is what we expected or not.The test started failing from RHEL 9.4 where as it works in previous distro version (RHEL 9.2). Test expects
gaih_inetfunction to be part of backtrace. But in the glibc version (2.34-86) which is part of distro where it fails, this function is missing and hence the test is failing.From nm and ping command output we can confirm that
gaih_inetfunction is not present in the expected backtrace for glibc version glibc-2.34-86[root@xxx perf]# nm
/usr/lib64/glibc-hwcaps/power10/libc.so.6| grepgaih_inet00000000001273e0tgaih_inet_serv00000000001cd8d8rgaih_inet_typeproto[root@xxx perf]# perf script -i
/tmp/perf.data.6E8
ping 104048 [000] 128582.508976: probe_libc:inet_pton: (7fff83779a60)7fff83779a60 __GI___inet_pton+0x0 (/usr/lib64/glibc-hwcaps/power10/libc.so.6) 7fff8372a73c getaddrinfo+0x121c (/usr/lib64/glibc-hwcaps/power10/libc.so.6) 11dc73534 [unknown] (/usr/bin/ping) 7fff8362a8c4 __libc_start_call_main+0x84(
/usr/lib64/glibc-hwcaps/power10/libc.so.6)FAIL: expected backtrace entry "gaih_inet.*\+0x[[:xdigit:]]+[[:space:]]\(/usr/lib64/glibc-hwcaps/power10/libc.so.6\)$" got "
7fff9d52a73cgetaddrinfo+0x121c(/usr/lib64/glibc-hwcaps/power10/libc.so.6)"With version glibc-2.34-60
gaih_inetfunction is present as part of the expected backtrace. So we cannot just remove thegaih_inetfunction from the backtrace.[root@xxx perf]# nm
/usr/lib64/glibc-hwcaps/power10/libc.so.6| grepgaih_inet0000000000130490 t gaih_inet.constprop.0000000000012e830tgaih_inet_serv00000000001d45e4rgaih_inet_typeproto[root@xxx perf]# ./perf script -i
/tmp/perf.data.b6S
ping 67906 [000] 22699.591699: probe_libc:inet_pton_3: (7fffbdd80820)7fffbdd80820 __GI___inet_pton+0x0 (/usr/lib64/glibc-hwcaps/power10/libc.so.6) 7fffbdd31160 gaih_inet.constprop.0+0xcd0 (/usr/lib64/glibc-hwcaps/power10/libc.so.6) 7fffbdd31c7c getaddrinfo+0x14c (/usr/lib64/glibc-hwcaps/power10/libc.so.6) 1140d3558 [unknown] (/usr/bin/ping)This patch solves this issue by doing a conditional skip. If there is a
gaih_inetfunction present in the libc then it will be added to the expected backtrace else the function will be skipped from being added to the expected backtrace.Output with the patch
[root@xxx perf]# ./perf test -v "probe libc's
inet_pton& backtrace it with ping"
83: probe libc'sinet_pton& backtrace it with ping :
--- start ---
test child forked, pid 102662
ping 102692 [000] 127935.549973: probe_libc:inet_pton: (7fff93379a60)7fff93379a60__GI___inet_pton+0x0(/usr/lib64/glibc-hwcaps/power10/libc.so.6)7fff9332a73cgetaddrinfo+0x121c(/usr/lib64/glibc-hwcaps/power10/libc.so.6)11ef03534[unknown] (/usr/bin/ping)
test child finished with 0
---- end ----
probe libc'sinet_pton& backtrace it with ping: OkSigned-off-by Likhitha Korrapati <[email protected]>Reported-by Disha Goel <[email protected]>--- tools/perf/tests/shell/record+probe_libc_inet_pton.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)tools/perf/tests/shell/record+probe_libc_inet_pton.sh +4
-1@@ -45,7 +45,10 @@ trace_libc_inet_pton_backtrace() { ;; ppc64|ppc64le) eventattr='max-stack=4' - echo "gaih_inet.*\+0x[[:xdigit:]]+[[:space:]]\($libc\)$" >> $expected + # Add gaih_inet to expected backtrace only if it is part of libc. + if nm $libc | grep -F -q gaih_inet.; then + echo "gaih_inet.*\+0x[[:xdigit:]]+[[:space:]]\($libc\)$" >> $expected + fi echo "getaddrinfo\+0x[[:xdigit:]]+[[:space:]]\($libc\)$" >> $expected echo ".*(\+0x[[:xdigit:]]+|\[unknown\])[[:space:]]\(.*/bin/ping.*\)$" >> $expected ;;Signature · 1 line
2.39.1
Signature · 1 line
- Arnaldo
Hi Arnaldo,
Thank you for pointing it. From next time I will take care of it.
-Likhitha.
Quoted 142 lines · Arnaldo Carvalho de Melo
Em Sun, Nov 26, 2023 at 02:09:14AM -0500, Likhitha Korrapati escreveu:
Quoted 19 lines
The perf test "probe libc's
inet_pton& backtrace it with ping" fails on powerpc as below:root@xxx perf]# perf test -v "probe libc's
inet_pton& backtrace it with ping"
85: probe libc'sinet_pton& backtrace it with ping :
--- start ---
test child forked, pid 96028
ping 96056 [002] 127271.101961: probe_libc:inet_pton: (7fffa1779a60)7fffa1779a60__GI___inet_pton+0x0(/usr/lib64/glibc-hwcaps/power10/libc.so.6)7fffa172a73cgetaddrinfo+0x121c(/usr/lib64/glibc-hwcaps/power10/libc.so.6)
FAIL: expected backtrace entry "gaih_inet.*\+0x[[:xdigit:]]+[[:space:]]\(/usr/lib64/glibc-hwcaps/power10/libc.so.6\)$" got "7fffa172a73cgetaddrinfo+0x121c(/usr/lib64/glibc-hwcaps/power10/libc.so.6)"
test child finished with -1
---- end ----Try to have quoted output, the ones separated by ---- at the beginning of the line indented two spaces, so as to avoid:
perf test record+probe_libc_inet_pton: Fix call chain match on powerpc
The perf test "probe libc's
inet_pton& backtrace it with ping" fails on powerpc as below:root@xxx perf]# perf test -v "probe libc's
inet_pton& backtrace it with ping"
85: probe libc'sinet_pton& backtrace it with ping :# Please enter the commit message for your changes. Lines starting
# with '#' will be ignored, and an empty message aborts the commit. # # Author: Likhitha Korrapati <[email protected]> # Date: Sun Nov 26 02:09:14 2023 -0500I'm copy and pasting from the original post, thanks!
- Arnaldo
Quoted 99 lines
probe libc's
inet_pton& backtrace it with ping: FAILED!This test installs a probe on libc's
inet_ptonfunction, which will use uprobes and then uses perf trace on a ping to localhost. It gets 3 levels deep backtrace and checks whether it is what we expected or not.The test started failing from RHEL 9.4 where as it works in previous distro version (RHEL 9.2). Test expects
gaih_inetfunction to be part of backtrace. But in the glibc version (2.34-86) which is part of distro where it fails, this function is missing and hence the test is failing.From nm and ping command output we can confirm that
gaih_inetfunction
is not present in the expected backtrace for glibc version glibc-2.34-86[root@xxx perf]# nm
/usr/lib64/glibc-hwcaps/power10/libc.so.6| grepgaih_inet00000000001273e0tgaih_inet_serv00000000001cd8d8rgaih_inet_typeproto[root@xxx perf]# perf script -i
/tmp/perf.data.6E8
ping 104048 [000] 128582.508976: probe_libc:inet_pton: (7fff83779a60)7fff83779a60 __GI___inet_pton+0x0 (/usr/lib64/glibc-hwcaps/power10/libc.so.6) 7fff8372a73c getaddrinfo+0x121c (/usr/lib64/glibc-hwcaps/power10/libc.so.6) 11dc73534 [unknown] (/usr/bin/ping) 7fff8362a8c4 __libc_start_call_main+0x84(
/usr/lib64/glibc-hwcaps/power10/libc.so.6)FAIL: expected backtrace entry "gaih_inet.*\+0x[[:xdigit:]]+[[:space:]]\(/usr/lib64/glibc-hwcaps/power10/libc.so.6\)$" got "
7fff9d52a73cgetaddrinfo+0x121c(/usr/lib64/glibc-hwcaps/power10/libc.so.6)"With version glibc-2.34-60
gaih_inetfunction is present as part of the expected backtrace. So we cannot just remove thegaih_inetfunction from the backtrace.[root@xxx perf]# nm
/usr/lib64/glibc-hwcaps/power10/libc.so.6| grepgaih_inet0000000000130490 t gaih_inet.constprop.0000000000012e830tgaih_inet_serv00000000001d45e4rgaih_inet_typeproto[root@xxx perf]# ./perf script -i
/tmp/perf.data.b6S
ping 67906 [000] 22699.591699: probe_libc:inet_pton_3: (7fffbdd80820)7fffbdd80820 __GI___inet_pton+0x0 (/usr/lib64/glibc-hwcaps/power10/libc.so.6) 7fffbdd31160 gaih_inet.constprop.0+0xcd0 (/usr/lib64/glibc-hwcaps/power10/libc.so.6) 7fffbdd31c7c getaddrinfo+0x14c (/usr/lib64/glibc-hwcaps/power10/libc.so.6) 1140d3558 [unknown] (/usr/bin/ping)This patch solves this issue by doing a conditional skip. If there is a
gaih_inetfunction present in the libc then it will be added to the expected backtrace else the function will be skipped from being added to the expected backtrace.Output with the patch
[root@xxx perf]# ./perf test -v "probe libc's
inet_pton& backtrace it with ping"
83: probe libc'sinet_pton& backtrace it with ping :
--- start ---
test child forked, pid 102662
ping 102692 [000] 127935.549973: probe_libc:inet_pton: (7fff93379a60)7fff93379a60__GI___inet_pton+0x0(/usr/lib64/glibc-hwcaps/power10/libc.so.6)7fff9332a73cgetaddrinfo+0x121c(/usr/lib64/glibc-hwcaps/power10/libc.so.6)11ef03534[unknown] (/usr/bin/ping)
test child finished with 0
---- end ----
probe libc'sinet_pton& backtrace it with ping: OkSigned-off-by Likhitha Korrapati <[email protected]>Reported-by Disha Goel <[email protected]>--- tools/perf/tests/shell/record+probe_libc_inet_pton.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)tools/perf/tests/shell/record+probe_libc_inet_pton.sh +4
-1@@ -45,7 +45,10 @@ trace_libc_inet_pton_backtrace() { ;; ppc64|ppc64le) eventattr='max-stack=4' - echo "gaih_inet.*\+0x[[:xdigit:]]+[[:space:]]\($libc\)$" >> $expected + # Add gaih_inet to expected backtrace only if it is part of libc. + if nm $libc | grep -F -q gaih_inet.; then + echo "gaih_inet.*\+0x[[:xdigit:]]+[[:space:]]\($libc\)$" >> $expected + fi echo "getaddrinfo\+0x[[:xdigit:]]+[[:space:]]\($libc\)$" >> $expected echo ".*(\+0x[[:xdigit:]]+|\[unknown\])[[:space:]]\(.*/bin/ping.*\)$" >> $expected ;;Signature · 1 line
2.39.1