diff options
author | Peter Zijlstra <a.p.zijlstra@chello.nl> | 2009-06-11 17:11:50 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-06-12 08:28:52 -0400 |
commit | bbd36e5e6aa6f1757c84cdb406b6eb81686d14af (patch) | |
tree | eeb2ea1ec358c8484277078315ef8c211e7c1397 /tools | |
parent | 081fad86178ec0f64f32f1bd04cf4aad22714fb9 (diff) |
perf record: Explicity program a default counter
Up until now record has worked on the assumption that type=0, config=0
was a suitable configuration - which it is. Lets make this a little more
explicit and more readable via the use of proper symbols.
[ Impact: cleanup ]
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
LKML-Reference: <new-submission>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/perf/builtin-record.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c index 29259e74dcf..0f5771f615d 100644 --- a/tools/perf/builtin-record.c +++ b/tools/perf/builtin-record.c | |||
@@ -568,8 +568,11 @@ int cmd_record(int argc, const char **argv, const char *prefix) | |||
568 | if (!argc && target_pid == -1 && !system_wide) | 568 | if (!argc && target_pid == -1 && !system_wide) |
569 | usage_with_options(record_usage, options); | 569 | usage_with_options(record_usage, options); |
570 | 570 | ||
571 | if (!nr_counters) | 571 | if (!nr_counters) { |
572 | nr_counters = 1; | 572 | nr_counters = 1; |
573 | attrs[0].type = PERF_TYPE_HARDWARE; | ||
574 | attrs[0].config = PERF_COUNT_HW_CPU_CYCLES; | ||
575 | } | ||
573 | 576 | ||
574 | for (counter = 0; counter < nr_counters; counter++) { | 577 | for (counter = 0; counter < nr_counters; counter++) { |
575 | if (attrs[counter].sample_period) | 578 | if (attrs[counter].sample_period) |