diff options
author | Adrian Hunter <adrian.hunter@intel.com> | 2013-11-15 08:52:29 -0500 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2013-11-27 12:58:36 -0500 |
commit | 3aa5939d71fa22a947808ba9c798b8537c35097a (patch) | |
tree | b127f8c885ade7568c24230d0c9e68a693877eae /tools/perf/util/evsel.c | |
parent | e944d3d7d151eea149c62310eaff7b92c7732f58 (diff) |
perf record: Make per-cpu mmaps the default.
This affects the -p, -t and -u options that previously defaulted to
per-thread mmaps.
Consequently add an option to select per-thread mmaps to support the old
behaviour.
Note that per-thread can be used with a workload-only (i.e. none of -p,
-t, -u, -a or -C is selected) to get a per-thread mmap with no
inheritance.
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Acked-by: Ingo Molnar <mingo@kernel.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Namhyung Kim <namhyung@gmail.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/r/5286271D.3020808@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/evsel.c')
-rw-r--r-- | tools/perf/util/evsel.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c index dad64926170f..b5fe7f9b2e15 100644 --- a/tools/perf/util/evsel.c +++ b/tools/perf/util/evsel.c | |||
@@ -574,6 +574,7 @@ void perf_evsel__config(struct perf_evsel *evsel, | |||
574 | struct perf_evsel *leader = evsel->leader; | 574 | struct perf_evsel *leader = evsel->leader; |
575 | struct perf_event_attr *attr = &evsel->attr; | 575 | struct perf_event_attr *attr = &evsel->attr; |
576 | int track = !evsel->idx; /* only the first counter needs these */ | 576 | int track = !evsel->idx; /* only the first counter needs these */ |
577 | bool per_cpu = opts->target.default_per_cpu && !opts->target.per_thread; | ||
577 | 578 | ||
578 | attr->sample_id_all = perf_missing_features.sample_id_all ? 0 : 1; | 579 | attr->sample_id_all = perf_missing_features.sample_id_all ? 0 : 1; |
579 | attr->inherit = !opts->no_inherit; | 580 | attr->inherit = !opts->no_inherit; |
@@ -647,7 +648,7 @@ void perf_evsel__config(struct perf_evsel *evsel, | |||
647 | } | 648 | } |
648 | } | 649 | } |
649 | 650 | ||
650 | if (target__has_cpu(&opts->target) || opts->target.force_per_cpu) | 651 | if (target__has_cpu(&opts->target)) |
651 | perf_evsel__set_sample_bit(evsel, CPU); | 652 | perf_evsel__set_sample_bit(evsel, CPU); |
652 | 653 | ||
653 | if (opts->period) | 654 | if (opts->period) |
@@ -655,7 +656,7 @@ void perf_evsel__config(struct perf_evsel *evsel, | |||
655 | 656 | ||
656 | if (!perf_missing_features.sample_id_all && | 657 | if (!perf_missing_features.sample_id_all && |
657 | (opts->sample_time || !opts->no_inherit || | 658 | (opts->sample_time || !opts->no_inherit || |
658 | target__has_cpu(&opts->target) || opts->target.force_per_cpu)) | 659 | target__has_cpu(&opts->target) || per_cpu)) |
659 | perf_evsel__set_sample_bit(evsel, TIME); | 660 | perf_evsel__set_sample_bit(evsel, TIME); |
660 | 661 | ||
661 | if (opts->raw_samples) { | 662 | if (opts->raw_samples) { |