aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPavel Moravec <pmoravec@redhat.com>2018-08-09 08:59:53 +0200
committerBryn M. Reeves <bmr@redhat.com>2018-08-10 17:21:37 +0100
commita55680e6c8ac87fdf4ee3100717001c1f6f6a08b (patch)
tree7d03cfd752bc5a194375b62b0bc4a7bb4d33002e
parentbc650cd161548159e551ddc201596bf19b1865d0 (diff)
downloadsos-a55680e6c8ac87fdf4ee3100717001c1f6f6a08b.tar.gz
[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 <pmoravec@redhat.com>
-rw-r--r--sos/plugins/process.py6
1 files 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([