Blame SOURCES/sos-bz1869561-cpuX-individual-sizelimits.patch

92cd8f
From b09ed75b09075d86c184b0a63cce9260f2cee4ca Mon Sep 17 00:00:00 2001
92cd8f
From: Pavel Moravec <pmoravec@redhat.com>
92cd8f
Date: Mon, 30 Aug 2021 11:27:48 +0200
92cd8f
Subject: [PATCH] [processor] Apply sizelimit to /sys/devices/system/cpu/cpuX
92cd8f
92cd8f
Copy /sys/devices/system/cpu/cpuX with separately applied sizelimit.
92cd8f
92cd8f
This is required for systems with tens/hundreds of CPUs where the
92cd8f
cumulative directory size exceeds 25MB or even 100MB.
92cd8f
92cd8f
Resolves: #2639
92cd8f
Closes: #2665
92cd8f
92cd8f
Signed-off-by: Pavel Moravec <pmoravec@redhat.com>
92cd8f
---
92cd8f
 sos/report/plugins/processor.py | 9 ++++++++-
92cd8f
 1 file changed, 8 insertions(+), 1 deletion(-)
92cd8f
92cd8f
diff --git a/sos/report/plugins/processor.py b/sos/report/plugins/processor.py
92cd8f
index 0ddfd126..2df2dc9a 100644
92cd8f
--- a/sos/report/plugins/processor.py
92cd8f
+++ b/sos/report/plugins/processor.py
92cd8f
@@ -7,6 +7,7 @@
92cd8f
 # See the LICENSE file in the source distribution for further information.
92cd8f
 
92cd8f
 from sos.report.plugins import Plugin, IndependentPlugin
92cd8f
+import os
92cd8f
 
92cd8f
 
92cd8f
 class Processor(Plugin, IndependentPlugin):
92cd8f
@@ -34,7 +35,13 @@ class Processor(Plugin, IndependentPlugin):
92cd8f
         self.add_copy_spec([
92cd8f
             "/proc/cpuinfo",
92cd8f
             "/sys/class/cpuid",
92cd8f
-            "/sys/devices/system/cpu"
92cd8f
+        ])
92cd8f
+        # copy /sys/devices/system/cpu/cpuX with separately applied sizelimit
92cd8f
+        # this is required for systems with tens/hundreds of CPUs where the
92cd8f
+        # cumulative directory size exceeds 25MB or even 100MB.
92cd8f
+        cdirs = self.listdir('/sys/devices/system/cpu')
92cd8f
+        self.add_copy_spec([
92cd8f
+            os.path.join('/sys/devices/system/cpu', cdir) for cdir in cdirs
92cd8f
         ])
92cd8f
 
92cd8f
         self.add_cmd_output([
92cd8f
-- 
92cd8f
2.31.1
92cd8f