summaryrefslogtreecommitdiffstats
path: root/tools/perf/util/env.h
diff options
context:
space:
mode:
authorNamhyung Kim <namhyung@kernel.org>2020-03-25 21:45:31 +0900
committerArnaldo Carvalho de Melo <acme@redhat.com>2020-04-03 09:37:55 -0300
commitd1277aa36bff4bfc1a187a469fc6a6a1d17cf59c (patch)
tree682d45f57bf534a8eda1195c6b46cb8f7be0953c /tools/perf/util/env.h
parentba78c1c5461c2fc2f57b777e971b3a9ec0df5666 (diff)
downloadlinux-stable-d1277aa36bff4bfc1a187a469fc6a6a1d17cf59c.tar.gz
linux-stable-d1277aa36bff4bfc1a187a469fc6a6a1d17cf59c.tar.bz2
linux-stable-d1277aa36bff4bfc1a187a469fc6a6a1d17cf59c.zip
perf cgroup: Maintain cgroup hierarchy
Each cgroup is kept in the perf_env's cgroup_tree sorted by the cgroup id. Hist entries have cgroup id can compare it directly and later it can be used to find a group name using this tree. Signed-off-by: Namhyung Kim <namhyung@kernel.org> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Mark Rutland <mark.rutland@arm.com> Cc: Peter Zijlstra <peterz@infradead.org> Link: http://lore.kernel.org/lkml/20200325124536.2800725-5-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/env.h')
-rw-r--r--tools/perf/util/env.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/tools/perf/util/env.h b/tools/perf/util/env.h
index 11d05ae3606a..7632075a8792 100644
--- a/tools/perf/util/env.h
+++ b/tools/perf/util/env.h
@@ -88,6 +88,12 @@ struct perf_env {
u32 btfs_cnt;
} bpf_progs;
+ /* same reason as above (for perf-top) */
+ struct {
+ struct rw_semaphore lock;
+ struct rb_root tree;
+ } cgroups;
+
/* For fast cpu to numa node lookup via perf_env__numa_node */
int *numa_map;
int nr_numa_map;