Skip to content

Commit

Permalink
libbpf-tools: readahead: don't mark struct hist as static
Browse files Browse the repository at this point in the history
Libbpf readahead tool does not compile with bpftool v5.14. Since
commit 31332ccb756 ("bpftool: Stop emitting static variables in BPF
skeleton"), bpftool gen skeleton does not include static variables
into the skeleton file anymore.

Fixes the following compilation error:
readahead.c: In function 'main':
readahead.c:153:26: error: 'struct readahead_bpf__bss' has no member named 'hist'
  153 |         histp = &obj->bss->hist;
      |                          ^~
  • Loading branch information
jeromemarchand authored and yonghong-song committed Aug 3, 2021
1 parent e4e660d commit ada66f9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libbpf-tools/readahead.bpf.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ struct {
__uint(map_flags, BPF_F_NO_PREALLOC);
} birth SEC(".maps");

static struct hist hist;
struct hist hist = {};

SEC("fentry/do_page_cache_ra")
int BPF_PROG(do_page_cache_ra)
Expand Down

0 comments on commit ada66f9

Please sign in to comment.