Skip to contentSkip to conversation

Fix perf test probe libc's inet_pton on x86_64

PATCH In review Thomas Richter 2 participants 2 messages May 3, 2023 perf events

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix perf test probe libc's inet_pton on x86_64

The test case probe libc's inet_pton & backtrace it with ping fails with Fedora 38 on x86_64.

Function getaddrinfo() does not show up in the call chain anymore:

 # ./perf script
 ping  1803 [000] 728.567146: probe_libc:inet_pton: (7f5275afc840)
           133840 __GI___inet_pton+0x0 (/usr/lib64/libc.so.6)
            27b4a __libc_start_call_main+0x7a (/usr/lib64/libc.so.6)
            27c0b __libc_start_main@@GLIBC_2.34+0x8b (/usr/lib64/libc.so.6)

ping 1803 [000] 728.567184: probe_libc:inet_pton: (7f5275afc840)

           133840 __GI___inet_pton+0x0 (/usr/lib64/libc.so.6)
             493e main+0xcde (/usr/bin/ping)
            27b4a __libc_start_call_main+0x7a (/usr/lib64/libc.so.6)

#
which causes the test case to fail. Remove function getaddrinfo() from list of expected functions.

Output before:

 # ./perf test 'libc'
 91: probe libc's inet_pton & backtrace it with ping    : FAILED!
 #

Output after:

 # ./perf test 'libc'
 91: probe libc's inet_pton & backtrace it with ping    : Ok
 #
---
 tools/perf/tests/shell/record+probe_libc_inet_pton.sh | 1 -
 1 file changed, 1 deletion(-)
tools/perf/tests/shell/record+probe_libc_inet_pton.sh +0 -1
index b4149b2db4c6..8d5915d3ad6f 100755
@@ -51,7 +51,6 @@ trace_libc_inet_pton_backtrace() {
 		;;
 	*)
 		eventattr='max-stack=3'
-		echo "getaddrinfo\+0x[[:xdigit:]]+[[:space:]]\($libc\)$" >> $expected
 		echo ".*(\+0x[[:xdigit:]]+|\[unknown\])[[:space:]]\(.*/bin/ping.*\)$" >> $expected
 		;;
 	esac
Signature · 1 line
2.40.1
#1 lore raw

Em Wed, May 03, 2023 at 10:12:55AM +0200, Thomas Richter escreveu:

Quoted 20 lines

The test case probe libc's inet_pton & backtrace it with ping fails with Fedora 38 on x86_64.

Function getaddrinfo() does not show up in the call chain anymore:

 # ./perf script
 ping  1803 [000] 728.567146: probe_libc:inet_pton: (7f5275afc840)
           133840 __GI___inet_pton+0x0 (/usr/lib64/libc.so.6)
            27b4a __libc_start_call_main+0x7a (/usr/lib64/libc.so.6)
            27c0b __libc_start_main@@GLIBC_2.34+0x8b (/usr/lib64/libc.so.6)

ping 1803 [000] 728.567184: probe_libc:inet_pton: (7f5275afc840)

           133840 __GI___inet_pton+0x0 (/usr/lib64/libc.so.6)
             493e main+0xcde (/usr/bin/ping)
            27b4a __libc_start_call_main+0x7a (/usr/lib64/libc.so.6)

#
which causes the test case to fail. Remove function getaddrinfo() from list of expected functions.

Output before:

Quoted 8 lines
 # ./perf test 'libc'
 91: probe libc's inet_pton & backtrace it with ping    : FAILED!
 #

Output after:

 # ./perf test 'libc'
 91: probe libc's inet_pton & backtrace it with ping    : Ok
 #

Thanks, tested and applied.

- Arnaldo

Quoted 19 lines
---
 tools/perf/tests/shell/record+probe_libc_inet_pton.sh | 1 -
 1 file changed, 1 deletion(-)
tools/perf/tests/shell/record+probe_libc_inet_pton.sh +0 -1
index b4149b2db4c6..8d5915d3ad6f 100755
@@ -51,7 +51,6 @@ trace_libc_inet_pton_backtrace() {
 		;;
 	*)
 		eventattr='max-stack=3'
-		echo "getaddrinfo\+0x[[:xdigit:]]+[[:space:]]\($libc\)$" >> $expected
 		echo ".*(\+0x[[:xdigit:]]+|\[unknown\])[[:space:]]\(.*/bin/ping.*\)$" >> $expected
 		;;
 	esac
Signature · 1 line
2.40.1