summaryrefslogtreecommitdiff
path: root/tools/perf
diff options
context:
space:
mode:
authorIan Rogers <irogers@google.com>2025-07-02 21:20:00 -0700
committerNamhyung Kim <namhyung@kernel.org>2025-07-03 11:22:17 -0700
commit6c21316e52959f60e9367a41a7893d8459d7dfab (patch)
treef340440302a2896975eeede5c5c558687fa10953 /tools/perf
parente9846f5ead26d2ed2eea0987e3991a667fc38d22 (diff)
perf header: Fix pipe mode header dumping
The pipe mode header dumping was accidentally removed when tracing of header feature events in pipe mode was added. Minor spelling tweak to header test failure message. Fixes: 61051f9a8452 ("perf header: In pipe mode dump features without --header/-I") Signed-off-by: Ian Rogers <irogers@google.com> Tested-by: Namhyung Kim <namhyung@kernel.org> Link: https://lore.kernel.org/r/20250703042000.2740640-1-irogers@google.com Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Diffstat (limited to 'tools/perf')
-rwxr-xr-xtools/perf/tests/shell/header.sh2
-rw-r--r--tools/perf/util/header.c15
2 files changed, 15 insertions, 2 deletions
diff --git a/tools/perf/tests/shell/header.sh b/tools/perf/tests/shell/header.sh
index 412263de6ed70..e1628ac0a6140 100755
--- a/tools/perf/tests/shell/header.sh
+++ b/tools/perf/tests/shell/header.sh
@@ -42,7 +42,7 @@ check_header_output() {
do
if ! grep -q -E "$i" "${script_output}"
then
- echo "Failed to find expect $i in output"
+ echo "Failed to find expected $i in output"
err=1
fi
done
diff --git a/tools/perf/util/header.c b/tools/perf/util/header.c
index 487f663ed2de0..53d54fbda10da 100644
--- a/tools/perf/util/header.c
+++ b/tools/perf/util/header.c
@@ -4343,6 +4343,7 @@ int perf_event__process_feature(struct perf_session *session,
int type = fe->header.type;
u64 feat = fe->feat_id;
int ret = 0;
+ bool print = dump_trace;
if (type < 0 || type >= PERF_RECORD_HEADER_MAX) {
pr_warning("invalid record type %d in pipe-mode\n", type);
@@ -4362,8 +4363,20 @@ int perf_event__process_feature(struct perf_session *session,
goto out;
}
- if (dump_trace) {
+ if (session->tool->show_feat_hdr) {
+ if (!feat_ops[feat].full_only ||
+ session->tool->show_feat_hdr >= SHOW_FEAT_HEADER_FULL_INFO) {
+ print = true;
+ } else {
+ fprintf(stdout, "# %s info available, use -I to display\n",
+ feat_ops[feat].name);
+ }
+ }
+
+ if (dump_trace)
printf(", ");
+
+ if (print) {
if (feat_ops[feat].print)
feat_ops[feat].print(&ff, stdout);
else