Skip to content

Commit 34daf44

Browse files
chleroympe
authored andcommitted
powerpc/perf: Convert fsl_emb notifier to state machine callbacks
CC arch/powerpc/perf/core-fsl-emb.o arch/powerpc/perf/core-fsl-emb.c:675:6: error: no previous prototype for 'hw_perf_event_setup' [-Werror=missing-prototypes] 675 | void hw_perf_event_setup(int cpu) | ^~~~~~~~~~~~~~~~~~~ Looks like fsl_emb was completely missed by commit 3f6da39 ("perf: Rework and fix the arch CPU-hotplug hooks") So, apply same changes as commit 3f6da39 ("perf: Rework and fix the arch CPU-hotplug hooks") then commit 57ecde4 ("powerpc/perf: Convert book3s notifier to state machine callbacks") While at it, also fix following error: arch/powerpc/perf/core-fsl-emb.c: In function 'perf_event_interrupt': arch/powerpc/perf/core-fsl-emb.c:648:13: error: variable 'found' set but not used [-Werror=unused-but-set-variable] 648 | int found = 0; | ^~~~~ Fixes: 3f6da39 ("perf: Rework and fix the arch CPU-hotplug hooks") Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://msgid.link/603e1facb32608f88f40b7d7b9094adc50e7b2dc.1692349125.git.christophe.leroy@csgroup.eu
1 parent 77583f7 commit 34daf44

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

arch/powerpc/perf/core-fsl-emb.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -645,7 +645,6 @@ static void perf_event_interrupt(struct pt_regs *regs)
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 @@ static void perf_event_interrupt(struct pt_regs *regs)
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 @@ static void perf_event_interrupt(struct pt_regs *regs)
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 @@ int register_fsl_emb_pmu(struct fsl_emb_pmu *pmu)
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
}

0 commit comments

Comments
 (0)