summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Rogers <irogers@google.com>2025-06-07 09:12:37 +0300
committerNamhyung Kim <namhyung@kernel.org>2025-06-25 22:37:35 +0300
commit4d2eefd7fb91482f1327f28f14112201e0b45dff (patch)
tree98f5ccf17acc9e480e0908a463f1cff0e35727e4
parent57cbd56e2efe26483be2d4e7f62a7d9d816b54f1 (diff)
downloadlinux-4d2eefd7fb91482f1327f28f14112201e0b45dff.tar.xz
perf header: Display message if BPF/BTF info is empty
The perf.data file may contain a bpf_prog_info or bpf_btf feature. If the contents of these are empty then nothing is displayed. Rather than display nothing and not account for the file space, display an empty message. Signed-off-by: Ian Rogers <irogers@google.com> Link: https://lore.kernel.org/r/20250617223356.2752099-4-irogers@google.com Signed-off-by: Namhyung Kim <namhyung@kernel.org>
-rw-r--r--tools/perf/util/header.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/tools/perf/util/header.c b/tools/perf/util/header.c
index 3f1b78810059..a9538bb1004d 100644
--- a/tools/perf/util/header.c
+++ b/tools/perf/util/header.c
@@ -1814,6 +1814,9 @@ static void print_bpf_prog_info(struct feat_fd *ff, FILE *fp)
root = &env->bpf_progs.infos;
next = rb_first(root);
+ if (!next)
+ printf("# bpf_prog_info empty\n");
+
while (next) {
struct bpf_prog_info_node *node;
@@ -1838,6 +1841,9 @@ static void print_bpf_btf(struct feat_fd *ff, FILE *fp)
root = &env->bpf_progs.btfs;
next = rb_first(root);
+ if (!next)
+ printf("# btf info empty\n");
+
while (next) {
struct btf_node *node;