linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] clocksource: mark sched_clock_read functions notrace
@ 2015-01-30 18:40 Nathan Sullivan
  2015-02-02 13:13 ` Maxime Coquelin
  2015-02-03 20:13 ` Josh Cartwright
  0 siblings, 2 replies; 5+ messages in thread
From: Nathan Sullivan @ 2015-01-30 18:40 UTC (permalink / raw)
  To: linux-arm-kernel

These functions will be called by ftrace code when function_graph is
used, so mark them notrace to avoid infinite recursion.

Signed-off-by: Nathan Sullivan <nathan.sullivan@ni.com>
---
 drivers/clocksource/arm_arch_timer.c    |    2 +-
 drivers/clocksource/arm_global_timer.c  |    2 +-
 drivers/clocksource/samsung_pwm_timer.c |    2 +-
 drivers/clocksource/timer-prima2.c      |    2 +-
 drivers/clocksource/timer-sun5i.c       |    2 +-
 5 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/clocksource/arm_arch_timer.c b/drivers/clocksource/arm_arch_timer.c
index 095c177..df5af55 100644
--- a/drivers/clocksource/arm_arch_timer.c
+++ b/drivers/clocksource/arm_arch_timer.c
@@ -405,7 +405,7 @@ u32 arch_timer_get_rate(void)
 	return arch_timer_rate;
 }
 
-static u64 arch_counter_get_cntvct_mem(void)
+static u64 notrace arch_counter_get_cntvct_mem(void)
 {
 	u32 vct_lo, vct_hi, tmp_hi;
 
diff --git a/drivers/clocksource/arm_global_timer.c b/drivers/clocksource/arm_global_timer.c
index e683377..b4e221a 100644
--- a/drivers/clocksource/arm_global_timer.c
+++ b/drivers/clocksource/arm_global_timer.c
@@ -60,7 +60,7 @@ static struct clock_event_device __percpu *gt_evt;
  *  different to the 32-bit upper value read previously, go back to step 2.
  *  Otherwise the 64-bit timer counter value is correct.
  */
-static u64 gt_counter_read(void)
+static u64 notrace gt_counter_read(void)
 {
 	u64 counter;
 	u32 lower;
diff --git a/drivers/clocksource/samsung_pwm_timer.c b/drivers/clocksource/samsung_pwm_timer.c
index 5645cfc..09f4ee3 100644
--- a/drivers/clocksource/samsung_pwm_timer.c
+++ b/drivers/clocksource/samsung_pwm_timer.c
@@ -310,7 +310,7 @@ static void samsung_clocksource_resume(struct clocksource *cs)
 	samsung_time_start(pwm.source_id, true);
 }
 
-static cycle_t samsung_clocksource_read(struct clocksource *c)
+static cycle_t notrace samsung_clocksource_read(struct clocksource *c)
 {
 	return ~readl_relaxed(pwm.source_reg);
 }
diff --git a/drivers/clocksource/timer-prima2.c b/drivers/clocksource/timer-prima2.c
index ce18d57..4410817 100644
--- a/drivers/clocksource/timer-prima2.c
+++ b/drivers/clocksource/timer-prima2.c
@@ -73,7 +73,7 @@ static irqreturn_t sirfsoc_timer_interrupt(int irq, void *dev_id)
 }
 
 /* read 64-bit timer counter */
