From: Peter Zijlstra Date: Thu, 11 Jun 2009 21:11:50 +0000 (+0200) Subject: perf record: Explicity program a default counter X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=bbd36e5e6aa6f1757c84cdb406b6eb81686d14af;p=linux-beck.git 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 Cc: Mike Galbraith Cc: Paul Mackerras Cc: Arnaldo Carvalho de Melo LKML-Reference: Signed-off-by: Ingo Molnar --- diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c index 29259e74dcfa..0f5771f615da 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) if (!argc && target_pid == -1 && !system_wide) usage_with_options(record_usage, options); - if (!nr_counters) - nr_counters = 1; + if (!nr_counters) { + nr_counters = 1; + attrs[0].type = PERF_TYPE_HARDWARE; + attrs[0].config = PERF_COUNT_HW_CPU_CYCLES; + } for (counter = 0; counter < nr_counters; counter++) { if (attrs[counter].sample_period)