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