diff options
author | Vegard Nossum <vegard.nossum@gmail.com> | 2009-06-15 09:50:49 -0400 |
---|---|---|
committer | Vegard Nossum <vegard.nossum@gmail.com> | 2009-06-15 09:50:49 -0400 |
commit | 722f2a6c87f34ee0fd0130a8cf45f81e0705594a (patch) | |
tree | 50b054df34d2731eb0ba0cf1a6c27e43e7eed428 /tools/perf | |
parent | 7a0aeb14e18ad59394bd9bbc6e57fb345819e748 (diff) | |
parent | 45e3e1935e2857c54783291107d33323b3ef33c8 (diff) |
Merge commit 'linus/master' into HEAD
Conflicts:
MAINTAINERS
Signed-off-by: Vegard Nossum <vegard.nossum@gmail.com>
Diffstat (limited to 'tools/perf')
-rw-r--r-- | tools/perf/builtin-record.c | 7 | ||||
-rw-r--r-- | tools/perf/design.txt | 15 | ||||
-rw-r--r-- | tools/perf/perf.h | 5 | ||||
-rw-r--r-- | tools/perf/util/parse-events.c | 2 |
4 files changed, 24 insertions, 5 deletions
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) | |||
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) |
diff --git a/tools/perf/design.txt b/tools/perf/design.txt index 860e116d979c..f71e0d245cba 100644 --- a/tools/perf/design.txt +++ b/tools/perf/design.txt | |||
@@ -440,3 +440,18 @@ by this process or by another, and doesn't affect any counters that | |||
440 | this process has created on other processes. It only enables or | 440 | this process has created on other processes. It only enables or |
441 | disables the group leaders, not any other members in the groups. | 441 | disables the group leaders, not any other members in the groups. |
442 | 442 | ||
443 | |||
444 | Arch requirements | ||
445 | ----------------- | ||
446 | |||
447 | If your architecture does not have hardware performance metrics, you can | ||
448 | still use the generic software counters based on hrtimers for sampling. | ||
449 | |||
450 | So to start with, in order to add HAVE_PERF_COUNTERS to your Kconfig, you | ||
451 | will need at least this: | ||
452 | - asm/perf_counter.h - a basic stub will suffice at first | ||
453 | - support for atomic64 types (and associated helper functions) | ||
454 | - set_perf_counter_pending() implemented | ||
455 | |||
456 | If your architecture does have hardware capabilities, you can override the | ||
457 | weak stub hw_perf_counter_init() to register hardware counters. | ||
diff --git a/tools/perf/perf.h b/tools/perf/perf.h index af0a5046d743..87a1aca4a424 100644 --- a/tools/perf/perf.h +++ b/tools/perf/perf.h | |||
@@ -53,11 +53,12 @@ static inline unsigned long long rdclock(void) | |||
53 | _min1 < _min2 ? _min1 : _min2; }) | 53 | _min1 < _min2 ? _min1 : _min2; }) |
54 | 54 | ||
55 | static inline int | 55 | static inline int |
56 | sys_perf_counter_open(struct perf_counter_attr *attr_uptr, | 56 | sys_perf_counter_open(struct perf_counter_attr *attr, |
57 | pid_t pid, int cpu, int group_fd, | 57 | pid_t pid, int cpu, int group_fd, |
58 | unsigned long flags) | 58 | unsigned long flags) |
59 | { | 59 | { |
60 | return syscall(__NR_perf_counter_open, attr_uptr, pid, cpu, | 60 | attr->size = sizeof(*attr); |
61 | return syscall(__NR_perf_counter_open, attr, pid, cpu, | ||
61 | group_fd, flags); | 62 | group_fd, flags); |
62 | } | 63 | } |
63 | 64 | ||
diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c index 9d5f1ca50e6f..5a72586e1df0 100644 --- a/tools/perf/util/parse-events.c +++ b/tools/perf/util/parse-events.c | |||
@@ -75,7 +75,7 @@ static char *sw_event_names[] = { | |||
75 | #define MAX_ALIASES 8 | 75 | #define MAX_ALIASES 8 |
76 | 76 | ||
77 | static char *hw_cache [][MAX_ALIASES] = { | 77 | static char *hw_cache [][MAX_ALIASES] = { |
78 | { "L1-data" , "l1-d", "l1d", "l1" }, | 78 | { "L1-data" , "l1-d", "l1d" }, |
79 | { "L1-instruction" , "l1-i", "l1i" }, | 79 | { "L1-instruction" , "l1-i", "l1i" }, |
80 | { "L2" , "l2" }, | 80 | { "L2" , "l2" }, |
81 | { "Data-TLB" , "dtlb", "d-tlb" }, | 81 | { "Data-TLB" , "dtlb", "d-tlb" }, |