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 <jcastillo@redhat.com>
  • Loading branch information
jcastill authored and TurboTurtle committed May 8, 2024
1 parent 01108d4 commit 7c22fbd
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions sos/report/plugins/ebpf.py
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 7c22fbd

Please sign in to comment.