0f004b
From 55949fb88c492eec542c69157a8763ddb3555345 Mon Sep 17 00:00:00 2001
0f004b
From: MIZUTA Takeshi <mizuta.takeshi@fujitsu.com>
0f004b
Date: Thu, 6 Jun 2019 18:42:40 +0900
0f004b
Subject: [PATCH] [plugins] Change forbidden_path from partial-match to
0f004b
 exact-match
0f004b
0f004b
forbidden_path is evaluated on partial-match.
0f004b
However, it will be correct to evaluate on exact-match.
0f004b
0f004b
Closes: #1692
0f004b
Resolves: #1695
0f004b
0f004b
Signed-off-by: MIZUTA Takeshi <mizuta.takeshi@fujitsu.com>
0f004b
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
0f004b
---
0f004b
 sos/plugins/__init__.py | 2 +-
0f004b
 1 file changed, 1 insertion(+), 1 deletion(-)
0f004b
0f004b
diff --git a/sos/plugins/__init__.py b/sos/plugins/__init__.py
0f004b
index 56af847a..41f4f58c 100644
0f004b
--- a/sos/plugins/__init__.py
0f004b
+++ b/sos/plugins/__init__.py
0f004b
@@ -64,7 +64,7 @@ def _mangle_command(command, name_max):
0f004b
 
0f004b
 
0f004b
 def _path_in_path_list(path, path_list):
0f004b
-    return any(p in path for p in path_list)
0f004b
+    return any(p == path for p in path_list)
0f004b
 
0f004b
 
0f004b
 def _node_type(st):
0f004b
-- 
0f004b
2.21.0
0f004b
0f004b
From d2d5b9da6d4af7ead8a47468db0bbfcc8fb2b5bf Mon Sep 17 00:00:00 2001
0f004b
From: Pavel Moravec <pmoravec@redhat.com>
0f004b
Date: Thu, 26 Sep 2019 10:50:18 +0200
0f004b
Subject: [PATCH] [kernel] Don't collect trace file by default
0f004b
0f004b
Updates the plugin to don't collect trace file by default. Collecting
0f004b
trace file may take a lot of time, so trace file is not collected
0f004b
by default, and use the new plug-in option when collecting.
0f004b
0f004b
Original author: MIZUTA Takeshi <mizuta.takeshi@fujitsu.com>
0f004b
0f004b
Closes: #1688
0f004b
Resolves: #1800
0f004b
0f004b
Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
0f004b
Signed-off-by: Bryn M. Reeves <bmr@redhat.com>
0f004b
---
0f004b
 sos/plugins/kernel.py | 6 +++++-
0f004b
 1 file changed, 5 insertions(+), 1 deletion(-)
0f004b
0f004b
diff --git a/sos/plugins/kernel.py b/sos/plugins/kernel.py
0f004b
index bf3c3dea..b498f55e 100644
0f004b
--- a/sos/plugins/kernel.py
0f004b
+++ b/sos/plugins/kernel.py
0f004b
@@ -23,7 +23,8 @@ class Kernel(Plugin, RedHatPlugin, DebianPlugin, UbuntuPlugin):
0f004b
     sys_module = '/sys/module'
0f004b
 
0f004b
     option_list = [
0f004b
-        ("with-timer", "gather /proc/timer* statistics", "slow", False)
0f004b
+        ("with-timer", "gather /proc/timer* statistics", "slow", False),
0f004b
+        ("trace", "gather /sys/kernel/debug/tracing/trace file", "slow", False)
0f004b
     ]
0f004b
 
0f004b
     def get_bpftool_prog_ids(self, prog_file):
0f004b
@@ -139,6 +139,9 @@ class Kernel(Plugin, RedHatPlugin, Debia
0f004b
             # and may also cause softlockups
0f004b
             self.add_copy_spec("/proc/timer*")
0f004b
 
0f004b
+        if not self.get_option("trace"):
0f004b
+            self.add_forbidden_path("/sys/kernel/debug/tracing/trace")
0f004b
+
0f004b
         # collect list of eBPF programs and maps and their dumps
0f004b
         prog_file = self.get_cmd_output_now("bpftool -j prog list")
0f004b
         for prog_id in self.get_bpftool_prog_ids(prog_file):
0f004b
-- 
0f004b
2.21.0
0f004b