Commit 4d2eefd7 authored by Ian Rogers's avatar Ian Rogers Committed by Namhyung Kim
Browse files

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: default avatarIan Rogers <irogers@google.com>
Link: https://lore.kernel.org/r/20250617223356.2752099-4-irogers@google.com


Signed-off-by: default avatarNamhyung Kim <namhyung@kernel.org>
parent 57cbd56e
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -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;