1 // SPDX-License-Identifier: GPL-2.0
2 /* Copyright (C) 2022. Huawei Technologies Co., Ltd */
4 #include <bpf/bpf_helpers.h>
5 #include <bpf/bpf_tracing.h>
7 char _license[] SEC("license") = "GPL";
10 __uint(type, BPF_MAP_TYPE_HASH);
11 __uint(max_entries, 1);
12 __uint(key_size, sizeof(__u32));
13 __uint(value_size, sizeof(__u32));
19 SEC("?fentry/lookup_elem_raw")
20 int lookup_elem_raw(void *ctx)
22 __u32 key = 0, value = 1;
24 if ((bpf_get_current_pid_tgid() >> 32) != pid)
27 update_err = bpf_map_update_elem(&htab, &key, &value, 0);