processes: add cgroup_path column on Linux#7728
Merged
directionless merged 5 commits intoosquery:masterfrom Aug 17, 2022
Merged
processes: add cgroup_path column on Linux#7728directionless merged 5 commits intoosquery:masterfrom
cgroup_path column on Linux#7728directionless merged 5 commits intoosquery:masterfrom
Conversation
alessandrogario
requested changes
Aug 13, 2022
Member
alessandrogario
left a comment
There was a problem hiding this comment.
This is a great feature, and will make the processes table incredibly useful for hosts with running containers!
cgroup_path column on Linux
Contributor
Author
|
Okay, I added some unit tests tests and cleaned up |
alessandrogario
requested changes
Aug 15, 2022
66adf5f to
3c60f45
Compare
Contributor
Author
|
My latest patch should remove the time penalty if cgroup is not used but build seems to be failing. I can't pinpoint the exact bug and I seem to not have permission to rerun |
alessandrogario
approved these changes
Aug 17, 2022
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This will read the full cgroup path out of /proc for each process in the process table. I've tested this with cgroup v2 (unified hierarchies) but have not yet tested it with cgroup v1 (where each group type has a separate hierarchy). On cgroup v1 it should report the first cgroup it's in but that may not be consistently the same type. Proper cgroup v1 support would require a different schema as each process can be in 13 different hierarchies.
This does involve several string copies but I couldn't find a clean way of doing it with fewer.