/samples/bpf/ |
D | tracex5_kern.c | 23 int bpf_prog1(struct pt_regs *ctx) in bpf_prog1() argument 25 int sc_nr = (int)PT_REGS_PARM1(ctx); in bpf_prog1() 28 bpf_tail_call(ctx, &progs, sc_nr); in bpf_prog1() 39 PROG(__NR_write)(struct pt_regs *ctx) in PROG() 43 bpf_probe_read(&sd, sizeof(sd), (void *)PT_REGS_PARM2(ctx)); in PROG() 52 PROG(__NR_read)(struct pt_regs *ctx) in PROG() 56 bpf_probe_read(&sd, sizeof(sd), (void *)PT_REGS_PARM2(ctx)); in PROG() 65 PROG(__NR_mmap)(struct pt_regs *ctx) in PROG()
|
D | bpf_helpers.h | 24 static void (*bpf_tail_call)(void *ctx, void *map, int index) = 36 static int (*bpf_clone_redirect)(void *ctx, int ifindex, int flags) = 40 static int (*bpf_perf_event_output)(void *ctx, void *map, 44 static int (*bpf_get_stackid)(void *ctx, void *map, int flags) = 50 static int (*bpf_skb_get_tunnel_key)(void *ctx, void *key, int size, int flags) = 52 static int (*bpf_skb_set_tunnel_key)(void *ctx, void *key, int size, int flags) = 54 static int (*bpf_skb_get_tunnel_opt)(void *ctx, void *md, int size) = 56 static int (*bpf_skb_set_tunnel_opt)(void *ctx, void *md, int size) = 83 static int (*bpf_skb_store_bytes)(void *ctx, int off, void *from, int len, int flags) = 85 static int (*bpf_l3_csum_replace)(void *ctx, int off, int from, int to, int flags) = [all …]
|
D | tracex4_kern.c | 28 int bpf_prog1(struct pt_regs *ctx) in bpf_prog1() argument 30 long ptr = PT_REGS_PARM2(ctx); in bpf_prog1() 37 int bpf_prog2(struct pt_regs *ctx) in bpf_prog2() argument 39 long ptr = PT_REGS_RC(ctx); in bpf_prog2() 43 BPF_KRETPROBE_READ_RET_IP(ip, ctx); in bpf_prog2()
|
D | trace_event_kern.c | 38 int bpf_prog1(struct bpf_perf_event_data *ctx) in bpf_prog1() argument 45 if (ctx->sample_period < 10000) in bpf_prog1() 49 key.kernstack = bpf_get_stackid(ctx, &stackmap, KERN_STACKID_FLAGS); in bpf_prog1() 50 key.userstack = bpf_get_stackid(ctx, &stackmap, USER_STACKID_FLAGS); in bpf_prog1() 52 bpf_trace_printk(fmt, sizeof(fmt), cpu, ctx->sample_period, in bpf_prog1() 53 PT_REGS_IP(&ctx->regs)); in bpf_prog1()
|
D | offwaketime_kern.c | 61 int waker(struct pt_regs *ctx) in waker() argument 63 struct task_struct *p = (void *) PT_REGS_PARM1(ctx); in waker() 70 woke.ret = bpf_get_stackid(ctx, &stackmap, STACKID_FLAGS); in waker() 76 static inline int update_counts(void *ctx, u32 pid, u64 delta) in update_counts() argument 84 key.tret = bpf_get_stackid(ctx, &stackmap, STACKID_FLAGS); in update_counts() 118 int oncpu(struct sched_switch_args *ctx) argument 121 u32 pid = ctx->prev_pid; 124 int oncpu(struct pt_regs *ctx) 126 struct task_struct *p = (void *) PT_REGS_PARM1(ctx); 148 return update_counts(ctx, pid, delta);
|
D | test_overhead_kprobe_kern.c | 15 int prog(struct pt_regs *ctx) in prog() argument 24 tsk = (void *)PT_REGS_PARM1(ctx); in prog() 28 bpf_probe_read(newcomm, sizeof(newcomm), (void *)PT_REGS_PARM2(ctx)); in prog() 35 int prog2(struct pt_regs *ctx) in prog2() argument
|
D | test_probe_write_user_kern.c | 29 int bpf_prog1(struct pt_regs *ctx) in bpf_prog1() argument 33 void *sockaddr_arg = (void *)PT_REGS_PARM2(ctx); in bpf_prog1() 34 int sockaddr_len = (int)PT_REGS_PARM3(ctx); in bpf_prog1()
|
D | tracex3_kern.c | 24 int bpf_prog1(struct pt_regs *ctx) in bpf_prog1() argument 26 long rq = PT_REGS_PARM1(ctx); in bpf_prog1() 52 int bpf_prog2(struct pt_regs *ctx) in bpf_prog2() argument 54 long rq = PT_REGS_PARM1(ctx); in bpf_prog2()
|
D | test_overhead_tp_kern.c | 19 int prog(struct task_rename *ctx) in prog() argument 32 int prog2(struct urandom_read *ctx) in prog2() argument
|
D | tracex2_kern.c | 24 int bpf_prog2(struct pt_regs *ctx) in bpf_prog2() argument 33 BPF_KPROBE_READ_RET_IP(loc, ctx); in bpf_prog2() 80 int bpf_prog3(struct pt_regs *ctx) in bpf_prog3() argument 82 long write_size = PT_REGS_PARM3(ctx); in bpf_prog3()
|
D | map_perf_test_kern.c | 46 int stress_hmap(struct pt_regs *ctx) in stress_hmap() argument 60 int stress_percpu_hmap(struct pt_regs *ctx) in stress_percpu_hmap() argument 73 int stress_hmap_alloc(struct pt_regs *ctx) in stress_hmap_alloc() argument 87 int stress_percpu_hmap_alloc(struct pt_regs *ctx) in stress_percpu_hmap_alloc() argument
|
D | trace_output_kern.c | 14 int bpf_prog1(struct pt_regs *ctx) in bpf_prog1() argument 24 bpf_perf_event_output(ctx, &my_map, 0, &data, sizeof(data)); in bpf_prog1()
|
D | sampleip_kern.c | 23 int do_sample(struct bpf_perf_event_data *ctx) in do_sample() argument 28 ip = PT_REGS_IP(&ctx->regs); in do_sample()
|
D | sockex2_kern.c | 45 static inline int ip_is_fragment(struct __sk_buff *ctx, __u64 nhoff) in ip_is_fragment() argument 47 return load_half(ctx, nhoff + offsetof(struct iphdr, frag_off)) in ip_is_fragment() 51 static inline __u32 ipv6_addr_hash(struct __sk_buff *ctx, __u64 off) in ipv6_addr_hash() argument 53 __u64 w0 = load_word(ctx, off); in ipv6_addr_hash() 54 __u64 w1 = load_word(ctx, off + 4); in ipv6_addr_hash() 55 __u64 w2 = load_word(ctx, off + 8); in ipv6_addr_hash() 56 __u64 w3 = load_word(ctx, off + 12); in ipv6_addr_hash()
|
D | tracex1_kern.c | 21 int bpf_prog1(struct pt_regs *ctx) in bpf_prog1() argument 32 skb = (struct sk_buff *) PT_REGS_PARM1(ctx); in bpf_prog1()
|
D | spintest_kern.c | 35 int foo(struct pt_regs *ctx) \ 37 long v = PT_REGS_IP(ctx), *val; \ 43 bpf_get_stackid(ctx, &stackmap, BPF_F_REUSE_STACKID); \
|
D | parse_ldabs.c | 20 static inline int ip_is_fragment(struct __sk_buff *ctx, __u64 nhoff) in ip_is_fragment() argument 22 return load_half(ctx, nhoff + offsetof(struct iphdr, frag_off)) in ip_is_fragment()
|
D | xdp1_kern.c | 43 int xdp_prog1(struct xdp_md *ctx) in xdp_prog1() argument 45 void *data_end = (void *)(long)ctx->data_end; in xdp_prog1() 46 void *data = (void *)(long)ctx->data; in xdp_prog1()
|
D | sockex3_kern.c | 74 static inline int ip_is_fragment(struct __sk_buff *ctx, __u64 nhoff) in ip_is_fragment() argument 76 return load_half(ctx, nhoff + offsetof(struct iphdr, frag_off)) in ip_is_fragment() 80 static inline __u32 ipv6_addr_hash(struct __sk_buff *ctx, __u64 off) in ipv6_addr_hash() argument 82 __u64 w0 = load_word(ctx, off); in ipv6_addr_hash() 83 __u64 w1 = load_word(ctx, off + 4); in ipv6_addr_hash() 84 __u64 w2 = load_word(ctx, off + 8); in ipv6_addr_hash() 85 __u64 w3 = load_word(ctx, off + 12); in ipv6_addr_hash()
|
D | xdp2_kern.c | 59 int xdp_prog1(struct xdp_md *ctx) in xdp_prog1() argument 61 void *data_end = (void *)(long)ctx->data_end; in xdp_prog1() 62 void *data = (void *)(long)ctx->data; in xdp_prog1()
|
D | lathist_kern.c | 29 int bpf_prog1(struct pt_regs *ctx) in bpf_prog1() argument 72 int bpf_prog2(struct pt_regs *ctx) in bpf_prog2() argument
|
D | tracex6_kern.c | 14 int bpf_prog1(struct pt_regs *ctx) in bpf_prog1() argument
|
D | test_current_task_under_cgroup_kern.c | 30 int bpf_prog1(struct pt_regs *ctx) in bpf_prog1() argument
|
/samples/seccomp/ |
D | bpf-direct.c | 63 ucontext_t *ctx = (ucontext_t *)(void_context); in emulator() local 70 if (!ctx) in emulator() 72 syscall = ctx->uc_mcontext.gregs[REG_SYSCALL]; in emulator() 73 buf = (char *) ctx->uc_mcontext.gregs[REG_ARG1]; in emulator() 74 len = (size_t) ctx->uc_mcontext.gregs[REG_ARG2]; in emulator() 78 if (ctx->uc_mcontext.gregs[REG_ARG0] != STDERR_FILENO) in emulator() 81 ctx->uc_mcontext.gregs[REG_RESULT] = -1; in emulator() 84 ctx->uc_mcontext.gregs[REG_RESULT] = bytes; in emulator()
|