-static cycle_t sirfsoc_timer_read(struct clocksource *cs)
+static cycle_t notrace sirfsoc_timer_read(struct clocksource *cs)
 {
 	u64 cycles;
 
diff --git a/drivers/clocksource/timer-sun5i.c b/drivers/clocksource/timer-sun5i.c
index 0226844..604b3bf 100644
--- a/drivers/clocksource/timer-sun5i.c
+++ b/drivers/clocksource/timer-sun5i.c
@@ -137,7 +137,7 @@ static struct irqaction sun5i_timer_irq = {
 	.dev_id = &sun5i_clockevent,
 };
 
-static u64 sun5i_timer_sched_read(void)
+static u64 notrace sun5i_timer_sched_read(void)
 {
 	return ~readl(timer_base + TIMER_CNTVAL_LO_REG(1));
 }
-- 
1.7.10.4

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

* [PATCH] clocksource: mark sched_clock_read functions notrace
  2015-01-30 18:40 [PATCH] clocksource: mark sched_clock_read functions notrace Nathan Sullivan
@ 2015-02-02 13:13 ` Maxime Coquelin
  2015-02-03 20:13 ` Josh Cartwright
  1 sibling, 0 replies; 5+ messages in thread
From: Maxime Coquelin @ 2015-02-02 13:13 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Nathan,
On 01/30/2015 07:40 PM, Nathan Sullivan wrote:
> These functions will be called by ftrace code when function_graph is
> used, so mark them notrace to avoid infinite recursion.
>
> Signed-off-by: Nathan Sullivan <nathan.sullivan@ni.com>
> ---
>   drivers/clocksource/arm_arch_timer.c    |    2 +-
>   drivers/clocksource/arm_global_timer.c  |    2 +-
For the ARM Global timer part, you can add my:
Acked-by: Maxime Coquelin <maxime.coquelin@st.com>

Thanks,
Maxime

>   drivers/clocksource/samsung_pwm_timer.c |    2 +-
>   drivers/clocksource/timer-prima2.c      |    2 +-
>   drivers/clocksource/timer-sun5i.c       |    2 +-
>   5 files changed, 5 insertions(+), 5 deletions(-)
>
>

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

* [PATCH] clocksource: mark sched_clock_read functions notrace
  2015-01-30 18:40 [PATCH] clocksource: mark sched_clock_read functions notrace Nathan Sullivan
  2015-02-02 13:13 ` Maxime Coquelin
@ 2015-02-03 20:13 ` Josh Cartwright
  2015-02-06 21:31   ` Nathan Sullivan
  1 sibling, 1 reply; 5+ messages in thread
From: Josh Cartwright @ 2015-02-03 20:13 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, Jan 30, 2015 at 12:40:15PM -0600, Nathan Sullivan wrote:
> These functions will be called by ftrace code when function_graph is
> used, so mark them notrace to avoid infinite recursion.

It would be useful to have a full stack trace to show the particular
case you're hitting.  Is the issue that trace_clock_local() is calling
sched_clock(), and in these cases sched_clock() isn't being marked
notrace?

> Signed-off-by: Nathan Sullivan <nathan.sullivan@ni.com>
> ---
>  drivers/clocksource/arm_arch_timer.c    |    2 +-
>  drivers/clocksource/arm_global_timer.c  |    2 +-
>  drivers/clocksource/samsung_pwm_timer.c |    2 +-
>  drivers/clocksource/timer-prima2.c      |    2 +-
>  drivers/clocksource/timer-sun5i.c       |    2 +-
>  5 files changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/clocksource/arm_arch_timer.c b/drivers/clocksource/arm_arch_timer.c
> index 095c177..df5af55 100644
> --- a/drivers/clocksource/arm_arch_timer.c
> +++ b/drivers/clocksource/arm_arch_timer.c
> @@ -405,7 +405,7 @@ u32 arch_timer_get_rate(void)
>  	return arch_timer_rate;
>  }
>  
> -static u64 arch_counter_get_cntvct_mem(void)
> +static u64 notrace arch_counter_get_cntvct_mem(void)

Assuming you're trying to mark all sched_clock() implementations
notrace, then you missed a few: arch_counter_get_cntvct and
arch_counter_get_cntpct.

  Josh

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

* [PATCH] clocksource: mark sched_clock_read functions notrace
  2015-02-03 20:13 ` Josh Cartwright
@ 2015-02-06 21:31   ` Nathan Sullivan
  2015-02-09 19:18     ` Josh Cartwright
  0 siblings, 1 reply; 5+ messages in thread
From: Nathan Sullivan @ 2015-02-06 21:31 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Feb 03, 2015 at 02:13:26PM -0600, Josh Cartwright wrote:
> > diff --git a/drivers/clocksource/arm_arch_timer.c b/drivers/clocksource/arm_arch_timer.c
> > index 095c177..df5af55 100644
> > --- a/drivers/clocksource/arm_arch_timer.c
> > +++ b/drivers/clocksource/arm_arch_timer.c
> > @@ -405,7 +405,7 @@ u32 arch_timer_get_rate(void)
> >  	return arch_timer_rate;
> >  }
> >  
> > -static u64 arch_counter_get_cntvct_mem(void)
> > +static u64 notrace arch_counter_get_cntvct_mem(void)
> 
> Assuming you're trying to mark all sched_clock() implementations
> notrace, then you missed a few: arch_counter_get_cntvct and
> arch_counter_get_cntpct.
> 
>   Josh

Hmm, those are inlined.  Should I still mark them notrace?

    Nathan

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

* [PATCH] clocksource: mark sched_clock_read functions notrace
  2015-02-06 21:31   ` Nathan Sullivan
@ 2015-02-09 19:18     ` Josh Cartwright
  0 siblings, 0 replies; 5+ messages in thread
From: Josh Cartwright @ 2015-02-09 19:18 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, Feb 06, 2015 at 03:31:03PM -0600, Nathan Sullivan wrote:
> On Tue, Feb 03, 2015 at 02:13:26PM -0600, Josh Cartwright wrote:
> > > diff --git a/drivers/clocksource/arm_arch_timer.c b/drivers/clocksource/arm_arch_timer.c
> > > index 095c177..df5af55 100644
> > > --- a/drivers/clocksource/arm_arch_timer.c
> > > +++ b/drivers/clocksource/arm_arch_timer.c
> > > @@ -405,7 +405,7 @@ u32 arch_timer_get_rate(void)
> > >  	return arch_timer_rate;
> > >  }
> > >  
> > > -static u64 arch_counter_get_cntvct_mem(void)
> > > +static u64 notrace arch_counter_get_cntvct_mem(void)
> > 
> > Assuming you're trying to mark all sched_clock() implementations
> > notrace, then you missed a few: arch_counter_get_cntvct and
> > arch_counter_get_cntpct.
> > 
> >   Josh
> 
> Hmm, those are inlined.  Should I still mark them notrace?

There's necessarily an out-of-line version of these functions generated,
as arch_timer_read_counter has to point at something, so yes, I'd say
so.

  Josh

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

end of thread, other threads:[~2015-02-09 19:18 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-01-30 18:40 [PATCH] clocksource: mark sched_clock_read functions notrace Nathan Sullivan
2015-02-02 13:13 ` Maxime Coquelin
2015-02-03 20:13 ` Josh Cartwright
2015-02-06 21:31   ` Nathan Sullivan
2015-02-09 19:18     ` Josh Cartwright

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