|
|
0fb47c |
From 4e2851687904cff7ab4f8faa862b9046e5aaab09 Mon Sep 17 00:00:00 2001
|
|
|
0fb47c |
From: Jerome Marchand <jmarchan@redhat.com>
|
|
|
0fb47c |
Date: Fri, 30 Jul 2021 18:15:05 +0200
|
|
|
0fb47c |
Subject: [PATCH] libbpf-tools: readahead: don't mark struct hist as static
|
|
|
0fb47c |
|
|
|
0fb47c |
Libbpf readahead tool does not compile with bpftool v5.14. Since
|
|
|
0fb47c |
commit 31332ccb756 ("bpftool: Stop emitting static variables in BPF
|
|
|
0fb47c |
skeleton"), bpftool gen skeleton does not include static variable into
|
|
|
0fb47c |
the skeleton file anymore.
|
|
|
0fb47c |
|
|
|
0fb47c |
Fixes the following compilation error:
|
|
|
0fb47c |
readahead.c: In function 'main':
|
|
|
0fb47c |
readahead.c:153:26: error: 'struct readahead_bpf__bss' has no member named 'hist'
|
|
|
0fb47c |
153 | histp = &obj->bss->hist;
|
|
|
0fb47c |
| ^~
|
|
|
0fb47c |
---
|
|
|
0fb47c |
libbpf-tools/readahead.bpf.c | 2 +-
|
|
|
0fb47c |
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
|
0fb47c |
|
|
|
0fb47c |
diff --git a/libbpf-tools/readahead.bpf.c b/libbpf-tools/readahead.bpf.c
|
|
|
0fb47c |
index ba22e534..cfead704 100644
|
|
|
0fb47c |
--- a/libbpf-tools/readahead.bpf.c
|
|
|
0fb47c |
+++ b/libbpf-tools/readahead.bpf.c
|
|
|
0fb47c |
@@ -24,7 +24,7 @@ struct {
|
|
|
0fb47c |
__uint(map_flags, BPF_F_NO_PREALLOC);
|
|
|
0fb47c |
} birth SEC(".maps");
|
|
|
0fb47c |
|
|
|
0fb47c |
-static struct hist hist;
|
|
|
0fb47c |
+struct hist hist = {};
|
|
|
0fb47c |
|
|
|
0fb47c |
SEC("fentry/do_page_cache_ra")
|
|
|
0fb47c |
int BPF_PROG(do_page_cache_ra)
|
|
|
0fb47c |
--
|
|
|
0fb47c |
2.31.1
|
|
|
0fb47c |
|