linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] powerpc: Add doorbell tracepoints
@ 2018-10-03  0:29 Anton Blanchard
  2018-10-03  3:48 ` Nicholas Piggin
  2018-10-04  5:41 ` Russell Currey
  0 siblings, 2 replies; 6+ messages in thread
From: Anton Blanchard @ 2018-10-03  0:29 UTC (permalink / raw)
  To: benh, paulus, mpe, npiggin; +Cc: linuxppc-dev

When analysing sources of OS jitter, I noticed that doorbells cannot be
traced.

Signed-off-by: Anton Blanchard <anton@ozlabs.org>
---
 arch/powerpc/include/asm/trace.h | 16 ++++++++++++++++
 arch/powerpc/kernel/dbell.c      |  3 +++
 2 files changed, 19 insertions(+)

diff --git a/arch/powerpc/include/asm/trace.h b/arch/powerpc/include/asm/trace.h
index d018e8602694..eb9aa0f1561e 100644
--- a/arch/powerpc/include/asm/trace.h
+++ b/arch/powerpc/include/asm/trace.h
@@ -54,6 +54,22 @@ DEFINE_EVENT(ppc64_interrupt_class, timer_interrupt_exit,
 	TP_ARGS(regs)
 );
 
+#ifdef CONFIG_PPC_DOORBELL
+DEFINE_EVENT(ppc64_interrupt_class, doorbell_exception_entry,
+
+	TP_PROTO(struct pt_regs *regs),
+
+	TP_ARGS(regs)
+);
+
+DEFINE_EVENT(ppc64_interrupt_class, doorbell_exception_exit,
+
+	TP_PROTO(struct pt_regs *regs),
+
+	TP_ARGS(regs)
+);
+#endif
+
 #ifdef CONFIG_PPC_PSERIES
 extern int hcall_tracepoint_regfunc(void);
 extern void hcall_tracepoint_unregfunc(void);
diff --git a/arch/powerpc/kernel/dbell.c b/arch/powerpc/kernel/dbell.c
index b6fe883b1016..5ec3b3835925 100644
--- a/arch/powerpc/kernel/dbell.c
+++ b/arch/powerpc/kernel/dbell.c
@@ -18,6 +18,7 @@
 #include <asm/dbell.h>
 #include <asm/irq_regs.h>
 #include <asm/kvm_ppc.h>
+#include <asm/trace.h>
 
 #ifdef CONFIG_SMP
 
@@ -81,6 +82,7 @@ void doorbell_exception(struct pt_regs *regs)
 	struct pt_regs *old_regs = set_irq_regs(regs);
 
 	irq_enter();
+	trace_doorbell_entry(regs);
 
 	ppc_msgsync();
 
@@ -91,6 +93,7 @@ void doorbell_exception(struct pt_regs *regs)
 
 	smp_ipi_demux_relaxed(); /* already performed the barrier */
 
+	trace_doorbell_exit(regs);
 	irq_exit();
 	set_irq_regs(old_regs);
 }
-- 
2.17.1


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

* Re: [PATCH] powerpc: Add doorbell tracepoints
  2018-10-03  0:29 Anton Blanchard
@ 2018-10-03  3:48 ` Nicholas Piggin
  2018-10-04  5:41 ` Russell Currey
  1 sibling, 0 replies; 6+ messages in thread
From: Nicholas Piggin @ 2018-10-03  3:48 UTC (permalink / raw)
  To: Anton Blanchard; +Cc: paulus, linuxppc-dev

On Wed,  3 Oct 2018 10:29:57 +1000
Anton Blanchard <anton@ozlabs.org> wrote:

> When analysing sources of OS jitter, I noticed that doorbells cannot be
> traced.
> 
> Signed-off-by: Anton Blanchard <anton@ozlabs.org>

Acked-by: Nicholas Piggin <npiggin@gmail.com>

