File Index
Files and directories
Sign in
FILE

livepatch_trampoline.c

File preview with syntax highlighting.

linux-6.19.14/tools/testing/selftests/bpf/progs/livepatch_trampoline.c C
 1// SPDX-License-Identifier: GPL-2.0
 2/* Copyright (c) 2025 Meta Platforms, Inc. and affiliates. */
 3
 4#include <linux/bpf.h>
 5#include <bpf/bpf_helpers.h>
 6#include <bpf/bpf_tracing.h>
 7
 8int fentry_hit;
 9int fexit_hit;
10int my_pid;
11
12SEC("fentry/cmdline_proc_show")
13int BPF_PROG(fentry_cmdline)
14{
15	if (my_pid != (bpf_get_current_pid_tgid() >> 32))
16		return 0;
17
18	fentry_hit = 1;
19	return 0;
20}
21
22SEC("fexit/cmdline_proc_show")
23int BPF_PROG(fexit_cmdline)
24{
25	if (my_pid != (bpf_get_current_pid_tgid() >> 32))
26		return 0;
27
28	fexit_hit = 1;
29	return 0;
30}
~/ Read-only file preview.