Home
last modified time | relevance | path

Searched refs:ctx (Results 1 – 24 of 24) sorted by relevance

/samples/bpf/
Dtracex5_kern.c23 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()
Dbpf_helpers.h24 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 …]
Dtracex4_kern.c28 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()
Dtrace_event_kern.c38 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()
Doffwaketime_kern.c61 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);
Dtest_overhead_kprobe_kern.c15 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
Dtest_probe_write_user_kern.c29 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()
Dtracex3_kern.c24 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()
Dtest_overhead_tp_kern.c19 int prog(struct task_rename *ctx) in prog() argument
32 int prog2(struct urandom_read *ctx) in prog2() argument
Dtracex2_kern.c24 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()
Dmap_perf_test_kern.c46 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
Dtrace_output_kern.c14 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()
Dsampleip_kern.c23 int do_sample(struct bpf_perf_event_data *ctx) in do_sample() argument
28 ip = PT_REGS_IP(&ctx->regs); in do_sample()
Dsockex2_kern.c45 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()
Dtracex1_kern.c21 int bpf_prog1(struct pt_regs *ctx) in bpf_prog1() argument
32 skb = (struct sk_buff *) PT_REGS_PARM1(ctx); in bpf_prog1()
Dspintest_kern.c35 int foo(struct pt_regs *ctx) \
37 long v = PT_REGS_IP(ctx), *val; \
43 bpf_get_stackid(ctx, &stackmap, BPF_F_REUSE_STACKID); \
Dparse_ldabs.c20 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()
Dxdp1_kern.c43 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()
Dsockex3_kern.c74 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()
Dxdp2_kern.c59 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()
Dlathist_kern.c29 int bpf_prog1(struct pt_regs *ctx) in bpf_prog1() argument
72 int bpf_prog2(struct pt_regs *ctx) in bpf_prog2() argument
Dtracex6_kern.c14 int bpf_prog1(struct pt_regs *ctx) in bpf_prog1() argument
Dtest_current_task_under_cgroup_kern.c30 int bpf_prog1(struct pt_regs *ctx) in bpf_prog1() argument
/samples/seccomp/
Dbpf-direct.c63 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()