[PATCH v6 24/26] perf test trace_btf_general: Drop --max-events=1 and make non-exclusive

From: Ian Rogers

Date: Mon Sep 28 2026 - 14:32:09 EST


With --max-events=1 an unrelated event can end perf trace before the
command's syscall is seen. Trace the whole command and grep for the
expected line, as trace_btf_enum.sh does, and remove the exclusive tag.

Assisted-by: Antigravity:gemini-3.1-pro
Signed-off-by: Ian Rogers <irogers@xxxxxxxxxx>
---
tools/perf/tests/shell/trace_btf_general.sh | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/tools/perf/tests/shell/trace_btf_general.sh b/tools/perf/tests/shell/trace_btf_general.sh
index 06f4a704daf8..d1fa7c846478 100755
--- a/tools/perf/tests/shell/trace_btf_general.sh
+++ b/tools/perf/tests/shell/trace_btf_general.sh
@@ -1,5 +1,5 @@
#!/bin/bash
-# perf trace BTF general tests (exclusive)
+# perf trace BTF general tests
# SPDX-License-Identifier: GPL-2.0

err=0
@@ -26,7 +26,7 @@ check_vmlinux() {

trace_test_string() {
echo "Testing perf trace's string augmentation"
- output="$(perf trace --sort-events -e renameat* --max-events=1 -- mv ${file1} ${file2} 2>&1)"
+ output="$(perf trace --sort-events -e renameat* -- mv ${file1} ${file2} 2>&1)"
if ! echo "$output" | grep -q -E "^mv/[0-9]+ renameat(2)?\(.*, \"${file1}\", .*, \"${file2}\", .*\) += +[0-9]+$"
then
printf "String augmentation test failed, output:\n$output\n"
@@ -37,7 +37,7 @@ trace_test_string() {
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)"
+ output="$(perf trace --sort-events -e write -- echo "${buffer}" 2>&1)"
if ! echo "$output" | grep -q -E "^echo/[0-9]+ write\([0-9]+, ${buffer}.*, [0-9]+\) += +[0-9]+$"
then
printf "Buffer augmentation test failed, output:\n$output\n"
@@ -47,7 +47,7 @@ trace_test_buffer() {

trace_test_struct_btf() {
echo "Testing perf trace's struct augmentation"
- output="$(perf trace --sort-events -e clock_nanosleep --force-btf --max-events=1 -- sleep 1 2>&1)"
+ output="$(perf trace --sort-events -e clock_nanosleep --force-btf -- sleep 1 2>&1)"
if ! echo "$output" | grep -q -E "^sleep/[0-9]+ clock_nanosleep\(0, 0, \{1,.*\}, 0x[0-9a-f]+\) += +[0-9]+$"
then
printf "BTF struct augmentation test failed, output:\n$output\n"
--
2.56.0.rc1.315.gc6ed9934b7-goog