> ---
>  arch/powerpc/include/asm/trace.h | 16 ++++++++++++++++
>  arch/powerpc/kernel/dbell.c      |  3 +++
>  2 files changed, 19 insertions(+)
> 
> diff --git a/arch/powerpc/include/asm/trace.h b/arch/powerpc/include/asm/trace.h
> index d018e8602694..eb9aa0f1561e 100644
> --- a/arch/powerpc/include/asm/trace.h
> +++ b/arch/powerpc/include/asm/trace.h
> @@ -54,6 +54,22 @@ DEFINE_EVENT(ppc64_interrupt_class, timer_interrupt_exit,
>  	TP_ARGS(regs)
>  );
>  
> +#ifdef CONFIG_PPC_DOORBELL
> +DEFINE_EVENT(ppc64_interrupt_class, doorbell_exception_entry,
> +
> +	TP_PROTO(struct pt_regs *regs),
> +
> +	TP_ARGS(regs)
> +);
> +
> +DEFINE_EVENT(ppc64_interrupt_class, doorbell_exception_exit,
> +
> +	TP_PROTO(struct pt_regs *regs),
> +
> +	TP_ARGS(regs)
> +);
> +#endif
> +
>  #ifdef CONFIG_PPC_PSERIES
>  extern int hcall_tracepoint_regfunc(void);
>  extern void hcall_tracepoint_unregfunc(void);
> diff --git a/arch/powerpc/kernel/dbell.c b/arch/powerpc/kernel/dbell.c
> index b6fe883b1016..5ec3b3835925 100644
> --- a/arch/powerpc/kernel/dbell.c
> +++ b/arch/powerpc/kernel/dbell.c
> @@ -18,6 +18,7 @@
>  #include <asm/dbell.h>
>  #include <asm/irq_regs.h>
>  #include <asm/kvm_ppc.h>
> +#include <asm/trace.h>
>  
>  #ifdef CONFIG_SMP
>  
> @@ -81,6 +82,7 @@ void doorbell_exception(struct pt_regs *regs)
>  	struct pt_regs *old_regs = set_irq_regs(regs);
>  
>  	irq_enter();
> +	trace_doorbell_entry(regs);
>  
>  	ppc_msgsync();
>  
> @@ -91,6 +93,7 @@ void doorbell_exception(struct pt_regs *regs)
>  
>  	smp_ipi_demux_relaxed(); /* already performed the barrier */
>  
> +	trace_doorbell_exit(regs);
>  	irq_exit();
>  	set_irq_regs(old_regs);
>  }
> -- 
> 2.17.1
> 


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

* Re: [PATCH] powerpc: Add doorbell tracepoints
  2018-10-03  0:29 Anton Blanchard
  2018-10-03  3:48 ` Nicholas Piggin
@ 2018-10-04  5:41 ` Russell Currey
  2018-10-04  6:16   ` Anton Blanchard
  1 sibling, 1 reply; 6+ messages in thread
From: Russell Currey @ 2018-10-04  5:41 UTC (permalink / raw)
  To: Anton Blanchard, benh, paulus, mpe, npiggin; +Cc: linuxppc-dev

On Wed, 2018-10-03 at 10:29 +1000, Anton Blanchard wrote:
> When analysing sources of OS jitter, I noticed that doorbells cannot be
> traced.
> 
> Signed-off-by: Anton Blanchard <anton@ozlabs.org>

Hi Anton,

snowpatch builds failed for this patch on all 64-bit configurations (ppc64e, ppc64
and ppc64le) with the following:

arch/powerpc/kernel/dbell.c:85:9: error: undefined identifier
'trace_doorbell_entry'
arch/powerpc/kernel/dbell.c:96:9: error: undefined identifier
'trace_doorbell_exit'
./arch/powerpc/include/asm/spinlock.h:171:9: warning: context imbalance in
'key_user_put' - unexpected unlock
arch/powerpc/kernel/dbell.c: In function 'doorbell_exception':
arch/powerpc/kernel/dbell.c:85:2: error: implicit declaration of function
'trace_doorbell_entry'; did you mean 'trace_irq_entry'? [-Werror=implicit-
function-declaration]
  trace_doorbell_entry(regs);
  ^~~~~~~~~~~~~~~~~~~~
  trace_irq_entry
arch/powerpc/kernel/dbell.c:96:2: error: implicit declaration of function
'trace_doorbell_exit'; did you mean 'trace_irq_exit'? [-Werror=implicit-function-
declaration]
  trace_doorbell_exit(regs);
  ^~~~~~~~~~~~~~~~~~~
  trace_irq_exit
cc1: all warnings being treated as errors
scripts/Makefile.build:305: recipe for target 'arch/powerpc/kernel/dbell.o' failed
make[1]: *** [arch/powerpc/kernel/dbell.o] Error 1
Makefile:1060: recipe for target 'arch/powerpc/kernel' failed

So does something else need to check for CONFIG_PPC_DOORBELL maybe?

You can see the failures here: http://patchwork.ozlabs.org/patch/978088/ - output
in build_new.log (I know it's not pretty in there yet, you can search for "Error
1" to find the build failure)

- Russell



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

* Re: [PATCH] powerpc: Add doorbell tracepoints
  2018-10-04  5:41 ` Russell Currey
