Thread (22 messages) flat view 22 messages, 5 authors, 2019-10-29

Re: [PATCH bpf-next v3 4/4] selftests: Add tests for automatic map pinning

From: Yonghong Song <hidden>
Date: 2019-10-28 15:32:54
Also in: bpf


On 10/28/19 6:15 AM, Toke Høiland-Jørgensen wrote:
Jesper Dangaard Brouer [off-list ref] writes:
quoted
On Sun, 27 Oct 2019 21:53:19 +0100
Toke Høiland-Jørgensen [off-list ref] wrote:
quoted
diff --git a/tools/testing/selftests/bpf/progs/test_pinning.c b/tools/testing/selftests/bpf/progs/test_pinning.c
new file mode 100644
index 000000000000..ff2d7447777e
--- /dev/null
+++ b/tools/testing/selftests/bpf/progs/test_pinning.c
@@ -0,0 +1,29 @@
+// SPDX-License-Identifier: GPL-2.0
+
+#include <linux/bpf.h>
+#include "bpf_helpers.h"
+
+int _version SEC("version") = 1;
+
+struct {
+	__uint(type, BPF_MAP_TYPE_ARRAY);
+	__uint(max_entries, 1);
+	__type(key, __u32);
+	__type(value, __u64);
+	__uint(pinning, LIBBPF_PIN_BY_NAME);
+} pinmap SEC(".maps");
So, this is the new BTF-defined maps syntax.

Please remind me, what version of LLVM do we need to compile this?
No idea what the minimum version is. I'm running LLVM 9.0 :)
LLVM 9.0 starts to support .maps.
There is no dependency on pahole.
quoted
Or was there a dependency on pahole?
Don't think so...

-Toke
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help