hc
2023-12-11 d2ccde1c8e90d38cee87a1b0309ad2827f3fd30d
kernel/samples/bpf/syscall_tp_kern.c
....@@ -1,11 +1,8 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /* Copyright (c) 2017 Facebook
2
- *
3
- * This program is free software; you can redistribute it and/or
4
- * modify it under the terms of version 2 of the GNU General Public
5
- * License as published by the Free Software Foundation.
63 */
74 #include <uapi/linux/bpf.h>
8
-#include "bpf_helpers.h"
5
+#include <bpf/bpf_helpers.h>
96
107 struct syscalls_enter_open_args {
118 unsigned long long unused;
....@@ -21,19 +18,19 @@
2118 long ret;
2219 };
2320
24
-struct bpf_map_def SEC("maps") enter_open_map = {
25
- .type = BPF_MAP_TYPE_ARRAY,
26
- .key_size = sizeof(u32),
27
- .value_size = sizeof(u32),
28
- .max_entries = 1,
29
-};
21
+struct {
22
+ __uint(type, BPF_MAP_TYPE_ARRAY);
23
+ __type(key, u32);
24
+ __type(value, u32);
25
+ __uint(max_entries, 1);
26
+} enter_open_map SEC(".maps");
3027
31
-struct bpf_map_def SEC("maps") exit_open_map = {
32
- .type = BPF_MAP_TYPE_ARRAY,
33
- .key_size = sizeof(u32),
34
- .value_size = sizeof(u32),
35
- .max_entries = 1,
36
-};
28
+struct {
29
+ __uint(type, BPF_MAP_TYPE_ARRAY);
30
+ __type(key, u32);
31
+ __type(value, u32);
32
+ __uint(max_entries, 1);
33
+} exit_open_map SEC(".maps");
3734
3835 static __always_inline void count(void *map)
3936 {