forked from Minki/linux
483322dda0
So that tools like 'perf trace' can allow the user to set a cgroup to be used for all the evsels still without a crgroup setup by parse_cgroups(), such as the one to use for the syscalls, vfs_getname and other events involved in strace like syscall tracing. Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: David Ahern <dsahern@gmail.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Stephane Eranian <eranian@google.com> Cc: Wang Nan <wangnan0@huawei.com> Link: https://lkml.kernel.org/n/tip-zf9jjsbj661r3lk6qb7g8j70@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
30 lines
634 B
C
30 lines
634 B
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
#ifndef __CGROUP_H__
|
|
#define __CGROUP_H__
|
|
|
|
#include <linux/refcount.h>
|
|
|
|
struct option;
|
|
|
|
struct cgroup {
|
|
char *name;
|
|
int fd;
|
|
refcount_t refcnt;
|
|
};
|
|
|
|
|
|
extern int nr_cgroups; /* number of explicit cgroups defined */
|
|
|
|
struct cgroup *cgroup__get(struct cgroup *cgroup);
|
|
void cgroup__put(struct cgroup *cgroup);
|
|
|
|
struct perf_evlist;
|
|
|
|
struct cgroup *evlist__findnew_cgroup(struct perf_evlist *evlist, char *name);
|
|
|
|
void evlist__set_default_cgroup(struct perf_evlist *evlist, struct cgroup *cgroup);
|
|
|
|
int parse_cgroups(const struct option *opt, const char *str, int unset);
|
|
|
|
#endif /* __CGROUP_H__ */
|