Skip to content

Unclear Documentation on Attaching eBPF Programs to Specific cgroups #115

Closed
@jetlime

Description

@jetlime

While reading the documentation on cgroup eBPF program types, I found it unclear how to attach a program to a specific cgroup. The provided examples always demonstrate attaching to a generic cgroup hook, without specifying which cgroup the program is actually attached to.

For instance, in the example for attaching an eBPF program of type CGROUP_SOCK, the SEC macro defines the program like this:

SEC("cgroup/sock_create")

However, it's unclear whether "cgroup" here refers to the type of eBPF program attachment (such as 'lsm' for LSM eBPF programs) or to the root cgroup of the system (/sys/fs/cgroup/). There is no explanation on how to target specific cgroups beyond the root.

I suggest to add at the root of the folder (https://docs.ebpf.io/linux/program-type/), in the cGroup program types section, a detailed examples on how to attach eBPF programs to cgroups other than the root.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions