summaryrefslogtreecommitdiffstats
path: root/tools/perf/util
diff options
context:
space:
mode:
authorNamhyung Kim <namhyung.kim@lge.com>2012-05-16 18:45:49 +0900
committerArnaldo Carvalho de Melo <acme@redhat.com>2012-05-17 12:32:54 -0300
commitd1cb9fce92c41454bd594fb0920575fc63301878 (patch)
tree02b1c6b97504b2ba3a2a8f3e33bbb651bb6e98e2 /tools/perf/util
parent879d77d0cbe20ad1d6099a1e16f03b72c0649828 (diff)
downloadblackbird-op-linux-d1cb9fce92c41454bd594fb0920575fc63301878.tar.gz
blackbird-op-linux-d1cb9fce92c41454bd594fb0920575fc63301878.zip
perf target: Add uses_mmap field
If perf doesn't mmap on event (like perf stat), it should not create per-task-per-cpu events. So just use a dummy cpu map to create a per-task event for this case. Signed-off-by: Namhyung Kim <namhyung.kim@lge.com> Cc: Ingo Molnar <mingo@redhat.com> Cc: Namhyung Kim <namhyung@gmail.com> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Link: http://lkml.kernel.org/r/1337161549-9870-3-git-send-email-namhyung.kim@lge.com [ committer note: renamed .need_mmap to .uses_mmap ] Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util')
-rw-r--r--tools/perf/util/evlist.c2
-rw-r--r--tools/perf/util/target.h1
2 files changed, 3 insertions, 0 deletions
diff --git a/tools/perf/util/evlist.c b/tools/perf/util/evlist.c
index 87889f325678..4ac5f5ae4ce9 100644
--- a/tools/perf/util/evlist.c
+++ b/tools/perf/util/evlist.c
@@ -611,6 +611,8 @@ int perf_evlist__create_maps(struct perf_evlist *evlist,
if (perf_target__has_task(target))
evlist->cpus = cpu_map__dummy_new();
+ else if (!perf_target__has_cpu(target) && !target->uses_mmap)
+ evlist->cpus = cpu_map__dummy_new();
else
evlist->cpus = cpu_map__new(target->cpu_list);
diff --git a/tools/perf/util/target.h b/tools/perf/util/target.h
index c43f632955fa..a4be8575fda5 100644
--- a/tools/perf/util/target.h
+++ b/tools/perf/util/target.h
@@ -11,6 +11,7 @@ struct perf_target {
const char *uid_str;
uid_t uid;
bool system_wide;
+ bool uses_mmap;
};
enum perf_target_errno {
OpenPOWER on IntegriCloud