1 // SPDX-License-Identifier: GPL-2.0
2 /* Copyright (c) 2023 Meta Platforms, Inc. and affiliates. */
5 #include <bpf/bpf_tracing.h>
6 #include <bpf/bpf_helpers.h>
9 #include "nested_trust_common.h"
11 char _license[] SEC("license") = "GPL";
14 __uint(type, BPF_MAP_TYPE_SK_STORAGE);
15 __uint(map_flags, BPF_F_NO_PREALLOC);
18 } sk_storage_map SEC(".maps");
20 SEC("tp_btf/task_newtask")
22 int BPF_PROG(test_read_cpumask, struct task_struct *task, u64 clone_flags)
24 bpf_cpumask_test_cpu(0, task->cpus_ptr);
28 SEC("tp_btf/tcp_probe")
30 int BPF_PROG(test_skb_field, struct sock *sk, struct sk_buff *skb)
32 bpf_sk_storage_get(&sk_storage_map, skb->sk, 0, 0);