Skip to content

Commit

Permalink
bpflbr: Ignore ErrKeyNotExist when lookup func_stacks map
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
Asphaltt committed Dec 6, 2024
1 parent 6720f2b commit 593feb9
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions internal/bpflbr/lbr.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 593feb9

Please sign in to comment.