hc
2024-10-16 50a212ec906f7524620675f0c57357691c26c81f
kernel/samples/bpf/tracex4_kern.c
....@@ -7,19 +7,20 @@
77 #include <linux/ptrace.h>
88 #include <linux/version.h>
99 #include <uapi/linux/bpf.h>
10
-#include "bpf_helpers.h"
10
+#include <bpf/bpf_helpers.h>
11
+#include <bpf/bpf_tracing.h>
1112
1213 struct pair {
1314 u64 val;
1415 u64 ip;
1516 };
1617
17
-struct bpf_map_def SEC("maps") my_map = {
18
- .type = BPF_MAP_TYPE_HASH,
19
- .key_size = sizeof(long),
20
- .value_size = sizeof(struct pair),
21
- .max_entries = 1000000,
22
-};
18
+struct {
19
+ __uint(type, BPF_MAP_TYPE_HASH);
20
+ __type(key, long);
21
+ __type(value, struct pair);
22
+ __uint(max_entries, 1000000);
23
+} my_map SEC(".maps");
2324
2425 /* kprobe is NOT a stable ABI. If kernel internals change this bpf+kprobe
2526 * example will no longer be meaningful