2017-11-01 15:07:57 +01:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0 */
|
2011-02-14 11:20:01 +02:00
|
|
|
#ifndef __CGROUP_H__
|
|
|
|
|
#define __CGROUP_H__
|
|
|
|
|
|
2017-02-21 17:34:55 +02:00
|
|
|
#include <linux/refcount.h>
|
2015-05-15 16:12:20 -03:00
|
|
|
|
2011-02-14 11:20:01 +02:00
|
|
|
struct option;
|
|
|
|
|
|
2018-03-06 09:51:48 -03:00
|
|
|
struct cgroup {
|
2011-02-14 11:20:01 +02:00
|
|
|
char *name;
|
|
|
|
|
int fd;
|
2017-02-21 17:34:55 +02:00
|
|
|
refcount_t refcnt;
|
2011-02-14 11:20:01 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
extern int nr_cgroups; /* number of explicit cgroups defined */
|
2018-03-06 10:10:45 -03:00
|
|
|
|
2018-03-06 10:18:40 -03:00
|
|
|
struct cgroup *cgroup__get(struct cgroup *cgroup);
|
2018-03-06 10:10:45 -03:00
|
|
|
void cgroup__put(struct cgroup *cgroup);
|
2018-03-06 09:51:48 -03:00
|
|
|
|
2018-03-06 15:27:08 -03:00
|
|
|
struct perf_evlist;
|
|
|
|
|
|
2018-03-06 15:53:22 -03:00
|
|
|
struct cgroup *evlist__findnew_cgroup(struct perf_evlist *evlist, const char *name);
|
2018-03-06 15:27:08 -03:00
|
|
|
|
2018-03-06 15:48:10 -03:00
|
|
|
void evlist__set_default_cgroup(struct perf_evlist *evlist, struct cgroup *cgroup);
|
|
|
|
|
|
2016-03-23 15:06:35 -03:00
|
|
|
int parse_cgroups(const struct option *opt, const char *str, int unset);
|
2011-02-14 11:20:01 +02:00
|
|
|
|
|
|
|
|
#endif /* __CGROUP_H__ */
|