All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] powerpc/perf: Convert fsl_emb notifier to state machine callbacks
@ 2023-08-18  8:59 ` Christophe Leroy
  0 siblings, 0 replies; 6+ messages in thread
From: Christophe Leroy @ 2023-08-18  8:59 UTC (permalink / raw)
  To: Michael Ellerman, Nicholas Piggin
  Cc: Christophe Leroy, linux-kernel, linuxppc-dev, Peter Zijlstra,
	Thomas Gleixner, Arnd Bergmann

  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 3f6da3905398 ("perf:
Rework and fix the arch CPU-hotplug hooks")

So, apply same changes as commit 3f6da3905398 ("perf: Rework and fix
the arch CPU-hotplug hooks") then commit 57ecde42cc74 ("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: 3f6da3905398 ("perf: Rework and fix the arch CPU-hotplug hooks")
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Cc: Arnd Bergmann <arnd@arndb.de>
---
 arch/powerpc/perf/core-fsl-emb.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/arch/powerpc/perf/core-fsl-emb.c b/arch/powerpc/perf/core-fsl-emb.c
index ee721f420a7b..1a53ab08447c 100644
--- a/arch/powerpc/perf/core-fsl-emb.c
+++ b/arch/powerpc/perf/core-fsl-emb.c
@@ -645,7 +645,6 @@ static void perf_event_interrupt(struct pt_regs *regs)
 	struct cpu_hw_events *cpuhw = this_cpu_ptr(&cpu_hw_events);
 	struct perf_event *event;
 	unsigned long val;
-	int found = 0;
 
 	for (i = 0; i < ppmu->n_counter; ++i) {
 		event = cpuhw->event[i];
@@ -654,7 +653,6 @@ static void perf_event_interrupt(struct pt_regs *regs)
 		if ((int)val < 0) {
 			if (event) {
 				/* event has overflowed */
-				found = 1;
 				record_and_restart(event, val, regs);
 			} else {
 				/*
@@ -672,11 +670,13 @@ static void perf_event_interrupt(struct pt_regs *regs)
 	isync();
 }
 
-void hw_perf_event_setup(int cpu)
+static int fsl_emb_pmu_prepare_cpu(unsigned int cpu)
 {
 	struct cpu_hw_events *cpuhw = &per_cpu(cpu_hw_events, cpu);
 
 	memset(cpuhw, 0, sizeof(*cpuhw));
+
+	return 0;
 }
 
 int register_fsl_emb_pmu(struct fsl_emb_pmu *pmu)
@@ -689,6 +689,8 @@ int register_fsl_emb_pmu(struct fsl_emb_pmu *pmu)
 		pmu->name);
 
 	perf_pmu_register(&fsl_emb_pmu, "cpu", PERF_TYPE_RAW);
+	cpuhp_setup_state(CPUHP_PERF_POWER, "perf/powerpc:prepare",
+			  fsl_emb_pmu_prepare_cpu, NULL);
 
 	return 0;
 }
-- 
2.41.0


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH] powerpc/perf: Convert fsl_emb notifier to state machine callbacks
@ 2023-08-18  8:59 ` Christophe Leroy
  0 siblings, 0 replies; 6+ messages in thread
