hc
2024-12-19 9370bb92b2d16684ee45cf24e879c93c509162da
kernel/arch/powerpc/perf/core-fsl-emb.c
....@@ -645,7 +645,6 @@
645645 struct cpu_hw_events *cpuhw = this_cpu_ptr(&cpu_hw_events);
646646 struct perf_event *event;
647647 unsigned long val;
648
- int found = 0;
649648
650649 for (i = 0; i < ppmu->n_counter; ++i) {
651650 event = cpuhw->event[i];
....@@ -654,7 +653,6 @@
654653 if ((int)val < 0) {
655654 if (event) {
656655 /* event has overflowed */
657
- found = 1;
658656 record_and_restart(event, val, regs);
659657 } else {
660658 /*
....@@ -672,11 +670,13 @@
672670 isync();
673671 }
674672
675
-void hw_perf_event_setup(int cpu)
673
+static int fsl_emb_pmu_prepare_cpu(unsigned int cpu)
676674 {
677675 struct cpu_hw_events *cpuhw = &per_cpu(cpu_hw_events, cpu);
678676
679677 memset(cpuhw, 0, sizeof(*cpuhw));
678
+
679
+ return 0;
680680 }
681681
682682 int register_fsl_emb_pmu(struct fsl_emb_pmu *pmu)
....@@ -689,6 +689,8 @@
689689 pmu->name);
690690
691691 perf_pmu_register(&fsl_emb_pmu, "cpu", PERF_TYPE_RAW);
692
+ cpuhp_setup_state(CPUHP_PERF_POWER, "perf/powerpc:prepare",
693
+ fsl_emb_pmu_prepare_cpu, NULL);
692694
693695 return 0;
694696 }