blob: 2ec11f01090d6e38f3afafcb9005ae8d2d761b99 [file] [log] [blame]
Andrew Scullb4b6d4a2019-01-02 15:54:55 +00001/* SPDX-License-Identifier: GPL-2.0 */
2#ifndef __CGROUP_H__
3#define __CGROUP_H__
4
5#include <linux/refcount.h>
6
7struct option;
8
9struct cgroup {
10 char *name;
11 int fd;
12 refcount_t refcnt;
13};
14
15
16extern int nr_cgroups; /* number of explicit cgroups defined */
17
18struct cgroup *cgroup__get(struct cgroup *cgroup);
19void cgroup__put(struct cgroup *cgroup);
20
David Brazdil0f672f62019-12-10 10:32:29 +000021struct evlist;
Andrew Scullb4b6d4a2019-01-02 15:54:55 +000022
David Brazdil0f672f62019-12-10 10:32:29 +000023struct cgroup *evlist__findnew_cgroup(struct evlist *evlist, const char *name);
Andrew Scullb4b6d4a2019-01-02 15:54:55 +000024
David Brazdil0f672f62019-12-10 10:32:29 +000025void evlist__set_default_cgroup(struct evlist *evlist, struct cgroup *cgroup);
Andrew Scullb4b6d4a2019-01-02 15:54:55 +000026
27int parse_cgroups(const struct option *opt, const char *str, int unset);
28
29#endif /* __CGROUP_H__ */