cgroup.h 625 B

123456789101112131415161718192021222324252627282930
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #ifndef __CGROUP_H__
  3. #define __CGROUP_H__
  4. #include <linux/refcount.h>
  5. struct option;
  6. struct cgroup {
  7. char *name;
  8. int fd;
  9. refcount_t refcnt;
  10. };
  11. extern int nr_cgroups; /* number of explicit cgroups defined */
  12. struct cgroup *cgroup__get(struct cgroup *cgroup);
  13. void cgroup__put(struct cgroup *cgroup);
  14. struct evlist;
  15. struct cgroup *evlist__findnew_cgroup(struct evlist *evlist, const char *name);
  16. void evlist__set_default_cgroup(struct evlist *evlist, struct cgroup *cgroup);
  17. int parse_cgroups(const struct option *opt, const char *str, int unset);
  18. #endif /* __CGROUP_H__ */