Skip to content

Commit 4d2eefd

Browse files
captain5050namhyung
authored andcommitted
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 <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Namhyung Kim <[email protected]>
1 parent 57cbd56 commit 4d2eefd

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

tools/perf/util/header.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1814,6 +1814,9 @@ static void print_bpf_prog_info(struct feat_fd *ff, FILE *fp)
18141814
root = &env->bpf_progs.infos;
18151815
next = rb_first(root);
18161816

1817+
if (!next)
1818+
printf("# bpf_prog_info empty\n");
1819+
18171820
while (next) {
18181821
struct bpf_prog_info_node *node;
18191822

@@ -1838,6 +1841,9 @@ static void print_bpf_btf(struct feat_fd *ff, FILE *fp)
18381841
root = &env->bpf_progs.btfs;
18391842
next = rb_first(root);
18401843

1844+
if (!next)
1845+
printf("# btf info empty\n");
1846+
18411847
while (next) {
18421848
struct btf_node *node;
18431849

0 commit comments

Comments
 (0)