diff options
author | Jose Castillo <jcastillo@redhat.com> | 2023-11-10 15:21:38 +0000 |
---|---|---|
committer | Jake Hunsaker <jacob.r.hunsaker@gmail.com> | 2024-05-08 14:12:46 -0400 |
commit | 7c22fbdb266bb70f535483a1fce0a683b1af4e39 (patch) | |
tree | 066be544d8cf1fad82865b1a34442a210efa663e | |
parent | 01108d47feed1f37d1b2b49c2fc39c235897c9f9 (diff) | |
download | sos-7c22fbdb266bb70f535483a1fce0a683b1af4e39.tar.gz |
[ebpf] Check for bpftool presence before running plugin
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>
-rw-r--r-- | sos/report/plugins/ebpf.py | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/sos/report/plugins/ebpf.py b/sos/report/plugins/ebpf.py index 6c426933..61598d31 100644 --- a/sos/report/plugins/ebpf.py +++ b/sos/report/plugins/ebpf.py @@ -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, |