aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/util/evsel.h
diff options
context:
space:
mode:
authorStephane Eranian <eranian@google.com>2011-02-14 11:20:01 +0200
committerIngo Molnar <mingo@elte.hu>2011-02-16 13:30:48 +0100
commit023695d96ee06f36cf5014e286edcd623e9fb847 (patch)
treeff7483b7a1aa0cfd5de95475ed059822d2a35499 /tools/perf/util/evsel.h
parentperf: Add cgroup support (diff)
downloadlinux-dev-023695d96ee06f36cf5014e286edcd623e9fb847.tar.xz
linux-dev-023695d96ee06f36cf5014e286edcd623e9fb847.zip
perf tool: Add cgroup support
This patch adds the ability to filter monitoring based on container groups (cgroups) for both perf stat and perf record. It is possible to monitor multiple cgroup in parallel. There is one cgroup per event. The cgroups to monitor are passed via a new -G option followed by a comma separated list of cgroup names. The cgroup filesystem has to be mounted. Given a cgroup name, the perf tool finds the corresponding directory in the cgroup filesystem and opens it. It then passes that file descriptor to the kernel. Example: $ perf stat -B -a -e cycles:u,cycles:u,cycles:u -G test1,,test2 -- sleep 1 Performance counter stats for 'sleep 1': 2,368,667,414 cycles test1 2,369,661,459 cycles <not counted> cycles test2 1.001856890 seconds time elapsed Signed-off-by: Stephane Eranian <eranian@google.com> Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> LKML-Reference: <4d590290.825bdf0a.7d0a.4890@mx.google.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to '')
-rw-r--r--tools/perf/util/evsel.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/tools/perf/util/evsel.h b/tools/perf/util/evsel.h
index eecdc3aabc14..1d3d5a3dbe60 100644
--- a/tools/perf/util/evsel.h
+++ b/tools/perf/util/evsel.h
@@ -6,6 +6,7 @@
#include "../../../include/linux/perf_event.h"
#include "types.h"
#include "xyarray.h"
+#include "cgroup.h"
struct perf_counts_values {
union {
@@ -45,6 +46,7 @@ struct perf_evsel {
struct perf_counts *counts;
int idx;
void *priv;
+ struct cgroup_sel *cgrp;
};
struct cpu_map;