linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] clocksource/arm_arch_timer: Don't trace count reader functions
@ 2019-05-24  9:10 Julien Thierry
  2019-05-24  9:53 ` Marc Zyngier
  2019-05-24 13:36 ` Steven Rostedt
  0 siblings, 2 replies; 4+ messages in thread
From: Julien Thierry @ 2019-05-24  9:10 UTC (permalink / raw)
  To: linux-arm-kernel
  Cc: linux-kernel, Julien Thierry, Marc Zyngier, Mark Rutland,
	Daniel Lezcano, Thomas Gleixner, Steven Rostedt

With v5.2-rc1, The ftrace functions_graph tracer locks up whenever it is
enabled on arm64.

Since commit 0ea415390cd3 ("clocksource/arm_arch_timer: Use
arch_timer_read_counter to access stable counters") a function pointer
is consistently used to read the counter instead of potentially
referencing an inlinable function.

The graph tacers relies on accessing the timer counters to compute the
time spent in functions which causes the lockup when attempting to trace
these code paths.

Annontate the arm arch timer counter accessors as notrace.

Fixes: 0ea415390cd3 ("clocksource/arm_arch_timer: Use
       arch_timer_read_counter to access stable counters")
Signed-off-by: Julien Thierry <julien.thierry@arm.com>
Cc: Marc Zyngier <marc.zyngier@arm.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Steven Rostedt <rostedt@goodmis.org>
---
 drivers/clocksource/arm_arch_timer.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/clocksource/arm_arch_timer.c b/drivers/clocksource/arm_arch_timer.c
index b2a951a..5c69c9a 100644
--- a/drivers/clocksource/arm_arch_timer.c
+++ b/drivers/clocksource/arm_arch_timer.c
@@ -149,22 +149,22 @@ u32 arch_timer_reg_read(int access, enum arch_timer_reg reg,
 	return val;
 }
 
-static u64 arch_counter_get_cntpct_stable(void)
+static notrace u64 arch_counter_get_cntpct_stable(void)
 {
 	return __arch_counter_get_cntpct_stable();
 }
 
-static u64 arch_counter_get_cntpct(void)
+static notrace u64 arch_counter_get_cntpct(void)
 {
 	return __arch_counter_get_cntpct();
 }
 
-static u64 arch_counter_get_cntvct_stable(void)
+static notrace u64 arch_counter_get_cntvct_stable(void)
 {
 	return __arch_counter_get_cntvct_stable();
 }
 
-static u64 arch_counter_get_cntvct(void)
+static notrace u64 arch_counter_get_cntvct(void)
 {
 	return __arch_counter_get_cntvct();
 }
-- 
1.9.1


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

* Re: [PATCH] clocksource/arm_arch_timer: Don't trace count reader functions
  2019-05-24  9:10 [PATCH] clocksource/arm_arch_timer: Don't trace count reader functions Julien Thierry
@ 2019-05-24  9:53 ` Marc Zyngier
  2019-05-24 10:42   ` Daniel Lezcano
  2019-05-24 13:36 ` Steven Rostedt
  1 sibling, 1 reply; 4+ messages in thread
From: Marc Zyngier @ 2019-05-24  9:53 UTC (permalink / raw)
  To: Julien Thierry, linux-arm-kernel
  Cc: linux-kernel, Mark Rutland, Daniel Lezcano, Thomas Gleixner,
	Steven Rostedt

On 24/05/2019 10:10, Julien Thierry wrote:
> With v5.2-rc1, The ftrace functions_graph tracer locks up whenever it is
> enabled on arm64.
> 
> Since commit 0ea415390cd3 ("clocksource/arm_arch_timer: Use
> arch_timer_read_counter to access stable counters") a function pointer
> is consistently used to read the counter instead of potentially
> referencing an inlinable function.
> 
> The graph tacers relies on accessing the timer counters to compute the

nit: tracers

> time spent in functions which causes the lockup when attempting to trace
> these code paths.
> 
> Annontate the arm arch timer counter accessors as notrace.

nit: Annotate

> 
> Fixes: 0ea415390cd3 ("clocksource/arm_arch_timer: Use
>        arch_timer_read_counter to access stable counters")
> Signed-off-by: Julien Thierry <julien.thierry@arm.com>
> Cc: Marc Zyngier <marc.zyngier@arm.com>
> Cc: Mark Rutland <mark.rutland@arm.com>
> Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
> Cc: Thomas Gleixner <tglx@linutronix.de>
> Cc: Steven Rostedt <rostedt@goodmis.org>
> ---
>  drivers/clocksource/arm_arch_timer.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/clocksource/arm_arch_timer.c b/drivers/clocksource/arm_arch_timer.c
> index b2a951a..5c69c9a 100644
> --- a/drivers/clocksource/arm_arch_timer.c
> +++ b/drivers/clocksource/arm_arch_timer.c
> @@ -149,22 +149,22 @@ u32 arch_timer_reg_read(int access, enum arch_timer_reg reg,
>  	return val;
>  }
>  
> -static u64 arch_counter_get_cntpct_stable(void)
> +static notrace u64 arch_counter_get_cntpct_stable(void)
>  {
>  	return __arch_counter_get_cntpct_stable();
>  }
>  
> -static u64 arch_counter_get_cntpct(void)
> +static notrace u64 arch_counter_get_cntpct(void)
>  {
>  	return __arch_counter_get_cntpct();
>  }
>  
> -static u64 arch_counter_get_cntvct_stable(void)
> +static notrace u64 arch_counter_get_cntvct_stable(void)
>  {
>  	return __arch_counter_get_cntvct_stable();
>  }
>  
> -static u64 arch_counter_get_cntvct(void)
> +static notrace u64 arch_counter_get_cntvct(void)
>  {
>  	return __arch_counter_get_cntvct();
>  }
> 

Well spotted, thanks Julien.

Acked-by: Marc Zyngier <marc.zyngier@arm.com>

Daniel, can you please pick this up for the next batch of clocksource fixes?

Thanks,

	M.
-- 
Jazz is not dead. It just smells funny...

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

* Re: [PATCH] clocksource/arm_arch_timer: Don't trace count reader functions
  2019-05-24  9:53 ` Marc Zyngier
@ 2019-05-24 10:42   ` Daniel Lezcano
  0 siblings, 0 replies; 4+ messages in thread
From: Daniel Lezcano @ 2019-05-24 10:42 UTC (permalink / raw)
  To: Marc Zyngier, Julien Thierry, linux-arm-kernel
  Cc: linux-kernel, Mark Rutland, Thomas Gleixner, Steven Rostedt

On 24/05/2019 11:53, Marc Zyngier wrote:
> On 24/05/2019 10:10, Julien Thierry wrote:
>> With v5.2-rc1, The ftrace functions_graph tracer locks up whenever it is
>> enabled on arm64.
>>
>> Since commit 0ea415390cd3 ("clocksource/arm_arch_timer: Use
>> arch_timer_read_counter to access stable counters") a function pointer
>> is consistently used to read the counter instead of potentially
>> referencing an inlinable function.
>>
>> The graph tacers relies on accessing the timer counters to compute the
> 
> nit: tracers
> 
>> time spent in functions which causes the lockup when attempting to trace
>> these code paths.
>>
>> Annontate the arm arch timer counter accessors as notrace.
> 
> nit: Annotate
> 
>>
>> Fixes: 0ea415390cd3 ("clocksource/arm_arch_timer: Use
>>        arch_timer_read_counter to access stable counters")
>> Signed-off-by: Julien Thierry <julien.thierry@arm.com>
>> Cc: Marc Zyngier <marc.zyngier@arm.com>
>> Cc: Mark Rutland <mark.rutland@arm.com>
>> Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
>> Cc: Thomas Gleixner <tglx@linutronix.de>
>> Cc: Steven Rostedt <rostedt@goodmis.org>
>> ---

[ ... ]

> Well spotted, thanks Julien.
> 
> Acked-by: Marc Zyngier <marc.zyngier@arm.com>
> 
> Daniel, can you please pick this up for the next batch of clocksource fixes?

Sure.

I will take care of fixing the comments, no need to resend.

Thanks

  -- Daniel


-- 
 <http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs

Follow Linaro:  <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog


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

* Re: [PATCH] clocksource/arm_arch_timer: Don't trace count reader functions
  2019-05-24  9:10 [PATCH] clocksource/arm_arch_timer: Don't trace count reader functions Julien Thierry
  2019-05-24  9:53 ` Marc Zyngier
@ 2019-05-24 13:36 ` Steven Rostedt
  1 sibling, 0 replies; 4+ messages in thread
From: Steven Rostedt @ 2019-05-24 13:36 UTC (permalink / raw)
  To: Julien Thierry
  Cc: linux-arm-kernel, linux-kernel, Marc Zyngier, Mark Rutland,
	Daniel Lezcano, Thomas Gleixner

On Fri, 24 May 2019 10:10:25 +0100
Julien Thierry <julien.thierry@arm.com> wrote:

> With v5.2-rc1, The ftrace functions_graph tracer locks up whenever it is
> enabled on arm64.
> 
> Since commit 0ea415390cd3 ("clocksource/arm_arch_timer: Use
> arch_timer_read_counter to access stable counters") a function pointer
> is consistently used to read the counter instead of potentially
> referencing an inlinable function.
> 
> The graph tacers relies on accessing the timer counters to compute the
> time spent in functions which causes the lockup when attempting to trace
> these code paths.
> 
> Annontate the arm arch timer counter accessors as notrace.
> 
> Fixes: 0ea415390cd3 ("clocksource/arm_arch_timer: Use
>        arch_timer_read_counter to access stable counters")
> Signed-off-by: Julien Thierry <julien.thierry@arm.com>
> Cc: Marc Zyngier <marc.zyngier@arm.com>
> Cc: Mark Rutland <mark.rutland@arm.com>
> Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
> Cc: Thomas Gleixner <tglx@linutronix.de>
> Cc: Steven Rostedt <rostedt@goodmis.org>
> ---
>  drivers/clocksource/arm_arch_timer.c | 8 ++++----

Is there any reason to function trace any of the functions in this
file? If not, then I would suggest removing all the "notrace"
annotations from this file, and add in the Makefile for this directory:

CFLAGS_REMOVE_arm_arch_timer.o = $(CC_FLAGS_FTRACE)

Hmm, I need to go through all the Makefiles in the kernel and remove
the "-pg" and replace it with "$(CC_FLAGS_FTRACE)" as that's the safer
way of doing it now.

-- Steve


>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/clocksource/arm_arch_timer.c b/drivers/clocksource/arm_arch_timer.c
> index b2a951a..5c69c9a 100644
> --- a/drivers/clocksource/arm_arch_timer.c
> +++ b/drivers/clocksource/arm_arch_timer.c
> @@ -149,22 +149,22 @@ u32 arch_timer_reg_read(int access, enum arch_timer_reg reg,
>  	return val;
>  }
>  
> -static u64 arch_counter_get_cntpct_stable(void)
> +static notrace u64 arch_counter_get_cntpct_stable(void)
>  {
>  	return __arch_counter_get_cntpct_stable();
>  }
>  
> -static u64 arch_counter_get_cntpct(void)
> +static notrace u64 arch_counter_get_cntpct(void)
>  {
>  	return __arch_counter_get_cntpct();
>  }
>  
> -static u64 arch_counter_get_cntvct_stable(void)
> +static notrace u64 arch_counter_get_cntvct_stable(void)
>  {
>  	return __arch_counter_get_cntvct_stable();
>  }
>  
> -static u64 arch_counter_get_cntvct(void)
> +static notrace u64 arch_counter_get_cntvct(void)
>  {
>  	return __arch_counter_get_cntvct();
>  }


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

end of thread, other threads:[~2019-05-24 13:36 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-24  9:10 [PATCH] clocksource/arm_arch_timer: Don't trace count reader functions Julien Thierry
2019-05-24  9:53 ` Marc Zyngier
2019-05-24 10:42   ` Daniel Lezcano
2019-05-24 13:36 ` Steven Rostedt

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).