Lines Matching +full:local +full:- +full:pid
1 /* SPDX-License-Identifier: GPL-2.0 */
25 struct task_struct *bpf_task_from_pid(s32 pid) __ksym;
31 s32 pid; in tasks_kfunc_map_value_lookup() local
34 status = bpf_probe_read_kernel(&pid, sizeof(pid), &p->pid); in tasks_kfunc_map_value_lookup()
38 return bpf_map_lookup_elem(&__tasks_kfunc_map, &pid); in tasks_kfunc_map_value_lookup()
43 struct __tasks_kfunc_map_value local, *v; in tasks_kfunc_map_insert() local
46 s32 pid; in tasks_kfunc_map_insert() local
48 status = bpf_probe_read_kernel(&pid, sizeof(pid), &p->pid); in tasks_kfunc_map_insert()
52 local.task = NULL; in tasks_kfunc_map_insert()
53 status = bpf_map_update_elem(&__tasks_kfunc_map, &pid, &local, BPF_NOEXIST); in tasks_kfunc_map_insert()
57 v = bpf_map_lookup_elem(&__tasks_kfunc_map, &pid); in tasks_kfunc_map_insert()
59 bpf_map_delete_elem(&__tasks_kfunc_map, &pid); in tasks_kfunc_map_insert()
60 return -ENOENT; in tasks_kfunc_map_insert()
65 return -ENOENT; in tasks_kfunc_map_insert()
67 old = bpf_kptr_xchg(&v->task, acquired); in tasks_kfunc_map_insert()
70 return -EEXIST; in tasks_kfunc_map_insert()