summaryrefslogtreecommitdiffstats
path: root/tools/perf/builtin-stat.c
diff options
context:
space:
mode:
authorPeter Zijlstra <a.p.zijlstra@chello.nl>2009-06-11 14:06:28 +0200
committerIngo Molnar <mingo@elte.hu>2009-06-11 17:54:15 +0200
commitf4dbfa8f3131a84257223393905f7efad0ca5996 (patch)
tree67bb2666868c4449c2fa9ba6dc931721f60deb6c /tools/perf/builtin-stat.c
parent1c432d899d32d36371ee4ee310fa3609cf0e5742 (diff)
downloadop-kernel-dev-f4dbfa8f3131a84257223393905f7efad0ca5996.zip
op-kernel-dev-f4dbfa8f3131a84257223393905f7efad0ca5996.tar.gz
perf_counter: Standardize event names
Pure renames only, to PERF_COUNT_HW_* and PERF_COUNT_SW_*. 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/perf/builtin-stat.c')
-rw-r--r--tools/perf/builtin-stat.c31
1 files changed, 16 insertions, 15 deletions
diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c
index 6404906..c43e4a9 100644
--- a/tools/perf/builtin-stat.c
+++ b/tools/perf/builtin-stat.c
@@ -46,15 +46,16 @@
static struct perf_counter_attr default_attrs[MAX_COUNTERS] = {
- { .type = PERF_TYPE_SOFTWARE, .config = PERF_COUNT_TASK_CLOCK },
- { .type = PERF_TYPE_SOFTWARE, .config = PERF_COUNT_CONTEXT_SWITCHES },
- { .type = PERF_TYPE_SOFTWARE, .config = PERF_COUNT_CPU_MIGRATIONS },
- { .type = PERF_TYPE_SOFTWARE, .config = PERF_COUNT_PAGE_FAULTS },
-
- { .type = PERF_TYPE_HARDWARE, .config = PERF_COUNT_CPU_CYCLES },
- { .type = PERF_TYPE_HARDWARE, .config = PERF_COUNT_INSTRUCTIONS },
- { .type = PERF_TYPE_HARDWARE, .config = PERF_COUNT_CACHE_REFERENCES },
- { .type = PERF_TYPE_HARDWARE, .config = PERF_COUNT_CACHE_MISSES },
+ { .type = PERF_TYPE_SOFTWARE, .config = PERF_COUNT_SW_TASK_CLOCK },
+ { .type = PERF_TYPE_SOFTWARE, .config = PERF_COUNT_SW_CONTEXT_SWITCHES},
+ { .type = PERF_TYPE_SOFTWARE, .config = PERF_COUNT_SW_CPU_MIGRATIONS },
+ { .type = PERF_TYPE_SOFTWARE, .config = PERF_COUNT_SW_PAGE_FAULTS },
+
+ { .type = PERF_TYPE_HARDWARE, .config = PERF_COUNT_HW_CPU_CYCLES },
+ { .type = PERF_TYPE_HARDWARE, .config = PERF_COUNT_HW_INSTRUCTIONS },
+ { .type = PERF_TYPE_HARDWARE, .config = PERF_COUNT_HW_CACHE_REFERENCES},
+ { .type = PERF_TYPE_HARDWARE, .config = PERF_COUNT_HW_CACHE_MISSES },
+
};
static int system_wide = 0;
@@ -120,10 +121,10 @@ static inline int nsec_counter(int counter)
if (attrs[counter].type != PERF_TYPE_SOFTWARE)
return 0;
- if (attrs[counter].config == PERF_COUNT_CPU_CLOCK)
+ if (attrs[counter].config == PERF_COUNT_SW_CPU_CLOCK)
return 1;
- if (attrs[counter].config == PERF_COUNT_TASK_CLOCK)
+ if (attrs[counter].config == PERF_COUNT_SW_TASK_CLOCK)
return 1;
return 0;
@@ -176,10 +177,10 @@ static void read_counter(int counter)
* Save the full runtime - to allow normalization during printout:
*/
if (attrs[counter].type == PERF_TYPE_SOFTWARE &&
- attrs[counter].config == PERF_COUNT_TASK_CLOCK)
+ attrs[counter].config == PERF_COUNT_SW_TASK_CLOCK)
runtime_nsecs = count[0];
if (attrs[counter].type == PERF_TYPE_HARDWARE &&
- attrs[counter].config == PERF_COUNT_CPU_CYCLES)
+ attrs[counter].config == PERF_COUNT_HW_CPU_CYCLES)
runtime_cycles = count[0];
}
@@ -206,7 +207,7 @@ static void print_counter(int counter)
fprintf(stderr, " %14.6f %-20s",
msecs, event_name(counter));
if (attrs[counter].type == PERF_TYPE_SOFTWARE &&
- attrs[counter].config == PERF_COUNT_TASK_CLOCK) {
+ attrs[counter].config == PERF_COUNT_SW_TASK_CLOCK) {
if (walltime_nsecs)
fprintf(stderr, " # %11.3f CPU utilization factor",
@@ -220,7 +221,7 @@ static void print_counter(int counter)
(double)count[0]/runtime_nsecs*1000.0);
if (runtime_cycles &&
attrs[counter].type == PERF_TYPE_HARDWARE &&
- attrs[counter].config == PERF_COUNT_INSTRUCTIONS) {
+ attrs[counter].config == PERF_COUNT_HW_INSTRUCTIONS) {
fprintf(stderr, " # %1.3f per cycle",
(double)count[0] / (double)runtime_cycles);
OpenPOWER on IntegriCloud