@ 2018-10-04  6:16   ` Anton Blanchard
  0 siblings, 0 replies; 6+ messages in thread
From: Anton Blanchard @ 2018-10-04  6:16 UTC (permalink / raw)
  To: Russell Currey; +Cc: paulus, linuxppc-dev, npiggin

Hi Russell,

> snowpatch builds failed for this patch on all 64-bit configurations
> (ppc64e, ppc64 and ppc64le) with the following:

Thanks! Stupid bug on my part, need more quilt ref. Update to follow.

Anton

> arch/powerpc/kernel/dbell.c:85:9: error: undefined identifier
> 'trace_doorbell_entry'
> arch/powerpc/kernel/dbell.c:96:9: error: undefined identifier
> 'trace_doorbell_exit'
> ./arch/powerpc/include/asm/spinlock.h:171:9: warning: context
> imbalance in 'key_user_put' - unexpected unlock
> arch/powerpc/kernel/dbell.c: In function 'doorbell_exception':
> arch/powerpc/kernel/dbell.c:85:2: error: implicit declaration of
> function 'trace_doorbell_entry'; did you mean 'trace_irq_entry'?
> [-Werror=implicit- function-declaration]
>   trace_doorbell_entry(regs);
>   ^~~~~~~~~~~~~~~~~~~~
>   trace_irq_entry
> arch/powerpc/kernel/dbell.c:96:2: error: implicit declaration of
> function 'trace_doorbell_exit'; did you mean 'trace_irq_exit'?
> [-Werror=implicit-function- declaration]
>   trace_doorbell_exit(regs);
>   ^~~~~~~~~~~~~~~~~~~
>   trace_irq_exit
> cc1: all warnings being treated as errors
> scripts/Makefile.build:305: recipe for target
> 'arch/powerpc/kernel/dbell.o' failed make[1]: ***
> [arch/powerpc/kernel/dbell.o] Error 1 Makefile:1060: recipe for
> target 'arch/powerpc/kernel' failed
> 
> So does something else need to check for CONFIG_PPC_DOORBELL maybe?
> 
> You can see the failures here:
> http://patchwork.ozlabs.org/patch/978088/ - output in build_new.log
> (I know it's not pretty in there yet, you can search for "Error 1" to
> find the build failure)
> 
> - Russell
> 
> 


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

* [PATCH] powerpc: Add doorbell tracepoints
@ 2018-10-04  6:23 Anton Blanchard
  2019-05-03  6:59 ` Michael Ellerman
  0 siblings, 1 reply; 6+ messages in thread
From: Anton Blanchard @ 2018-10-04  6:23 UTC (permalink / raw)
  To: benh, paulus, mpe, npiggin, ruscur; +Cc: linuxppc-dev

