Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

at v5.8-rc3 42 lines 713 B view raw
1// SPDX-License-Identifier: GPL-2.0 2// Copyright (c) 2017 Facebook 3 4#include <linux/ptrace.h> 5#include <linux/bpf.h> 6#include <bpf/bpf_helpers.h> 7#include <bpf/bpf_tracing.h> 8 9int kprobe_res = 0; 10int kretprobe_res = 0; 11int uprobe_res = 0; 12int uretprobe_res = 0; 13 14SEC("kprobe/sys_nanosleep") 15int handle_kprobe(struct pt_regs *ctx) 16{ 17 kprobe_res = 1; 18 return 0; 19} 20 21SEC("kretprobe/sys_nanosleep") 22int BPF_KRETPROBE(handle_kretprobe) 23{ 24 kretprobe_res = 2; 25 return 0; 26} 27 28SEC("uprobe/trigger_func") 29int handle_uprobe(struct pt_regs *ctx) 30{ 31 uprobe_res = 3; 32 return 0; 33} 34 35SEC("uretprobe/trigger_func") 36int handle_uretprobe(struct pt_regs *ctx) 37{ 38 uretprobe_res = 4; 39 return 0; 40} 41 42char _license[] SEC("license") = "GPL";