Linux Perf
cgroup.h
Go to the documentation of this file.
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 
21 struct perf_evlist;
22 
23 struct cgroup *evlist__findnew_cgroup(struct perf_evlist *evlist, const char *name);
24 
25 void evlist__set_default_cgroup(struct perf_evlist *evlist, struct cgroup *cgroup);
26 
27 int parse_cgroups(const struct option *opt, const char *str, int unset);
28 
29 #endif /* __CGROUP_H__ */
refcount_t refcnt
Definition: cgroup.h:12
struct cgroup * evlist__findnew_cgroup(struct perf_evlist *evlist, const char *name)
Definition: cgroup.c:133
struct cgroup * cgroup__get(struct cgroup *cgroup)
Definition: cgroup.c:180
int parse_cgroups(const struct option *opt, const char *str, int unset)
Definition: cgroup.c:201
static int str(yyscan_t scanner, int token)
int fd
Definition: cgroup.h:11
char * name
Definition: cgroup.h:10
void evlist__set_default_cgroup(struct perf_evlist *evlist, struct cgroup *cgroup)
Definition: cgroup.c:193
int nr_cgroups
Definition: cgroup.c:13
void cgroup__put(struct cgroup *cgroup)
Definition: cgroup.c:173
Definition: cgroup.h:9