From 4f3c7f88edd10674dfd0f7c00e06940c244c31f9 Mon Sep 17 00:00:00 2001 From: Arnaldo Carvalho de Melo Date: Mon, 21 Feb 2011 16:05:50 -0300 Subject: [PATCH] --- yaml --- r: 234462 b: refs/heads/master c: e603dc15072c7fec0ae263597e6dabc3bb4c5c5b h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/tools/perf/util/evsel.c | 15 +++++++++++++-- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/[refs] b/[refs] index b49357713edd..576b8e7f15d1 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: fbee632d0ca9f4073a3fefb9a843eac8af036b0f +refs/heads/master: e603dc15072c7fec0ae263597e6dabc3bb4c5c5b diff --git a/trunk/tools/perf/util/evsel.c b/trunk/tools/perf/util/evsel.c index 63cadaf3e208..8083d5126fca 100644 --- a/trunk/tools/perf/util/evsel.c +++ b/trunk/tools/perf/util/evsel.c @@ -179,8 +179,19 @@ static int __perf_evsel__open(struct perf_evsel *evsel, struct cpu_map *cpus, for (cpu = 0; cpu < cpus->nr; cpu++) { int group_fd = -1; - - evsel->attr.inherit = (cpus->map[cpu] < 0) && inherit; + /* + * Don't allow mmap() of inherited per-task counters. This + * would create a performance issue due to all children writing + * to the same buffer. + * + * FIXME: + * Proper fix is not to pass 'inherit' to perf_evsel__open*, + * but a 'flags' parameter, with 'group' folded there as well, + * then introduce a PERF_O_{MMAP,GROUP,INHERIT} enum, and if + * O_MMAP is set, emit a warning if cpu < 0 and O_INHERIT is + * set. Lets go for the minimal fix first tho. + */ + evsel->attr.inherit = (cpus->map[cpu] >= 0) && inherit; for (thread = 0; thread < threads->nr; thread++) {