Skip to content

Commit

Permalink
contrib/bpf_inspect.py: fix BpfProg repr
Browse files Browse the repository at this point in the history
When run drgn on kernel v5.4, there is no `tail_call_reachable`
in `prog-> aux`. Check before retrieving the struct in order to
avoid panic

Signed-off-by: Ze Gao <[email protected]>
  • Loading branch information
zegao96 authored Nov 5, 2024
1 parent 0fff129 commit 952f7a1
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion contrib/bpf_inspect.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,10 @@ def __repr__(self):
id_ = self.prog.aux.id.value_()
type_ = BpfProgType(self.prog.type).name
name = self.get_prog_name()
tail_call_reachable = self.prog.aux.tail_call_reachable.value_()
try:
tail_call_reachable = self.prog.aux.member_("tail_call_reachable").value_()
except LookupError:
tail_call_reachable = None

tail_call_desc = " tail_call_reachable" if tail_call_reachable else ""

Expand Down

0 comments on commit 952f7a1

Please sign in to comment.