Skip to content

Commit

Permalink
sparc64: Provide hypervisor tracing bit support for perf counters.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
David S. Miller committed Sep 10, 2009
1 parent 59abbd1 commit 91b9286
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion arch/sparc/kernel/perf_counter.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ struct sparc_pmu {
int upper_shift;
int lower_shift;
int event_mask;
int hv_bit;
};

static const struct perf_event_map ultra3i_perfmon_event_map[] = {
Expand Down Expand Up @@ -178,7 +179,7 @@ void hw_perf_disable(void)
cpuc->enabled = 0;

val = pcr_ops->read();
val &= ~(PCR_UTRACE | PCR_STRACE);
val &= ~(PCR_UTRACE | PCR_STRACE | sparc_pmu->hv_bit);
pcr_ops->write(val);
}

Expand Down Expand Up @@ -377,6 +378,8 @@ static int __hw_perf_counter_init(struct perf_counter *counter)
hwc->config_base |= PCR_UTRACE;
if (!attr->exclude_kernel)
hwc->config_base |= PCR_STRACE;
if (!attr->exclude_hv)
hwc->config_base |= sparc_pmu->hv_bit;

if (!hwc->sample_period) {
hwc->sample_period = MAX_PERIOD;
Expand Down

0 comments on commit 91b9286

Please sign in to comment.