1 // SPDX-License-Identifier: GPL-2.0
2 /* Copyright (c) 2020 Tessares SA <http://www.tessares.net> */
5 #include <bpf/bpf_helpers.h>
12 __uint(type
, BPF_MAP_TYPE_PERCPU_HASH
);
13 __uint(max_entries
, 2);
16 } hashmap1
SEC(".maps");
19 SEC("tp/syscalls/sys_enter_getpgid")
20 int sysenter_getpgid(const void *ctx
)
22 /* Just do it for once, when called from our own test prog. This
23 * ensures the map value is only updated for a single CPU.
25 int cur_pid
= bpf_get_current_pid_tgid() >> 32;
28 bpf_map_update_elem(&hashmap1
, &inKey
, &inValue
, BPF_NOEXIST
);
33 char _license
[] SEC("license") = "GPL";