Skip to content
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

bugtool: add memory related information #2880

Merged
merged 4 commits into from
Sep 9, 2024
Merged

Conversation

mtardy
Copy link
Member

@mtardy mtardy commented Sep 6, 2024

Add memory-related information to bugtool.

Tetragon PID will be used to retrieve memory stats using cgroup fs and
thus the proc fs.

Signed-off-by: Mahe Tardy <mahe.tardy@gmail.com>
pmap(1) is an utility that reads /proc/pid/smaps in a nicely format.
This is the proper way of retrieving accurate memory usage per segment
of a Linux process via /proc.

Signed-off-by: Mahe Tardy <mahe.tardy@gmail.com>
We could also use CopyN using fileSrcInfo.Size() but it would silently
copy empty files in the case of cgroup fs for example. Let's just
display an error so that we can see what failed.

Signed-off-by: Mahe Tardy <mahe.tardy@gmail.com>
Retrieve the memory cgroup and copy memory stat files. Some of these
stats should be found in the metrics.

Signed-off-by: Mahe Tardy <mahe.tardy@gmail.com>
@mtardy mtardy added the release-note/misc This PR makes changes that have no direct user impact. label Sep 6, 2024
@mtardy mtardy requested a review from a team as a code owner September 6, 2024 09:00
@mtardy mtardy requested a review from kevsecurity September 6, 2024 09:00
@mtardy mtardy merged commit 94022ca into main Sep 9, 2024
41 checks passed
@mtardy mtardy deleted the pr/mtardy/memory-bugtool branch September 9, 2024 10:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-note/misc This PR makes changes that have no direct user impact.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants