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 extern bool CONFIG_PREEMPT __kconfig __weak;
8 extern const int bpf_task_storage_busy __ksym;
10 char _license[] SEC("license") = "GPL";
16 __uint(type, BPF_MAP_TYPE_TASK_STORAGE);
17 __uint(map_flags, BPF_F_NO_PREALLOC);
22 SEC("raw_tp/sys_enter")
23 int BPF_PROG(read_bpf_task_storage_busy)
30 if (bpf_get_current_pid_tgid() >> 32 != pid)
33 value = bpf_this_cpu_ptr(&bpf_task_storage_busy);