diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2012-12-13 11:13:07 -0500 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2013-01-24 14:40:08 -0500 |
commit | 594ac61ad3be9c80c738a9fe3bb95c05d8d1bae1 (patch) | |
tree | 3fb2c1395bafd1799e34443d58adef6c4b65c7fe /tools/perf/builtin-record.c | |
parent | ce90e3856ba55af4d3d9c9c1168cc624607f6c7c (diff) |
perf evsel: Do missing feature fallbacks in just one place
Instead of doing it in stat, top, record or any other tool that opens
event descriptors.
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Namhyung Kim <namhyung@gmail.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/n/tip-vr8hzph83d5t2mdlkf565h84@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/builtin-record.c')
-rw-r--r-- | tools/perf/builtin-record.c | 36 |
1 files changed, 0 insertions, 36 deletions
diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c index 028de726b832..a4b97269cfc6 100644 --- a/tools/perf/builtin-record.c +++ b/tools/perf/builtin-record.c | |||
@@ -234,25 +234,6 @@ static int perf_record__open(struct perf_record *rec) | |||
234 | 234 | ||
235 | list_for_each_entry(pos, &evlist->entries, node) { | 235 | list_for_each_entry(pos, &evlist->entries, node) { |
236 | struct perf_event_attr *attr = &pos->attr; | 236 | struct perf_event_attr *attr = &pos->attr; |
237 | /* | ||
238 | * Check if parse_single_tracepoint_event has already asked for | ||
239 | * PERF_SAMPLE_TIME. | ||
240 | * | ||
241 | * XXX this is kludgy but short term fix for problems introduced by | ||
242 | * eac23d1c that broke 'perf script' by having different sample_types | ||
243 | * when using multiple tracepoint events when we use a perf binary | ||
244 | * that tries to use sample_id_all on an older kernel. | ||
245 | * | ||
246 | * We need to move counter creation to perf_session, support | ||
247 | * different sample_types, etc. | ||
248 | */ | ||
249 | bool time_needed = attr->sample_type & PERF_SAMPLE_TIME; | ||
250 | |||
251 | fallback_missing_features: | ||
252 | if (opts->exclude_guest_missing) | ||
253 | attr->exclude_guest = attr->exclude_host = 0; | ||
254 | retry_sample_id: | ||
255 | attr->sample_id_all = opts->sample_id_all_missing ? 0 : 1; | ||
256 | try_again: | 237 | try_again: |
257 | if (perf_evsel__open(pos, evlist->cpus, evlist->threads) < 0) { | 238 | if (perf_evsel__open(pos, evlist->cpus, evlist->threads) < 0) { |
258 | int err = errno; | 239 | int err = errno; |
@@ -266,23 +247,6 @@ try_again: | |||
266 | " an out-of-range profile CPU?\n"); | 247 | " an out-of-range profile CPU?\n"); |
267 | rc = -err; | 248 | rc = -err; |
268 | goto out; | 249 | goto out; |
269 | } else if (err == EINVAL) { | ||
270 | if (!opts->exclude_guest_missing && | ||
271 | (attr->exclude_guest || attr->exclude_host)) { | ||
272 | pr_debug("Old kernel, cannot exclude " | ||
273 | "guest or host samples.\n"); | ||
274 | opts->exclude_guest_missing = true; | ||
275 | goto fallback_missing_features; | ||
276 | } else if (!opts->sample_id_all_missing) { | ||
277 | /* | ||
278 | * Old kernel, no attr->sample_id_type_all field | ||
279 | */ | ||
280 | opts->sample_id_all_missing = true; | ||
281 | if (!opts->sample_time && !opts->raw_samples && !time_needed) | ||
282 | perf_evsel__reset_sample_bit(pos, TIME); | ||
283 | |||
284 | goto retry_sample_id; | ||
285 | } | ||
286 | } | 250 | } |
287 | 251 | ||
288 | /* | 252 | /* |