diff options
author | Jake Hunsaker <jhunsake@redhat.com> | 2022-10-07 10:05:35 -0400 |
---|---|---|
committer | Jake Hunsaker <jhunsake@redhat.com> | 2022-10-10 10:50:06 -0400 |
commit | 48ac7b1383bfa9334d5418a994a5462290460f7a (patch) | |
tree | 810babd305dd0a1638c704850484777a80ca3134 | |
parent | df66405600a498da6a8561c28fff4457899ae8f5 (diff) | |
download | sos-48ac7b1383bfa9334d5418a994a5462290460f7a.tar.gz |
[Plugin] Only collect modinfo for loaded modules
Refines the recent addition of collecting `modinfo` output for kernel
modules specified by a plugin's enablement trigger to only do that
collection for loaded kernel modules.
Signed-off-by: Jake Hunsaker <jhunsake@redhat.com>
-rw-r--r-- | sos/report/plugins/__init__.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sos/report/plugins/__init__.py b/sos/report/plugins/__init__.py index b48909be..76341a04 100644 --- a/sos/report/plugins/__init__.py +++ b/sos/report/plugins/__init__.py @@ -3305,7 +3305,8 @@ class Plugin(): self.add_service_status(service) self.add_journal(service) for kmod in self.kernel_mods: - self.add_cmd_output(f"modinfo {kmod}") + if self.is_module_loaded(kmod): + self.add_cmd_output(f"modinfo {kmod}") def setup(self): """Collect the list of files declared by the plugin. This method |