Skip to content

Commit

Permalink
[ebpf] Check for bpftool presence before running plugin
Browse files Browse the repository at this point in the history
The plugin was running even when the bpftool was
not present, throwing an exception when it tried to parse
a json output:

INFO: [plugin:ebpf] Could not parse bpftool prog list as
JSON: Expecting value: line 1 column 1 (char 0)

It now checks if the program is present before running
any command at all.

Related: RH SUPDEV-151

Signed-off-by: Jose Castillo <[email protected]>
  • Loading branch information
jcastill committed Nov 10, 2023
1 parent 52c9237 commit 64977c0
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions sos/report/plugins/ebpf.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ class Ebpf(Plugin, IndependentPlugin):
short_desc = 'eBPF tool'
plugin_name = 'ebpf'
profiles = ('system', 'kernel', 'network')
commands = ('bpftool',)

option_list = [
PluginOpt("namespaces", default=None, val_type=int,
Expand Down

0 comments on commit 64977c0

Please sign in to comment.