aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sparc/kernel/perf_event.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2012-08-17 00:16:22 -0400
committerDavid S. Miller <davem@davemloft.net>2012-08-19 02:04:08 -0400
commit0bab20ba4c95f56355c24a0b9f03eb486c2a267d (patch)
tree906d0ca27a6c62ea01b55e24f7a4c3a7e76a723e /arch/sparc/kernel/perf_event.c
parent8c79bfa51101354853f0f5d3b02435cec429da51 (diff)
sparc64: Add 'reg_num' argument to pcr_ops methods.
SPARC-T4 and later have multiple PCR registers, one for each PIC counter. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/sparc/kernel/perf_event.c')
-rw-r--r--arch/sparc/kernel/perf_event.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/arch/sparc/kernel/perf_event.c b/arch/sparc/kernel/perf_event.c
index 5713957dcb8a..e1c9848c39cb 100644
--- a/arch/sparc/kernel/perf_event.c
+++ b/arch/sparc/kernel/perf_event.c
@@ -564,7 +564,7 @@ static inline void sparc_pmu_enable_event(struct cpu_hw_events *cpuc, struct hw_
564 val |= hwc->config; 564 val |= hwc->config;
565 cpuc->pcr = val; 565 cpuc->pcr = val;
566 566
567 pcr_ops->write(cpuc->pcr); 567 pcr_ops->write(0, cpuc->pcr);
568} 568}
569 569
570static inline void sparc_pmu_disable_event(struct cpu_hw_events *cpuc, struct hw_perf_event *hwc, int idx) 570static inline void sparc_pmu_disable_event(struct cpu_hw_events *cpuc, struct hw_perf_event *hwc, int idx)
@@ -578,7 +578,7 @@ static inline void sparc_pmu_disable_event(struct cpu_hw_events *cpuc, struct hw
578 val |= nop; 578 val |= nop;
579 cpuc->pcr = val; 579 cpuc->pcr = val;
580 580
581 pcr_ops->write(cpuc->pcr); 581 pcr_ops->write(0, cpuc->pcr);
582} 582}
583 583
584static u32 read_pmc(int idx) 584static u32 read_pmc(int idx)
@@ -736,7 +736,7 @@ static void sparc_pmu_enable(struct pmu *pmu)
736 cpuc->pcr = pcr | cpuc->event[0]->hw.config_base; 736 cpuc->pcr = pcr | cpuc->event[0]->hw.config_base;
737 } 737 }
738 738
739 pcr_ops->write(cpuc->pcr); 739 pcr_ops->write(0, cpuc->pcr);
740} 740}
741 741
742static void sparc_pmu_disable(struct pmu *pmu) 742static void sparc_pmu_disable(struct pmu *pmu)
@@ -755,7 +755,7 @@ static void sparc_pmu_disable(struct pmu *pmu)
755 sparc_pmu->hv_bit | sparc_pmu->irq_bit); 755 sparc_pmu->hv_bit | sparc_pmu->irq_bit);
756 cpuc->pcr = val; 756 cpuc->pcr = val;
757 757
758 pcr_ops->write(cpuc->pcr); 758 pcr_ops->write(0, cpuc->pcr);
759} 759}
760 760
761static int active_event_index(struct cpu_hw_events *cpuc, 761static int active_event_index(struct cpu_hw_events *cpuc,
@@ -856,7 +856,7 @@ static void perf_stop_nmi_watchdog(void *unused)
856 struct cpu_hw_events *cpuc = &__get_cpu_var(cpu_hw_events); 856 struct cpu_hw_events *cpuc = &__get_cpu_var(cpu_hw_events);
857 857
858 stop_nmi_watchdog(NULL); 858 stop_nmi_watchdog(NULL);
859 cpuc->pcr = pcr_ops->read(); 859 cpuc->pcr = pcr_ops->read(0);
860} 860}
861 861
862void perf_event_grab_pmc(void) 862void perf_event_grab_pmc(void)
@@ -1264,7 +1264,7 @@ void perf_event_print_debug(void)
1264 1264
1265 cpu = smp_processor_id(); 1265 cpu = smp_processor_id();
1266 1266
1267 pcr = pcr_ops->read(); 1267 pcr = pcr_ops->read(0);
1268 read_pic(pic); 1268 read_pic(pic);
1269 1269
1270 pr_info("\n"); 1270 pr_info("\n");
@@ -1306,7 +1306,7 @@ static int __kprobes perf_event_nmi_handler(struct notifier_block *self,
1306 * overflow so we don't lose any events. 1306 * overflow so we don't lose any events.
1307 */ 1307 */
1308 if (sparc_pmu->irq_bit) 1308 if (sparc_pmu->irq_bit)
1309 pcr_ops->write(cpuc->pcr); 1309 pcr_ops->write(0, cpuc->pcr);
1310 1310
1311 for (i = 0; i < cpuc->n_events; i++) { 1311 for (i = 0; i < cpuc->n_events; i++) {
1312 struct perf_event *event = cpuc->event[i]; 1312 struct perf_event *event = cpuc->event[i];