diff options
author | David S. Miller <davem@davemloft.net> | 2009-09-10 10:09:06 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-09-10 10:09:06 -0400 |
commit | 91b9286d819b821fd742c0053fe0748818374198 (patch) | |
tree | 681f74f971241a06a3db0e0604a99a938469dadd | |
parent | 59abbd1e7cfd6018fb8e58a96aa562aaff8711e7 (diff) |
sparc64: Provide hypervisor tracing bit support for perf counters.
A PMU need only specify which bit in the PCR enabled hypervisor
tracing in order to enable this.
This will be used in Niagara-2 perf counter support.
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | arch/sparc/kernel/perf_counter.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/arch/sparc/kernel/perf_counter.c b/arch/sparc/kernel/perf_counter.c index f2c781450d08..d86009fa6f8d 100644 --- a/arch/sparc/kernel/perf_counter.c +++ b/arch/sparc/kernel/perf_counter.c | |||
@@ -77,6 +77,7 @@ struct sparc_pmu { | |||
77 | int upper_shift; | 77 | int upper_shift; |
78 | int lower_shift; | 78 | int lower_shift; |
79 | int event_mask; | 79 | int event_mask; |
80 | int hv_bit; | ||
80 | }; | 81 | }; |
81 | 82 | ||
82 | static const struct perf_event_map ultra3i_perfmon_event_map[] = { | 83 | static const struct perf_event_map ultra3i_perfmon_event_map[] = { |
@@ -178,7 +179,7 @@ void hw_perf_disable(void) | |||
178 | cpuc->enabled = 0; | 179 | cpuc->enabled = 0; |
179 | 180 | ||
180 | val = pcr_ops->read(); | 181 | val = pcr_ops->read(); |
181 | val &= ~(PCR_UTRACE | PCR_STRACE); | 182 | val &= ~(PCR_UTRACE | PCR_STRACE | sparc_pmu->hv_bit); |
182 | pcr_ops->write(val); | 183 | pcr_ops->write(val); |
183 | } | 184 | } |
184 | 185 | ||
@@ -377,6 +378,8 @@ static int __hw_perf_counter_init(struct perf_counter *counter) | |||
377 | hwc->config_base |= PCR_UTRACE; | 378 | hwc->config_base |= PCR_UTRACE; |
378 | if (!attr->exclude_kernel) | 379 | if (!attr->exclude_kernel) |
379 | hwc->config_base |= PCR_STRACE; | 380 | hwc->config_base |= PCR_STRACE; |
381 | if (!attr->exclude_hv) | ||
382 | hwc->config_base |= sparc_pmu->hv_bit; | ||
380 | 383 | ||
381 | if (!hwc->sample_period) { | 384 | if (!hwc->sample_period) { |
382 | hwc->sample_period = MAX_PERIOD; | 385 | hwc->sample_period = MAX_PERIOD; |