diff options
author | David S. Miller <davem@davemloft.net> | 2012-08-17 05:41:32 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-08-19 02:26:20 -0400 |
commit | 7ac2ed286f9338ea6437831096cc36ce8395b6fc (patch) | |
tree | cbf747e593a5a83e1484a47fc37fa6645ab41a63 /arch/sparc/kernel | |
parent | 5344303ca8dad9881def6cfb45ad01201dba16de (diff) |
sparc64: Specify user and supervisor trace PCR bits in sparc_pmu.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/sparc/kernel')
-rw-r--r-- | arch/sparc/kernel/perf_event.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/arch/sparc/kernel/perf_event.c b/arch/sparc/kernel/perf_event.c index fbd80299a4bb..1ab676bd13f0 100644 --- a/arch/sparc/kernel/perf_event.c +++ b/arch/sparc/kernel/perf_event.c | |||
@@ -146,6 +146,8 @@ struct sparc_pmu { | |||
146 | int upper_shift; | 146 | int upper_shift; |
147 | int lower_shift; | 147 | int lower_shift; |
148 | int event_mask; | 148 | int event_mask; |
149 | int user_bit; | ||
150 | int priv_bit; | ||
149 | int hv_bit; | 151 | int hv_bit; |
150 | int irq_bit; | 152 | int irq_bit; |
151 | int upper_nop; | 153 | int upper_nop; |
@@ -306,6 +308,8 @@ static const struct sparc_pmu ultra3_pmu = { | |||
306 | .upper_shift = 11, | 308 | .upper_shift = 11, |
307 | .lower_shift = 4, | 309 | .lower_shift = 4, |
308 | .event_mask = 0x3f, | 310 | .event_mask = 0x3f, |
311 | .user_bit = PCR_UTRACE, | ||
312 | .priv_bit = PCR_STRACE, | ||
309 | .upper_nop = 0x1c, | 313 | .upper_nop = 0x1c, |
310 | .lower_nop = 0x14, | 314 | .lower_nop = 0x14, |
311 | .flags = (SPARC_PMU_ALL_EXCLUDES_SAME | | 315 | .flags = (SPARC_PMU_ALL_EXCLUDES_SAME | |
@@ -440,6 +444,8 @@ static const struct sparc_pmu niagara1_pmu = { | |||
440 | .upper_shift = 0, | 444 | .upper_shift = 0, |
441 | .lower_shift = 4, | 445 | .lower_shift = 4, |
442 | .event_mask = 0x7, | 446 | .event_mask = 0x7, |
447 | .user_bit = PCR_UTRACE, | ||
448 | .priv_bit = PCR_STRACE, | ||
443 | .upper_nop = 0x0, | 449 | .upper_nop = 0x0, |
444 | .lower_nop = 0x0, | 450 | .lower_nop = 0x0, |
445 | .flags = (SPARC_PMU_ALL_EXCLUDES_SAME | | 451 | .flags = (SPARC_PMU_ALL_EXCLUDES_SAME | |
@@ -571,7 +577,9 @@ static const struct sparc_pmu niagara2_pmu = { | |||
571 | .upper_shift = 19, | 577 | .upper_shift = 19, |
572 | .lower_shift = 6, | 578 | .lower_shift = 6, |
573 | .event_mask = 0xfff, | 579 | .event_mask = 0xfff, |
574 | .hv_bit = 0x8, | 580 | .user_bit = PCR_UTRACE, |
581 | .priv_bit = PCR_STRACE, | ||
582 | .hv_bit = PCR_N2_HTRACE, | ||
575 | .irq_bit = 0x30, | 583 | .irq_bit = 0x30, |
576 | .upper_nop = 0x220, | 584 | .upper_nop = 0x220, |
577 | .lower_nop = 0x220, | 585 | .lower_nop = 0x220, |
@@ -771,7 +779,7 @@ static void sparc_pmu_disable(struct pmu *pmu) | |||
771 | cpuc->n_added = 0; | 779 | cpuc->n_added = 0; |
772 | 780 | ||
773 | val = cpuc->pcr; | 781 | val = cpuc->pcr; |
774 | val &= ~(PCR_UTRACE | PCR_STRACE | | 782 | val &= ~(sparc_pmu->user_bit | sparc_pmu->priv_bit | |
775 | sparc_pmu->hv_bit | sparc_pmu->irq_bit); | 783 | sparc_pmu->hv_bit | sparc_pmu->irq_bit); |
776 | cpuc->pcr = val; | 784 | cpuc->pcr = val; |
777 | 785 | ||
@@ -1177,9 +1185,9 @@ static int sparc_pmu_event_init(struct perf_event *event) | |||
1177 | /* We save the enable bits in the config_base. */ | 1185 | /* We save the enable bits in the config_base. */ |
1178 | hwc->config_base = sparc_pmu->irq_bit; | 1186 | hwc->config_base = sparc_pmu->irq_bit; |
1179 | if (!attr->exclude_user) | 1187 | if (!attr->exclude_user) |
1180 | hwc->config_base |= PCR_UTRACE; | 1188 | hwc->config_base |= sparc_pmu->user_bit; |
1181 | if (!attr->exclude_kernel) | 1189 | if (!attr->exclude_kernel) |
1182 | hwc->config_base |= PCR_STRACE; | 1190 | hwc->config_base |= sparc_pmu->priv_bit; |
1183 | if (!attr->exclude_hv) | 1191 | if (!attr->exclude_hv) |
1184 | hwc->config_base |= sparc_pmu->hv_bit; | 1192 | hwc->config_base |= sparc_pmu->hv_bit; |
1185 | 1193 | ||