summaryrefslogtreecommitdiff
path: root/samples/bpf/sampleip_kern.c
diff options
context:
space:
mode:
Diffstat (limited to 'samples/bpf/sampleip_kern.c')
-rw-r--r--samples/bpf/sampleip_kern.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/samples/bpf/sampleip_kern.c b/samples/bpf/sampleip_kern.c
index 774a681f374a..ceabf31079cf 100644
--- a/samples/bpf/sampleip_kern.c
+++ b/samples/bpf/sampleip_kern.c
@@ -25,7 +25,7 @@ int do_sample(struct bpf_perf_event_data *ctx)
u64 ip;
u32 *value, init_val = 1;
- ip = ctx->regs.ip;
+ ip = PT_REGS_IP(&ctx->regs);
value = bpf_map_lookup_elem(&ip_map, &ip);
if (value)
*value += 1;