From: Christophe Leroy @ 2023-08-18  8:59 UTC (permalink / raw)
  To: Michael Ellerman, Nicholas Piggin
  Cc: Arnd Bergmann, Peter Zijlstra, linux-kernel, Thomas Gleixner,
	linuxppc-dev

  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 3f6da3905398 ("perf:
Rework and fix the arch CPU-hotplug hooks")

So, apply same changes as commit 3f6da3905398 ("perf: Rework and fix
the arch CPU-hotplug hooks") then commit 57ecde42cc74 ("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: 3f6da3905398 ("perf: Rework and fix the arch CPU-hotplug hooks")
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Cc: Arnd Bergmann <arnd@arndb.de>
---
 arch/powerpc/perf/core-fsl-emb.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/arch/powerpc/perf/core-fsl-emb.c b/arch/powerpc/perf/core-fsl-emb.c
index ee721f420a7b..1a53ab08447c 100644
--- a/arch/powerpc/perf/core-fsl-emb.c
+++ b/arch/powerpc/perf/core-fsl-emb.c
@@ -645,7 +645,6 @@ static void perf_event_interrupt(struct pt_regs *regs)
 	struct cpu_hw_events *cpuhw = this_cpu_ptr(&cpu_hw_events);
 	struct perf_event *event;
 	unsigned long val;
-	int found = 0;
 
 	for (i = 0; i < ppmu->n_counter; ++i) {
 		event = cpuhw->event[i];
@@ -654,7 +653,6 @@ static void perf_event_interrupt(struct pt_regs *regs)
 		if ((int)val < 0) {
 			if (event) {
 				/* event has overflowed */
-				found = 1;
 				record_and_restart(event, val, regs);
 			} else {
 				/*
@@ -672,11 +670,13 @@ static void perf_event_interrupt(struct pt_regs *regs)
 	isync();
 }
 
-void hw_perf_event_setup(int cpu)
+static int fsl_emb_pmu_prepare_cpu(unsigned int cpu)
 {
 	struct cpu_hw_events *cpuhw = &per_cpu(cpu_hw_events, cpu);
 
 	memset(cpuhw, 0, sizeof(*cpuhw));
+
+	return 0;
 }
 
 int register_fsl_emb_pmu(struct fsl_emb_pmu *pmu)
@@ -689,6 +689,8 @@ int register_fsl_emb_pmu(struct fsl_emb_pmu *pmu)
 		pmu->name);
 
 	perf_pmu_register(&fsl_emb_pmu, "cpu", PERF_TYPE_RAW);
+	cpuhp_setup_state(CPUHP_PERF_POWER, "perf/powerpc:prepare",
+			  fsl_emb_pmu_prepare_cpu, NULL);
 
 	return 0;
 }
-- 
2.41.0


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] powerpc/perf: Convert fsl_emb notifier to state machine callbacks
  2023-08-18  8:59 ` Christophe Leroy
@ 2023-08-22  5:18   ` Christophe Leroy
  -1 siblings, 0 replies; 6+ messages in thread
From: Christophe Leroy @ 2023-08-22  5:18 UTC (permalink / raw)
  To: Michael Ellerman, Nicholas Piggin
  Cc: linux-kernel, linuxppc-dev, Peter Zijlstra, Thomas Gleixner,
	Arnd Bergmann



Le 18/08/2023 à 10:59, Christophe Leroy a écrit :
>    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 3f6da3905398 ("perf:
> Rework and fix the arch CPU-hotplug hooks")
> 
> So, apply same changes as commit 3f6da3905398 ("perf: Rework and fix
> the arch CPU-hotplug hooks") then commit 57ecde42cc74 ("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: 3f6da3905398 ("perf: Rework and fix the arch CPU-hotplug hooks")
> Cc: Peter Zijlstra <peterz@infradead.org>
> Cc: Thomas Gleixner <tglx@linutronix.de>
> Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
> Cc: Arnd Bergmann <arnd@arndb.de>

Reported-by: kernel test robot <lkp@intel.com>
Closes: 
https://lore.kernel.org/oe-kbuild-all/202308220658.OR5hHFcD-lkp@intel.com/

> ---
>   arch/powerpc/perf/core-fsl-emb.c | 8 +++++---
>   1 file changed, 5 insertions(+), 3 deletions(-)
> 
> diff --git a/arch/powerpc/perf/core-fsl-emb.c b/arch/powerpc/perf/core-fsl-emb.c
> index ee721f420a7b..1a53ab08447c 100644
> --- a/arch/powerpc/perf/core-fsl-emb.c
> +++ b/arch/powerpc/perf/core-fsl-emb.c
> @@ -645,7 +645,6 @@ static void perf_event_interrupt(struct pt_regs *regs)
>   	struct cpu_hw_events *cpuhw = this_cpu_ptr(&cpu_hw_events);
>   	struct perf_event *event;
>   	unsigned long val;
> -	int found = 0;
>   
>   	for (i = 0; i < ppmu->n_counter; ++i) {
>   		event = cpuhw->event[i];
> @@ -654,7 +653,6 @@ static void perf_event_interrupt(struct pt_regs *regs)
>   		if ((int)val < 0) {
>   			if (event) {
>   				/* event has overflowed */
> -				found = 1;
>   				record_and_restart(event, val, regs);
>   			} else {
>   				/*
> @@ -672,11 +670,13 @@ static void perf_event_interrupt(struct pt_regs *regs)
>   	isync();
>   }
>   
> -void hw_perf_event_setup(int cpu)
> +static int fsl_emb_pmu_prepare_cpu(unsigned int cpu)
>   {
>   	struct cpu_hw_events *cpuhw = &per_cpu(cpu_hw_events, cpu);
>   
>   	memset(cpuhw, 0, sizeof(*cpuhw));
> +
> +	return 0;
>   }
>   
>   int register_fsl_emb_pmu(struct fsl_emb_pmu *pmu)
> @@ -689,6 +689,8 @@ int register_fsl_emb_pmu(struct fsl_emb_pmu *pmu)
>   		pmu->name);
>   
>   	perf_pmu_register(&fsl_emb_pmu, "cpu", PERF_TYPE_RAW);
> +	cpuhp_setup_state(CPUHP_PERF_POWER, "perf/powerpc:prepare",
> +			  fsl_emb_pmu_prepare_cpu, NULL);
>   
>   	return 0;
>   }

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] powerpc/perf: Convert fsl_emb notifier to state machine callbacks
@ 2023-08-22  5:18   ` Christophe Leroy
  0 siblings, 0 replies; 6+ messages in thread
From: Christophe Leroy @ 2023-08-22  5:18 UTC (permalink / raw)
  To: Michael Ellerman, Nicholas Piggin
  Cc: Peter Zijlstra, Thomas Gleixner, linuxppc-dev, linux-kernel,
	Arnd Bergmann



Le 18/08/2023 à 10:59, Christophe Leroy a écrit :
>    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 3f6da3905398 ("perf:
> Rework and fix the arch CPU-hotplug hooks")
> 
> So, apply same changes as commit 3f6da3905398 ("perf: Rework and fix
> the arch CPU-hotplug hooks") then commit 57ecde42cc74 ("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: 3f6da3905398 ("perf: Rework and fix the arch CPU-hotplug hooks")
> Cc: Peter Zijlstra <peterz@infradead.org>
> Cc: Thomas Gleixner <tglx@linutronix.de>
> Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
> Cc: Arnd Bergmann <arnd@arndb.de>

Reported-by: kernel test robot <lkp@intel.com>
Closes: 
https://lore.kernel.org/oe-kbuild-all/202308220658.OR5hHFcD-lkp@intel.com/

> ---
>   arch/powerpc/perf/core-fsl-emb.c | 8 +++++---
>   1 file changed, 5 insertions(+), 3 deletions(-)
> 
> diff --git a/arch/powerpc/perf/core-fsl-emb.c b/arch/powerpc/perf/core-fsl-emb.c
> index ee721f420a7b..1a53ab08447c 100644
> --- a/arch/powerpc/perf/core-fsl-emb.c
> +++ b/arch/powerpc/perf/core-fsl-emb.c
> @@ -645,7 +645,6 @@ static void perf_event_interrupt(struct pt_regs *regs)
>   	struct cpu_hw_events *cpuhw = this_cpu_ptr(&cpu_hw_events);
>   	struct perf_event *event;
>   	unsigned long val;
> -	int found = 0;
>   
>   	for (i = 0; i < ppmu->n_counter; ++i) {
>   		event = cpuhw->event[i];
> @@ -654,7 +653,6 @@ static void perf_event_interrupt(struct pt_regs *regs)
>   		if ((int)val < 0) {
>   			if (event) {
>   				/* event has overflowed */
> -				found = 1;
>   				record_and_restart(event, val, regs);
>   			} else {
>   				/*
> @@ -672,11 +670,13 @@ static void perf_event_interrupt(struct pt_regs *regs)
>   	isync();
>   }
>   
> -void hw_perf_event_setup(int cpu)
> +static int fsl_emb_pmu_prepare_cpu(unsigned int cpu)
>   {
>   	struct cpu_hw_events *cpuhw = &per_cpu(cpu_hw_events, cpu);
>   
>   	memset(cpuhw, 0, sizeof(*cpuhw));
> +
> +	return 0;
>   }
>   
>   int register_fsl_emb_pmu(struct fsl_emb_pmu *pmu)
> @@ -689,6 +689,8 @@ int register_fsl_emb_pmu(struct fsl_emb_pmu *pmu)
>   		pmu->name);
>   
>   	perf_pmu_register(&fsl_emb_pmu, "cpu", PERF_TYPE_RAW);
> +	cpuhp_setup_state(CPUHP_PERF_POWER, "perf/powerpc:prepare",
> +			  fsl_emb_pmu_prepare_cpu, NULL);
>   
>   	return 0;
>   }

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] powerpc/perf: Convert fsl_emb notifier to state machine callbacks
  2023-08-18  8:59 ` Christophe Leroy
@ 2023-08-23 11:55   ` Michael Ellerman
  -1 siblings, 0 replies; 6+ messages in thread
From: Michael Ellerman @ 2023-08-23 11:55 UTC (permalink / raw)
  To: Nicholas Piggin, Christophe Leroy
  Cc: linux-kernel, linuxppc-dev, Peter Zijlstra, Thomas Gleixner,
	Arnd Bergmann

On Fri, 18 Aug 2023 10:59:44 +0200, Christophe Leroy wrote:
>   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 3f6da3905398 ("perf:
> Rework and fix the arch CPU-hotplug hooks")
> 
> [...]

Applied to powerpc/next.

[1/1] powerpc/perf: Convert fsl_emb notifier to state machine callbacks
      https://git.kernel.org/powerpc/c/34daf445f82bd3a4df852bb5f1dffd792ac830a0

cheers

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] powerpc/perf: Convert fsl_emb notifier to state machine callbacks
@ 2023-08-23 11:55   ` Michael Ellerman
  0 siblings, 0 replies; 6+ messages in thread
From: Michael Ellerman @ 2023-08-23 11:55 UTC (permalink / raw)
  To: Nicholas Piggin, Christophe Leroy
  Cc: Peter Zijlstra, Thomas Gleixner, linuxppc-dev, linux-kernel,
	Arnd Bergmann

On Fri, 18 Aug 2023 10:59:44 +0200, Christophe Leroy wrote:
>   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 3f6da3905398 ("perf:
> Rework and fix the arch CPU-hotplug hooks")
> 
> [...]

Applied to powerpc/next.

[1/1] powerpc/perf: Convert fsl_emb notifier to state machine callbacks
      https://git.kernel.org/powerpc/c/34daf445f82bd3a4df852bb5f1dffd792ac830a0

cheers

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2023-08-23 12:10 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-08-18  8:59 [PATCH] powerpc/perf: Convert fsl_emb notifier to state machine callbacks Christophe Leroy
2023-08-18  8:59 ` Christophe Leroy
2023-08-22  5:18 ` Christophe Leroy
2023-08-22  5:18   ` Christophe Leroy
2023-08-23 11:55 ` Michael Ellerman
2023-08-23 11:55   ` Michael Ellerman

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.