-
Notifications
You must be signed in to change notification settings - Fork 542
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[cgroups] Collect cgroup information per process #3801
[cgroups] Collect cgroup information per process #3801
Conversation
Congratulations! One of the builds has completed. 🍾 You can install the built RPMs by following these steps:
Please note that the RPMs should be used only in a testing environment. |
sos/report/plugins/cgroups.py
Outdated
@@ -26,7 +26,8 @@ def setup(self): | |||
|
|||
self.add_copy_spec([ | |||
"/proc/cgroups", | |||
"/sys/fs/cgroup" | |||
"/sys/fs/cgroup", | |||
"/proc/*/cgroup", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've tested this and it works, but this will go through all subdirs of /proc, and only collects 'cgroup' when it finds it.
We do something similar but more elegantly in the 'process' plugin:
sos/sos/report/plugins/process.py
Lines 52 to 58 in 96e4d79
self.add_copy_spec([ | |
f"/proc/{proc}/status", | |
f"/proc/{proc}/cpuset", | |
f"/proc/{proc}/oom_*", | |
f"/proc/{proc}/stack", | |
f"/proc/{proc}/limits", | |
]) |
So my question is, is my approach good enough, or should I use the one in the process plugin gathering the PID entries with:
procs = [p for p in self.listdir("/proc") if re.match("[0-9]", p)]
Then iterating through them?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/proc/[0-9]*/cgroup
Collect cgroup information for each process Related: sosreport#3799 Signed-off-by: Jose Castillo <[email protected]>
037bc39
to
df79333
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
Collect cgroup information for each process
Related: #3799
Please place an 'X' inside each '[]' to confirm you adhere to our Contributor Guidelines