hc
2024-05-10 37f49e37ab4cb5d0bc4c60eb5c6d4dd57db767bb
kernel/tools/perf/util/cgroup.h
....@@ -3,27 +3,39 @@
33 #define __CGROUP_H__
44
55 #include <linux/refcount.h>
6
+#include <linux/rbtree.h>
7
+#include "util/env.h"
68
79 struct option;
810
911 struct cgroup {
10
- char *name;
11
- int fd;
12
- refcount_t refcnt;
12
+ struct rb_node node;
13
+ u64 id;
14
+ char *name;
15
+ int fd;
16
+ refcount_t refcnt;
1317 };
14
-
1518
1619 extern int nr_cgroups; /* number of explicit cgroups defined */
1720
1821 struct cgroup *cgroup__get(struct cgroup *cgroup);
1922 void cgroup__put(struct cgroup *cgroup);
2023
21
-struct perf_evlist;
24
+struct evlist;
25
+struct rblist;
2226
23
-struct cgroup *evlist__findnew_cgroup(struct perf_evlist *evlist, const char *name);
27
+struct cgroup *evlist__findnew_cgroup(struct evlist *evlist, const char *name);
28
+int evlist__expand_cgroup(struct evlist *evlist, const char *cgroups,
29
+ struct rblist *metric_events, bool open_cgroup);
2430
25
-void evlist__set_default_cgroup(struct perf_evlist *evlist, struct cgroup *cgroup);
31
+void evlist__set_default_cgroup(struct evlist *evlist, struct cgroup *cgroup);
2632
2733 int parse_cgroups(const struct option *opt, const char *str, int unset);
2834
35
+struct cgroup *cgroup__findnew(struct perf_env *env, uint64_t id,
36
+ const char *path);
37
+struct cgroup *cgroup__find(struct perf_env *env, uint64_t id);
38
+
39
+void perf_env__purge_cgroups(struct perf_env *env);
40
+
2941 #endif /* __CGROUP_H__ */