[PATCH v1 0/4] Pipe mode header dumping and minor space saving

From: Ian Rogers
Date: Sat Jun 07 2025 - 02:13:29 EST


Pipe mode has no header and emits the data as if it were events. The
dumping of features was controlled by the --header/-I options which
makes little sense when they are events, normally traced when
dump_trace is true. Switch to making pipe feature events also be
traced with detail when other events are.

The attr event in pipe mode had no dumping, wire this up and use the
existing perf_event_attr fprintf support.

The header's bpf_prog_info or bpf_btf may be empty when written. If
they are empty just skip writing them to save space.

Ian Rogers (4):
perf header: In pipe mode dump features without --header/-I
perf header: Allow tracing of attr events
perf header: Display message if BPF/BTF info is empty
perf header: Don't write empty BPF/BTF info

tools/perf/util/header.c | 46 ++++++++++++++++++++++++++--------------
tools/perf/util/header.h | 1 +
2 files changed, 31 insertions(+), 16 deletions(-)

--
2.50.0.rc0.604.gd4ff7b7c86-goog