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

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