From: Jerome Marchand Date: Fri, 30 Jul 2021 16:15:05 +0000 (+0200) Subject: libbpf-tools: readahead: don't mark struct hist as static X-Git-Tag: v0.22.0~33 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ada66f92ff9b384041545e92686263f47bb32048;p=platform%2Fupstream%2Fbcc.git libbpf-tools: readahead: don't mark struct hist as static 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; | ^~ --- diff --git a/libbpf-tools/readahead.bpf.c b/libbpf-tools/readahead.bpf.c index ba22e534..b9423c3f 100644 --- a/libbpf-tools/readahead.bpf.c +++ b/libbpf-tools/readahead.bpf.c @@ -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)