]> Git Repo - linux.git/commitdiff
perf record: Explicity program a default counter
authorPeter Zijlstra <[email protected]>
Thu, 11 Jun 2009 21:11:50 +0000 (23:11 +0200)
committerIngo Molnar <[email protected]>
Fri, 12 Jun 2009 12:28:52 +0000 (14:28 +0200)
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 <[email protected]>
Cc: Mike Galbraith <[email protected]>
Cc: Paul Mackerras <[email protected]>
Cc: Arnaldo Carvalho de Melo <[email protected]>
LKML-Reference: <new-submission>
Signed-off-by: Ingo Molnar <[email protected]>
tools/perf/builtin-record.c

index 29259e74dcfa7b4b9d89202ed0987d2312b0eec5..0f5771f615dae24cd9a4073eb9b5ee95419f1124 100644 (file)
@@ -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)
This page took 0.056141 seconds and 4 git commands to generate.