Skip to contentSkip to conversation

perf/test: perf test 86 fails on s390 repo linux-next

PATCH Superseded Thomas Richter 2 participants 4 messages Sep 16, 2024 – Sep 30, 2024 perf events

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 perf/test: perf test 86 fails on s390 repo linux-next

Command perf test 86 fails on s390 using linux-next repository:

 # perf test -F 86
 ping 868299 [007] 28248.013596: probe_libc:inet_pton_1: (3ff95948020)
 3ff95948020 inet_pton+0x0 (inlined)
 3ff9595e6e7 text_to_binary_address+0x1007 (inlined)
 3ff9595e6e7 gaih_inet+0x1007 (inlined)
 FAIL: expected backtrace entry \
	 "main\+0x[[:xdigit:]]+[[:space:]]\(.*/bin/ping.*\)$"
	 got "3ff9595e6e7 gaih_inet+0x1007 (inlined)"
 86: probe libc's inet_pton & backtrace it with ping  : FAILED!
 #

The root cause is a new stack layout, some functions have been added as seen below. Add text_to_binary_address and friends to the list of expected functions.

 # perf script | tac | grep -m1 '^ping' -B9 | tac
 ping  866856 [007] 25979.494921: probe_libc:inet_pton: (3ff8ec48020)
	     3ff8ec48020 inet_pton+0x0 (inlined)
	     3ff8ec5e6e7 text_to_binary_address+0x1007 (inlined)
	     3ff8ec5e6e7 gaih_inet+0x1007 (inlined)
	     3ff8ec5e6e7 getaddrinfo+0x1007 (/usr/lib64/libc.so.6)
	     2aa3fe04bf5 main+0xff5 (/usr/bin/ping)
	     3ff8eb34a5b __libc_start_call_main+0x8b (/usr/lib64/libc.so.6)
	     3ff8eb34b5d __libc_start_main@GLIBC_2.2+0xad (inlined)
	     2aa3fe06a1f [unknown] (/usr/bin/ping)

#

Output after:

 # perf test -F 86
 86: probe libc's inet_pton & backtrace it with ping  : Ok
 #
---
 tools/perf/tests/shell/record+probe_libc_inet_pton.sh | 2 ++
 1 file changed, 2 insertions(+)
tools/perf/tests/shell/record+probe_libc_inet_pton.sh +2 -0
index f38c8ead0b03..bc6e2fe1d999 100755
@@ -40,6 +40,8 @@ trace_libc_inet_pton_backtrace() {
 	case "$(uname -m)" in
 	s390x)
 		eventattr='call-graph=dwarf,max-stack=4'
+		echo "text_to_binary_address\+0x[[:xdigit:]]+[[:space:]]\($libc|inlined\)$" >> $expected
+		echo "gaih_inet\+0x[[:xdigit:]]+[[:space:]]\($libc|inlined\)$" >> $expected
 		echo "(__GI_)?getaddrinfo\+0x[[:xdigit:]]+[[:space:]]\($libc|inlined\)$" >> $expected
 		echo "main\+0x[[:xdigit:]]+[[:space:]]\(.*/bin/ping.*\)$" >> $expected
 		;;
Signature · 1 line
2.46.0
maintainer
#1 lore raw

Hello,

Quoted 16 lines · Thomas Richter

Command perf test 86 fails on s390 using linux-next repository:

 # perf test -F 86
 ping 868299 [007] 28248.013596: probe_libc:inet_pton_1: (3ff95948020)
 3ff95948020 inet_pton+0x0 (inlined)
 3ff9595e6e7 text_to_binary_address+0x1007 (inlined)
 3ff9595e6e7 gaih_inet+0x1007 (inlined)
 FAIL: expected backtrace entry \
	 "main\+0x[[:xdigit:]]+[[:space:]]\(.*/bin/ping.*\)$"
	 got "3ff9595e6e7 gaih_inet+0x1007 (inlined)"
 86: probe libc's inet_pton & backtrace it with ping  : FAILED!
 #

The root cause is a new stack layout, some functions have been added as seen below. Add text_to_binary_address and friends to the list of expected functions.

Quoted 10 lines
 # perf script | tac | grep -m1 '^ping' -B9 | tac
 ping  866856 [007] 25979.494921: probe_libc:inet_pton: (3ff8ec48020)
	     3ff8ec48020 inet_pton+0x0 (inlined)
	     3ff8ec5e6e7 text_to_binary_address+0x1007 (inlined)
	     3ff8ec5e6e7 gaih_inet+0x1007 (inlined)
	     3ff8ec5e6e7 getaddrinfo+0x1007 (/usr/lib64/libc.so.6)
	     2aa3fe04bf5 main+0xff5 (/usr/bin/ping)
	     3ff8eb34a5b __libc_start_call_main+0x8b (/usr/lib64/libc.so.6)
	     3ff8eb34b5d __libc_start_main@GLIBC_2.2+0xad (inlined)
	     2aa3fe06a1f [unknown] (/usr/bin/ping)

