From 593feb9ac29fe669d01aa034b0978debd3783837 Mon Sep 17 00:00:00 2001 From: Leon Hwang Date: Fri, 6 Dec 2024 21:17:26 +0800 Subject: [PATCH] bpflbr: Ignore ErrKeyNotExist when lookup func_stacks map It is weird that fails to lookup `func_stacks` map, as the `func_stack_id` is prepared by bpf prog. Signed-off-by: Leon Hwang --- internal/bpflbr/lbr.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/internal/bpflbr/lbr.go b/internal/bpflbr/lbr.go index b297b11..029bedb 100644 --- a/internal/bpflbr/lbr.go +++ b/internal/bpflbr/lbr.go @@ -215,6 +215,9 @@ func getFuncStack(event *Event, progs *bpfProgs, addr2line *Addr2Line, ksym *Kal var data FuncStack err := funcStacks.Lookup(id, &data) if err != nil { + if errors.Is(err, ebpf.ErrKeyNotExist) { + return stack, nil + } return stack, fmt.Errorf("failed to lookup func stack map: %w", err) } _ = funcStacks.Delete(id)