Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
| 2 | #ifndef __CGROUP_H__ |
| 3 | #define __CGROUP_H__ |
| 4 | |
| 5 | #include <linux/refcount.h> |
| 6 | |
| 7 | struct option; |
| 8 | |
| 9 | struct cgroup { |
| 10 | char *name; |
| 11 | int fd; |
| 12 | refcount_t refcnt; |
| 13 | }; |
| 14 | |
| 15 | |
| 16 | extern int nr_cgroups; /* number of explicit cgroups defined */ |
| 17 | |
| 18 | struct cgroup *cgroup__get(struct cgroup *cgroup); |
| 19 | void cgroup__put(struct cgroup *cgroup); |
| 20 | |
David Brazdil | 0f672f6 | 2019-12-10 10:32:29 +0000 | [diff] [blame^] | 21 | struct evlist; |
Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 22 | |
David Brazdil | 0f672f6 | 2019-12-10 10:32:29 +0000 | [diff] [blame^] | 23 | struct cgroup *evlist__findnew_cgroup(struct evlist *evlist, const char *name); |
Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 24 | |
David Brazdil | 0f672f6 | 2019-12-10 10:32:29 +0000 | [diff] [blame^] | 25 | void evlist__set_default_cgroup(struct evlist *evlist, struct cgroup *cgroup); |
Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 26 | |
| 27 | int parse_cgroups(const struct option *opt, const char *str, int unset); |
| 28 | |
| 29 | #endif /* __CGROUP_H__ */ |