Is it because of a kernel change? What about old kernels then?

Quoted 18 lines

#

Output after:

 # perf test -F 86
 86: probe libc's inet_pton & backtrace it with ping  : Ok
 #
---
 tools/perf/tests/shell/record+probe_libc_inet_pton.sh | 2 ++
 1 file changed, 2 insertions(+)
tools/perf/tests/shell/record+probe_libc_inet_pton.sh +0 -0
index f38c8ead0b03..bc6e2fe1d999 100755

tools/perf/tests/shell/record+probe_libc_inet_pton.sh trace_libc_inet_pton_backtrace() { · line 44

Quoted 5 lines
tools/perf/tests/shell/record+probe_libc_inet_pton.sh +2 -0
@@ -40,6 +40,8 @@ trace_libc_inet_pton_backtrace() {
 	case "$(uname -m)" in
 	s390x)
 		eventattr='call-graph=dwarf,max-stack=4'
+		echo "text_to_binary_address\+0x[[:xdigit:]]+[[:space:]]\($libc|inlined\)$" >> $expected
+		echo "gaih_inet\+0x[[:xdigit:]]+[[:space:]]\($libc|inlined\)$" >> $expected

Is it possible to make it this part conditional and only have it for the new kernels?

Thanks,
Namhyung

Quoted 6 lines
tools/perf/tests/shell/record+probe_libc_inet_pton.sh +0 -0
 		echo "(__GI_)?getaddrinfo\+0x[[:xdigit:]]+[[:space:]]\($libc|inlined\)$" >> $expected
 		echo "main\+0x[[:xdigit:]]+[[:space:]]\(.*/bin/ping.*\)$" >> $expected
 		;;
Signature · 1 line
2.46.0
#2 lore raw
Quoted 59 lines · Namhyung Kim

Hello,

Quoted 16 lines · Thomas Richter

Command perf test 86 fails on s390 using linux-next repository:

 # perf test -F 86
 ping 868299 [007] 28248.013596: probe_libc:inet_pton_1: (3ff95948020)
 3ff95948020 inet_pton+0x0 (inlined)
 3ff9595e6e7 text_to_binary_address+0x1007 (inlined)
 3ff9595e6e7 gaih_inet+0x1007 (inlined)
 FAIL: expected backtrace entry \
	 "main\+0x[[:xdigit:]]+[[:space:]]\(.*/bin/ping.*\)$"
	 got "3ff9595e6e7 gaih_inet+0x1007 (inlined)"
 86: probe libc's inet_pton & backtrace it with ping  : FAILED!
 #

The root cause is a new stack layout, some functions have been added as seen below. Add text_to_binary_address and friends to the list of expected functions.

Quoted 10 lines
 # perf script | tac | grep -m1 '^ping' -B9 | tac
 ping  866856 [007] 25979.494921: probe_libc:inet_pton: (3ff8ec48020)
	     3ff8ec48020 inet_pton+0x0 (inlined)
	     3ff8ec5e6e7 text_to_binary_address+0x1007 (inlined)
	     3ff8ec5e6e7 gaih_inet+0x1007 (inlined)
	     3ff8ec5e6e7 getaddrinfo+0x1007 (/usr/lib64/libc.so.6)
	     2aa3fe04bf5 main+0xff5 (/usr/bin/ping)
	     3ff8eb34a5b __libc_start_call_main+0x8b (/usr/lib64/libc.so.6)
	     3ff8eb34b5d __libc_start_main@GLIBC_2.2+0xad (inlined)
	     2aa3fe06a1f [unknown] (/usr/bin/ping)

Is it because of a kernel change? What about old kernels then?

Quoted 18 lines

#

Output after:

 # perf test -F 86
 86: probe libc's inet_pton & backtrace it with ping  : Ok
 #
---
 tools/perf/tests/shell/record+probe_libc_inet_pton.sh | 2 ++
 1 file changed, 2 insertions(+)
tools/perf/tests/shell/record+probe_libc_inet_pton.sh +0 -0
index f38c8ead0b03..bc6e2fe1d999 100755

tools/perf/tests/shell/record+probe_libc_inet_pton.sh trace_libc_inet_pton_backtrace() { · line 44

Quoted 5 lines
tools/perf/tests/shell/record+probe_libc_inet_pton.sh +2 -0
@@ -40,6 +40,8 @@ trace_libc_inet_pton_backtrace() {
 	case "$(uname -m)" in
 	s390x)
 		eventattr='call-graph=dwarf,max-stack=4'
+		echo "text_to_binary_address\+0x[[:xdigit:]]+[[:space:]]\($libc|inlined\)$" >> $expected
+		echo "gaih_inet\+0x[[:xdigit:]]+[[:space:]]\($libc|inlined\)$" >> $expected

Is it possible to make it this part conditional and only have it for the new kernels?

Quoted 5 lines

Thanks,
Namhyung

Quoted 1 line

I think this is more related to glibc and has nothing to do with the kernel version. It happened after I did a dnf update.

Signature · 9 lines
Thomas Richter, Dept 3303, IBM s390 Linux Development, Boeblingen, Germany
--
IBM Deutschland Research & Development GmbH

Vorsitzender des Aufsichtsrats: Wolfgang Wendt

Geschäftsführung: David Faller

Sitz der Gesellschaft: Böblingen / Registergericht: Amtsgericht Stuttgart, HRB 243294
maintainer
#3 lore raw
Quoted 60 lines · Thomas Richter
Quoted 45 lines · Namhyung Kim

Hello,

Quoted 16 lines · Thomas Richter

Command perf test 86 fails on s390 using linux-next repository:

 # perf test -F 86
 ping 868299 [007] 28248.013596: probe_libc:inet_pton_1: (3ff95948020)
 3ff95948020 inet_pton+0x0 (inlined)
 3ff9595e6e7 text_to_binary_address+0x1007 (inlined)
 3ff9595e6e7 gaih_inet+0x1007 (inlined)
 FAIL: expected backtrace entry \
	 "main\+0x[[:xdigit:]]+[[:space:]]\(.*/bin/ping.*\)$"
	 got "3ff9595e6e7 gaih_inet+0x1007 (inlined)"
 86: probe libc's inet_pton & backtrace it with ping  : FAILED!
 #

The root cause is a new stack layout, some functions have been added as seen below. Add text_to_binary_address and friends to the list of expected functions.

Quoted 10 lines
 # perf script | tac | grep -m1 '^ping' -B9 | tac
 ping  866856 [007] 25979.494921: probe_libc:inet_pton: (3ff8ec48020)
	     3ff8ec48020 inet_pton+0x0 (inlined)
	     3ff8ec5e6e7 text_to_binary_address+0x1007 (inlined)
	     3ff8ec5e6e7 gaih_inet+0x1007 (inlined)
	     3ff8ec5e6e7 getaddrinfo+0x1007 (/usr/lib64/libc.so.6)
	     2aa3fe04bf5 main+0xff5 (/usr/bin/ping)
	     3ff8eb34a5b __libc_start_call_main+0x8b (/usr/lib64/libc.so.6)
	     3ff8eb34b5d __libc_start_main@GLIBC_2.2+0xad (inlined)
	     2aa3fe06a1f [unknown] (/usr/bin/ping)

Is it because of a kernel change? What about old kernels then?

Quoted 13 lines

#

Output after:

 # perf test -F 86
 86: probe libc's inet_pton & backtrace it with ping  : Ok
 #
---
 tools/perf/tests/shell/record+probe_libc_inet_pton.sh | 2 ++
 1 file changed, 2 insertions(+)
Quoted 13 lines

tools/perf/tests/shell/record+probe_libc_inet_pton.sh trace_libc_inet_pton_backtrace() { · line 44

Quoted 10 lines
tools/perf/tests/shell/record+probe_libc_inet_pton.sh +2 -0
index f38c8ead0b03..bc6e2fe1d999 100755
@@ -40,6 +40,8 @@ trace_libc_inet_pton_backtrace() {
 	case "$(uname -m)" in
 	s390x)
 		eventattr='call-graph=dwarf,max-stack=4'
+		echo "text_to_binary_address\+0x[[:xdigit:]]+[[:space:]]\($libc|inlined\)$" >> $expected
+		echo "gaih_inet\+0x[[:xdigit:]]+[[:space:]]\($libc|inlined\)$" >> $expected

Is it possible to make it this part conditional and only have it for the new kernels?

Quoted 2 lines

I think this is more related to glibc and has nothing to do with the kernel version. It happened after I did a dnf update.

Ok, then I'm afraid fixing this would break others with old glibc. Can you please update the regex to cover both cases?

Thanks,
Namhyung