Merge tag 'block-5.9-2020-08-14' of git://git.kernel.dk/linux-block
[linux/fpc-iii.git] / tools / perf / util / cgroup.h
blobe98d5975fe550d944f82e4df272416fb6bedeaf7
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef __CGROUP_H__
3 #define __CGROUP_H__
5 #include <linux/refcount.h>
6 #include <linux/rbtree.h>
7 #include "util/env.h"
9 struct option;
11 struct cgroup {
12 struct rb_node node;
13 u64 id;
14 char *name;
15 int fd;
16 refcount_t refcnt;
19 extern int nr_cgroups; /* number of explicit cgroups defined */
21 struct cgroup *cgroup__get(struct cgroup *cgroup);
22 void cgroup__put(struct cgroup *cgroup);
24 struct evlist;
26 struct cgroup *evlist__findnew_cgroup(struct evlist *evlist, const char *name);
28 void evlist__set_default_cgroup(struct evlist *evlist, struct cgroup *cgroup);
30 int parse_cgroups(const struct option *opt, const char *str, int unset);
32 struct cgroup *cgroup__findnew(struct perf_env *env, uint64_t id,
33 const char *path);
34 struct cgroup *cgroup__find(struct perf_env *env, uint64_t id);
36 void perf_env__purge_cgroups(struct perf_env *env);
38 #endif /* __CGROUP_H__ */