diff options
author | Namhyung Kim <namhyung.kim@lge.com> | 2012-04-26 01:15:15 -0400 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2012-05-02 14:17:58 -0400 |
commit | bea0340582dc47b447a014f5bf9f460925afdaf4 (patch) | |
tree | 0fe4a6fe7b287367b127ac7394086ff0c913588a /tools/perf/util/evsel.c | |
parent | c651214e90e5c150015f7524a6bfc298ad61435f (diff) |
perf tools: Introduce struct perf_target
The perf_target struct will be used for taking care of cpu/thread maps
based on user's input. Since it is used on various subcommands it'd
better factoring it out.
Thanks to Arnaldo for suggesting the better name.
Signed-off-by: Namhyung Kim <namhyung.kim@lge.com>
Reviewed-by: David Ahern <dsahern@gmail.com>
Cc: David Ahern <dsahern@gmail.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/1335417327-11796-2-git-send-email-namhyung.kim@lge.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 | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c index 8c13dbcb84b9..d90598edcf1d 100644 --- a/tools/perf/util/evsel.c +++ b/tools/perf/util/evsel.c | |||
@@ -106,15 +106,15 @@ void perf_evsel__config(struct perf_evsel *evsel, struct perf_record_opts *opts, | |||
106 | if (opts->call_graph) | 106 | if (opts->call_graph) |
107 | attr->sample_type |= PERF_SAMPLE_CALLCHAIN; | 107 | attr->sample_type |= PERF_SAMPLE_CALLCHAIN; |
108 | 108 | ||
109 | if (opts->system_wide) | 109 | if (opts->target.system_wide) |
110 | attr->sample_type |= PERF_SAMPLE_CPU; | 110 | attr->sample_type |= PERF_SAMPLE_CPU; |
111 | 111 | ||
112 | if (opts->period) | 112 | if (opts->period) |
113 | attr->sample_type |= PERF_SAMPLE_PERIOD; | 113 | attr->sample_type |= PERF_SAMPLE_PERIOD; |
114 | 114 | ||
115 | if (!opts->sample_id_all_missing && | 115 | if (!opts->sample_id_all_missing && |
116 | (opts->sample_time || opts->system_wide || | 116 | (opts->sample_time || opts->target.system_wide || |
117 | !opts->no_inherit || opts->cpu_list)) | 117 | !opts->no_inherit || opts->target.cpu_list)) |
118 | attr->sample_type |= PERF_SAMPLE_TIME; | 118 | attr->sample_type |= PERF_SAMPLE_TIME; |
119 | 119 | ||
120 | if (opts->raw_samples) { | 120 | if (opts->raw_samples) { |
@@ -135,8 +135,8 @@ void perf_evsel__config(struct perf_evsel *evsel, struct perf_record_opts *opts, | |||
135 | attr->mmap = track; | 135 | attr->mmap = track; |
136 | attr->comm = track; | 136 | attr->comm = track; |
137 | 137 | ||
138 | if (!opts->target_pid && !opts->target_tid && !opts->system_wide && | 138 | if (!opts->target.pid && !opts->target.tid && |
139 | (!opts->group || evsel == first)) { | 139 | !opts->target.system_wide && (!opts->group || evsel == first)) { |
140 | attr->disabled = 1; | 140 | attr->disabled = 1; |
141 | attr->enable_on_exec = 1; | 141 | attr->enable_on_exec = 1; |
142 | } | 142 | } |