When analysing sources of OS jitter, I noticed that doorbells cannot be
traced.

Signed-off-by: Anton Blanchard <anton@ozlabs.org>
---
 arch/powerpc/include/asm/trace.h | 16 ++++++++++++++++
 arch/powerpc/kernel/dbell.c      |  3 +++
 2 files changed, 19 insertions(+)

diff --git a/arch/powerpc/include/asm/trace.h b/arch/powerpc/include/asm/trace.h
index d018e8602694..2f1f8cd7b6c8 100644
--- a/arch/powerpc/include/asm/trace.h
+++ b/arch/powerpc/include/asm/trace.h
@@ -54,6 +54,22 @@ DEFINE_EVENT(ppc64_interrupt_class, timer_interrupt_exit,
 	TP_ARGS(regs)
 );
 
+#ifdef CONFIG_PPC_DOORBELL
+DEFINE_EVENT(ppc64_interrupt_class, doorbell_entry,
+
+	TP_PROTO(struct pt_regs *regs),
+
+	TP_ARGS(regs)
+);
+
+DEFINE_EVENT(ppc64_interrupt_class, doorbell_exit,
+
+	TP_PROTO(struct pt_regs *regs),
+
+	TP_ARGS(regs)
+);
+#endif
+
 #ifdef CONFIG_PPC_PSERIES
 extern int hcall_tracepoint_regfunc(void);
 extern void hcall_tracepoint_unregfunc(void);
diff --git a/arch/powerpc/kernel/dbell.c b/arch/powerpc/kernel/dbell.c
index b6fe883b1016..5ec3b3835925 100644
--- a/arch/powerpc/kernel/dbell.c
+++ b/arch/powerpc/kernel/dbell.c
@@ -18,6 +18,7 @@
 #include <asm/dbell.h>
 #include <asm/irq_regs.h>
 #include <asm/kvm_ppc.h>
+#include <asm/trace.h>
 
 #ifdef CONFIG_SMP
 
@@ -81,6 +82,7 @@ void doorbell_exception(struct pt_regs *regs)
 	struct pt_regs *old_regs = set_irq_regs(regs);
 
 	irq_enter();
+	trace_doorbell_entry(regs);
 
 	ppc_msgsync();
 
@@ -91,6 +93,7 @@ void doorbell_exception(struct pt_regs *regs)
 
 	smp_ipi_demux_relaxed(); /* already performed the barrier */
 
+	trace_doorbell_exit(regs);
 	irq_exit();
 	set_irq_regs(old_regs);
 }
-- 
2.17.1


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

* Re: [PATCH] powerpc: Add doorbell tracepoints
  2018-10-04  6:23 [PATCH] powerpc: Add doorbell tracepoints Anton Blanchard
@ 2019-05-03  6:59 ` Michael Ellerman
  0 siblings, 0 replies; 6+ messages in thread
From: Michael Ellerman @ 2019-05-03  6:59 UTC (permalink / raw)
  To: Anton Blanchard, benh, paulus, npiggin, ruscur; +Cc: linuxppc-dev

On Thu, 2018-10-04 at 06:23:37 UTC, Anton Blanchard wrote:
> When analysing sources of OS jitter, I noticed that doorbells cannot be
> traced.
> 
> Signed-off-by: Anton Blanchard <anton@ozlabs.org>

Applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/5b2a15296210d3b70e06d0f09a8e701f

cheers

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

end of thread, other threads:[~2019-05-03  8:01 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-10-04  6:23 [PATCH] powerpc: Add doorbell tracepoints Anton Blanchard
2019-05-03  6:59 ` Michael Ellerman
  -- strict thread matches above, loose matches on Subject: below --
2018-10-03  0:29 Anton Blanchard
2018-10-03  3:48 ` Nicholas Piggin
2018-10-04  5:41 ` Russell Currey
2018-10-04  6:16   ` Anton Blanchard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).