// SPDX-License-Identifier: GPL-2.0 #include #include struct { __uint(type, BPF_MAP_TYPE_PROG_ARRAY); __uint(max_entries, 2); __type(key, __u32); __type(value, __u32); } jmp_table SEC(".maps"); __u64 sink; SEC("raw_tracepoint/sched_switch") int caller(void *ctx) /* max_ctx_offset = 0 */ { bpf_tail_call(ctx, &jmp_table, 0); return 0; } SEC("raw_tracepoint/sched_switch") int mid(void *ctx) /* max_ctx_offset = 0 */ { bpf_tail_call(ctx, &jmp_table, 1); return 0; } SEC("raw_tracepoint/sched_switch") int target(void *ctx) /* max_ctx_offset = 96 */ { __u64 *a = ctx; #pragma clang loop unroll(full) for (int i = 0; i < 12; i++) sink += a[i]; return 0; } char LICENSE[] SEC("license") = "GPL";