linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH Linux-next] perf test: Fix test case perf trace BTF general tests
@ 2025-11-17 12:43 Thomas Richter
  2025-11-18  1:58 ` Namhyung Kim
  2025-11-18 18:30 ` Jan Polensky
  0 siblings, 2 replies; 17+ messages in thread
From: Thomas Richter @ 2025-11-17 12:43 UTC (permalink / raw)
  To: linux-kernel, linux-s390, linux-perf-users, acme, namhyung
  Cc: agordeev, gor, sumanthk, hca, japo, Thomas Richter

The following test case fails on linux-next repo:

 ❯ uname -a
 Linux s83lp47.lnxne.boe 6.18.0-20251116.rc5.git0.0f2995693867.63.\
      fc42.s390x+next #1 SMP Sun Nov 16 20:05:28 CET 2025 s390x GNU/Linux

 # perf test -Fv 109
 --- start ---
 Checking if vmlinux BTF exists
 Testing perf trace's string augmentation
 Testing perf trace's buffer augmentation
 Buffer augmentation test failed, output:
 buffer content
 echo/23281 write(1, buffer conten, 15, "") = 15
 ---- end ----
 109: perf trace BTF general tests            : FAILED!
 #

The root case is a changed output format on linux-next.
There is an addional "" string as forth parameter in the write()
line. Here is the detailed output on linux-repo.
Please note that this depends on the kernel and not on the perf tool.

Output on linux next kernel:
 # uname -a
 Linux f43 6.18.0-rc5-next-20251114tmr-n #1 SMP PREEMPT_DYNAMIC ...
 # perf config trace.show_arg_names=false trace.show_duration=false \
	trace.show_timestamp=false trace.args_alignment=0
 # ./perf trace --sort-events -e write --max-events=1 \
	-- echo 'buffer content' 1>/dev/null
 echo/7676 write(1, buffer content\10, 15, "") = 15
 #

Output on linux kernel:
 # uname -a
 Linux b3560002.lnxne.boe 6.18.0-rc5m-perf #6 ....
 # perf config trace.show_arg_names=false trace.show_duration=false \
	trace.show_timestamp=false trace.args_alignment=0
 # ./perf trace --sort-events -e write --max-events=1 \
	-- echo 'buffer content' 1>/dev/null
 echo/36932 write(1, buffer content\10, 15) = 15
 #

Add the optional forth parameter in the extented regular expression to
accept both output formats.

Output after:
 # ./perf test -Fv 'perf trace BTF general tests'
 --- start ---
 Checking if vmlinux BTF exists
 Testing perf trace's string augmentation
 Testing perf trace's buffer augmentation
 Testing perf trace's struct augmentation
 ---- end ----
 115: perf trace BTF general tests            : Ok
 #

Signed-off-by: Thomas Richter <tmricht@linux.ibm.com>
---
 tools/perf/tests/shell/trace_btf_general.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/perf/tests/shell/trace_btf_general.sh b/tools/perf/tests/shell/trace_btf_general.sh
index ef2da806be6b..9cd6180062d8 100755
--- a/tools/perf/tests/shell/trace_btf_general.sh
+++ b/tools/perf/tests/shell/trace_btf_general.sh
@@ -39,7 +39,7 @@ trace_test_buffer() {
   echo "Testing perf trace's buffer augmentation"
   # echo will insert a newline (\10) at the end of the buffer
   output="$(perf trace --sort-events -e write --max-events=1 -- echo "${buffer}" 2>&1)"
-  if ! echo "$output" | grep -q -E "^echo/[0-9]+ write\([0-9]+, ${buffer}.*, [0-9]+\) += +[0-9]+$"
+  if ! echo "$output" | grep -qE "^echo/[0-9]+ write\([0-9]+, ${buffer}\\\\10, [0-9]+(, ..)?\) += +[0-9]+$"
   then
     printf "Buffer augmentation test failed, output:\n$output\n"
     err=1
-- 
2.51.1


^ permalink raw reply related	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2025-11-27  6:28 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-17 12:43 [PATCH Linux-next] perf test: Fix test case perf trace BTF general tests Thomas Richter
2025-11-18  1:58 ` Namhyung Kim
2025-11-18  6:15   ` Thomas Richter
2025-11-18  6:43     ` Namhyung Kim
2025-11-18 18:24       ` Steven Rostedt
2025-11-19  4:36         ` Namhyung Kim
2025-11-19 17:59           ` Steven Rostedt
2025-11-20  0:52             ` Namhyung Kim
2025-11-26  7:13               ` Thomas Richter
2025-11-26 15:24                 ` Steven Rostedt
2025-11-26 17:12                   ` Steven Rostedt
2025-11-26 17:37                     ` Steven Rostedt
2025-11-26 18:57                     ` Namhyung Kim
2025-11-26 19:01                       ` Howard Chu
2025-11-27  6:28                   ` Thomas Richter
2025-11-18 18:30 ` Jan Polensky
2025-11-19  7:55   ` Thomas Richter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).