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

Cgroup scripts #423

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Cgroup scripts #423

wants to merge 3 commits into from

Conversation

Werkov
Copy link

@Werkov Werkov commented Aug 7, 2024

This is based on discussion around cgroup.stat and as an exercise with drgn, I'm sharing it in the case anyone found that useful.
There is also a little change outside of contrib/.

BTW How is that with drgn and RCU protected data? Is it simply neglected and one should be ready for transient issues when dereferencing gone data (that's actually not specific to RCU) when debugging a running system?

Copy link
Owner

@osandov osandov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great, thank you. I have one question about the helper change.

drgn/helpers/linux/cgroup.py Outdated Show resolved Hide resolved
Current implementation iterates only online csses.
a) This diverges from the equivalent kernel functions that do include
   offlined csses
b) Debugger on live system cannot ensure that an online object remains
   such during further processing.

Convert known callers to do online filtering themselves to keep their
semantics (this is still racy wrt cgroup removal/subsys disabling as the
original code).

Signed-off-by: Michal Koutný <[email protected]>

Revert "helpers/cgroup: Allow iteration of offlined css too"

use kernel-like interface instead
This reverts commit 99a344c.
Prepare for additional operations on cgroups. This rework breaks
previously accepted order of arguments '<cgroup> bpf' and requires
specifying the intended command. (No cgroups fall back to root cgrp.)

Signed-off-by: Michal Koutný <[email protected]>
Print information about cgroup_subsys_state counts associated with given
cgroup. The main purpose is to show subsys structs in offline state on
cgroup v2.

Signed-off-by: Michal Koutný <[email protected]>
@Werkov
Copy link
Author

Werkov commented Nov 8, 2024

Force pushed a change addressing the review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants