1 /* SPDX-License-Identifier: GPL-2.0 */
5 #include <linux/compiler.h>
6 #include <linux/refcount.h>
7 #include <linux/rbtree.h>
20 extern int nr_cgroups; /* number of explicit cgroups defined */
22 struct cgroup *cgroup__get(struct cgroup *cgroup);
23 void cgroup__put(struct cgroup *cgroup);
28 struct cgroup *evlist__findnew_cgroup(struct evlist *evlist, const char *name);
29 int evlist__expand_cgroup(struct evlist *evlist, const char *cgroups,
30 struct rblist *metric_events, bool open_cgroup);
32 void evlist__set_default_cgroup(struct evlist *evlist, struct cgroup *cgroup);
34 int parse_cgroups(const struct option *opt, const char *str, int unset);
36 struct cgroup *cgroup__findnew(struct perf_env *env, uint64_t id,
38 struct cgroup *cgroup__find(struct perf_env *env, uint64_t id);
40 void perf_env__purge_cgroups(struct perf_env *env);
42 #ifdef HAVE_FILE_HANDLE
43 int read_cgroup_id(struct cgroup *cgrp);
45 static inline int read_cgroup_id(struct cgroup *cgrp __maybe_unused)
49 #endif /* HAVE_FILE_HANDLE */
51 int cgroup_is_v2(const char *subsys);
53 #endif /* __CGROUP_H__ */