From a55680e6c8ac87fdf4ee3100717001c1f6f6a08b Mon Sep 17 00:00:00 2001 From: Pavel Moravec Date: Thu, 9 Aug 2018 08:59:53 +0200 Subject: [process] make lsof execution optional Make calling of lsof command optional (but enabled by default). Also remove "collect lsof-threads when --all-logs" as all-logs has nothing in common. Resolves: #1394 Signed-off-by: Pavel Moravec --- sos/plugins/process.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sos/plugins/process.py b/sos/plugins/process.py index 755eec8d..d1c455a5 100644 --- a/sos/plugins/process.py +++ b/sos/plugins/process.py @@ -17,6 +17,7 @@ class Process(Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin): profiles = ('system',) option_list = [ + ("lsof", "gathers information on all open files", "slow", True), ("lsof-threads", "gathers threads' open file info if supported", "slow", False) ] @@ -35,9 +36,10 @@ class Process(Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin): self.add_cmd_output("ps auxwww", root_symlink="ps") self.add_cmd_output("pstree", root_symlink="pstree") - self.add_cmd_output("lsof -b +M -n -l -c ''", root_symlink="lsof") + if self.get_option("lsof"): + self.add_cmd_output("lsof -b +M -n -l -c ''", root_symlink="lsof") - if self.get_option("lsof-threads") or self.get_option("all_logs"): + if self.get_option("lsof-threads"): self.add_cmd_output("lsof -b +M -n -l") self.add_cmd_output([ -- cgit