tools/perf/util/cgroup.h
Source file repositories/reference/linux-study-clean/tools/perf/util/cgroup.h
File Facts
- System
- Linux kernel
- Corpus path
tools/perf/util/cgroup.h- Extension
.h- Size
- 1553 bytes
- Lines
- 59
- Domain
- Support Tooling And Documentation
- Bucket
- tools
- Inferred role
- Support Tooling And Documentation: implementation source
- Status
- source implementation candidate
Why This File Exists
Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.
- Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/compiler.hlinux/refcount.hlinux/rbtree.hutil/env.h
Detected Declarations
struct optionstruct cgroupstruct evliststruct rblistfunction read_cgroup_id
Annotated Snippet
struct cgroup {
struct rb_node node;
u64 id;
char *name;
int fd;
refcount_t refcnt;
};
extern int nr_cgroups; /* number of explicit cgroups defined */
extern bool cgrp_event_expanded;
struct cgroup *cgroup__get(struct cgroup *cgroup);
void cgroup__put(struct cgroup *cgroup);
struct evlist;
struct rblist;
struct cgroup *cgroup__new(const char *name, bool do_open);
struct cgroup *evlist__findnew_cgroup(struct evlist *evlist, const char *name);
int evlist__expand_cgroup(struct evlist *evlist, const char *cgroups, bool open_cgroup);
void evlist__set_default_cgroup(struct evlist *evlist, struct cgroup *cgroup);
int parse_cgroups(const struct option *opt, const char *str, int unset);
struct cgroup *cgroup__findnew(struct perf_env *env, uint64_t id,
const char *path);
struct cgroup *cgroup__find(struct perf_env *env, uint64_t id);
struct cgroup *__cgroup__find(struct rb_root *root, uint64_t id);
void perf_env__purge_cgroups(struct perf_env *env);
#ifdef HAVE_FILE_HANDLE
int read_cgroup_id(struct cgroup *cgrp);
#else
static inline int read_cgroup_id(struct cgroup *cgrp __maybe_unused)
{
return -1;
}
#endif /* HAVE_FILE_HANDLE */
/* read all cgroups in the system and save them in the rbtree */
void read_all_cgroups(struct rb_root *root);
int cgroup_is_v2(const char *subsys);
#endif /* __CGROUP_H__ */
Annotation
- Immediate include surface: `linux/compiler.h`, `linux/refcount.h`, `linux/rbtree.h`, `util/env.h`.
- Detected declarations: `struct option`, `struct cgroup`, `struct evlist`, `struct rblist`, `function read_cgroup_id`.
- Atlas domain: Support Tooling And Documentation / tools.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.