From c84a6a92ca2e8eaf95056ed0ce7aed705f0d284e Mon Sep 17 00:00:00 2001 From: Gray Liang Date: Thu, 28 Mar 2024 16:09:06 +0800 Subject: [PATCH] bpf/trace: use bpf_get_func_ip() instead of ctx->ip --- trace/kern/trace.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/trace/kern/trace.c b/trace/kern/trace.c index bff1d337d..611074f29 100644 --- a/trace/kern/trace.c +++ b/trace/kern/trace.c @@ -132,7 +132,7 @@ filter_l3_and_l4(struct sk_buff *skb) static __always_inline void set_meta(struct meta *meta, struct sk_buff *skb, struct pt_regs *ctx) { - meta->pc = BPF_CORE_READ(ctx, ip); + meta->pc = bpf_get_func_ip(ctx); meta->skb = (__u64)skb; meta->second_param = PT_REGS_PARM2(ctx); meta->mark = BPF_CORE_READ(skb, mark);