mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-24 13:44:26 -04:00
cgroup, perf_event: make perf_event controller work on cgroup2 hierarchy
perf_event is a utility controller whose primary role is identifying cgroup membership to filter perf events; however, because it also tracks some per-css state, it can't be replaced by pure cgroup membership test. Mark the controller as implicitly enabled on the default hierarchy so that perf events can always be filtered based on cgroup v2 path as long as the controller is not mounted on a legacy hierarchy. "perf record" is updated accordingly so that it searches for both v1 and v2 hierarchies. A v1 hierarchy is used if perf_event is mounted on it; otherwise, it uses the v2 hierarchy. v2: Doc updated to reflect more flexible rebinding behavior. Signed-off-by: Tejun Heo <tj@kernel.org> Acked-by: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Ingo Molnar <mingo@redhat.com> Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
This commit is contained in:
parent
b807421a72
commit
968ebff1ef
3 changed files with 37 additions and 7 deletions
|
|
@ -10792,5 +10792,11 @@ struct cgroup_subsys perf_event_cgrp_subsys = {
|
|||
.css_alloc = perf_cgroup_css_alloc,
|
||||
.css_free = perf_cgroup_css_free,
|
||||
.attach = perf_cgroup_attach,
|
||||
/*
|
||||
* Implicitly enable on dfl hierarchy so that perf events can
|
||||
* always be filtered by cgroup2 path as long as perf_event
|
||||
* controller is not mounted on a legacy hierarchy.
|
||||
*/
|
||||
.implicit_on_dfl = true,
|
||||
};
|
||||
#endif /* CONFIG_CGROUP_PERF */
|
||||
|
|
|
|||
Loading…
Reference in a new issue