ARM: ensure all sched_clock() implementations are notrace marked
Subsystems (7)
PATCH 1/1 ARM: ensure all sched_clock() implementations are notrace marked
ftrace requires sched_clock() to be notrace. Ensure that all implementations are so marked.
--- arch/arm/mach-ixp4xx/common.c | 2 +- arch/arm/mach-mmp/time.c | 2 +- arch/arm/mach-pxa/time.c | 2 +- arch/arm/mach-sa1100/generic.c | 2 +- arch/arm/mach-tegra/timer.c | 2 +- arch/arm/plat-iop/time.c | 2 +- arch/arm/plat-omap/counter_32k.c | 2 +- arch/arm/plat-orion/time.c | 2 +- arch/arm/plat-versatile/sched-clock.c | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-)
arch/arm/mach-ixp4xx/common.c +1 -1
@@ -424,7 +424,7 @@ static void __init ixp4xx_clocksource_init(void)/* * sched_clock() */ -unsigned long long sched_clock (void ) +unsigned long long notrace sched_clock (void ) {cycle_t cyc =ixp4xx_get_cycles (NULL );struct clocksource *cs = &clocksource_ixp4xx;
arch/arm/mach-mmp/time.c +1 -1
@@ -75,7 +75,7 @@ static inline uint32_t timer_read(void)return __raw_readl (TIMERS_VIRT_BASE +TMR_CVWR (0 )); } -unsigned long long sched_clock (void ) +unsigned long long notrace sched_clock (void ) {unsigned long long v =cnt32_to_63 (timer_read ());return (v * tcr2ns_scale) >>TCR2NS_SCALE_FACTOR ;
arch/arm/mach-pxa/time.c +1 -1
@@ -51,7 +51,7 @@ static void __init set_oscr2ns_scale(unsigned long oscr_rate) oscr2ns_scale++; } -unsigned long long sched_clock (void ) +unsigned long long notrace sched_clock (void ) {unsigned long long v =cnt32_to_63 (OSCR );return (v * oscr2ns_scale) >>OSCR2NS_SCALE_FACTOR ;
arch/arm/mach-sa1100/generic.c +1 -1
@@ -119,7 +119,7 @@ unsigned int sa11x0_getspeed(unsigned int cpu)* * ( * 1E9 / 3686400 => * 78125 / 288) */ -unsigned long long sched_clock (void ) +unsigned long long notrace sched_clock (void ) {unsigned long long v =cnt32_to_63 (OSCR );
arch/arm/mach-tegra/timer.c +1 -1
@@ -110,7 +110,7 @@ static struct clocksource tegra_clocksource = { .flags = CLOCK_SOURCE_IS_CONTINUOUS, }; -unsigned long long sched_clock (void ) +unsigned long long notrace sched_clock (void ) {return cnt32_to_63 (timer_readl (TIMERUS_CNTR_1US )) *1000 ; }
arch/arm/plat-iop/time.c +1 -1
@@ -52,7 +52,7 @@ static struct clocksource iop_clocksource = {/* * IOP sched_clock() implementation via its clocksource. */ -unsigned long long sched_clock (void ) +unsigned long long notrace sched_clock (void ) {cycle_t cyc =iop_clocksource_read (NULL );struct clocksource *cs = &iop_clocksource;
arch/arm/plat-omap/counter_32k.c +1 -1
@@ -109,7 +109,7 @@ static struct clocksource clocksource_32k = {* Returns current time from boot in nsecs. It's OK for this to wrap * around for now, as it's just a relative time stamp. */ -unsigned long long sched_clock (void ) +unsigned long long notrace sched_clock (void ) {return clocksource_cyc2ns (clocksource_32k.read (&clocksource_32k), clocksource_32k.mult, clocksource_32k.shift);
arch/arm/plat-orion/time.c +1 -1
@@ -55,7 +55,7 @@ static u32 ticks_per_jiffy;static unsigned long tclk2ns_scale; -unsigned long long sched_clock (void ) +unsigned long long notrace sched_clock (void ) {unsigned long long v =cnt32_to_63 (0xffffffff -readl (TIMER0_VAL ));return (v * tclk2ns_scale) >>TCLK2NS_SCALE_FACTOR ;
arch/arm/plat-versatile/sched-clock.c +1 -1
@@ -42,7 +42,7 @@* long as there is always less than 89 seconds between successive * calls to this function. */ -unsigned long long sched_clock (void ) +unsigned long long notrace sched_clock (void ) {unsigned long long v =cnt32_to_63 (readl (REFCOUNTER ));
Signature · 1 line
1.6.2.5
PATCH 1/1 ARM: ensure all sched_clock() implementations are notrace marked
Quoted 4 lines · Russell King - ARM Linux
ftrace requires
sched_clock()to be notrace. ?Ensure that all implementations are so marked.Signed-off-by Russell King <[email protected]>
It does seem better to have all of them explicity annotated anyway, even if it not required in most of the cases because they include <linux/sched.h> and the annotation in the declaration takes effect.
Note that in order for this to be fully effective, all functions called from sched_clock() need to be notrace too. OMAP and u300 miss this. The following patches fix them up; perhaps you can fold them into this one. If not, I will rebase them later after this series is merged:
http://www.spinics.net/lists/arm-kernel/msg104616.html
http://www.mail-archive.com/linux-omap at vger.kernel.org/msg38911.html
PATCH 1/1 ARM: ensure all sched_clock() implementations are notrace marked
Quoted 10 lines · Rabin Vincent
Quoted 4 lines · Russell King - ARM Linux
ftrace requires
sched_clock()to be notrace. ?Ensure that all implementations are so marked.Signed-off-by Russell King <[email protected]>It does seem better to have all of them explicity annotated anyway, even if it not required in most of the cases because they include <
linux/sched.h> and the annotation in the declaration takes effect.
Firstly, we shouldn't be relying upon that, and secondly, everywhere which defines sched_clock() should already be including linux/sched.h to avoid the sparse error. It sounds like there's also an exercise to make sure that is the case.
Quoted 2 lines
Note that in order for this to be fully effective, all functions called from
sched_clock()need to be notrace too. OMAP and u300 miss this.
Yes, OMAP still suffers from this.
However, I assume you haven't looked at the u300 sched_clock conversion patch which is part of a follow-on series on lakml? It sorts u300 out in that regard.
PATCH 1/1 ARM: ensure all sched_clock() implementations are notrace marked
Quoted 8 lines · Russell King - ARM Linux
Quoted 7 lines · Rabin Vincent
Quoted 4 lines · Russell King - ARM Linux
ftrace requires
sched_clock()to be notrace. ?Ensure that all implementations are so marked.Signed-off-by Russell King <[email protected]>
Quoted 8 lines
Quoted 3 lines
It does seem better to have all of them explicity annotated anyway, even if it not required in most of the cases because they include <
linux/sched.h> and the annotation in the declaration takes effect.Firstly, we shouldn't be relying upon that, and secondly, everywhere which defines
sched_clock()should already be includinglinux/sched.hto avoid the sparse error. ?It sounds like there's also an exercise to make sure that is the case.
Yes. I believe I identified all the ones which weren't including the header in the last notrace series I sent out (versatile, plat-iop, omap, and u300 IIRC), but there's been some changes in various platforms' sched_clocks() and of course new platforms since then.
Quoted 9 lines
Quoted 3 lines
Note that in order for this to be fully effective, all functions called from
sched_clock()need to be notrace too. ?OMAP and u300 miss this.Yes, OMAP still suffers from this.
However, I assume you haven't looked at the u300
sched_clockconversion patch which is part of a follow-on series on lakml? ?It sorts u300 out in that regard.
Yes, I now see U300 no longer needs the notrace addition. It still could do with the #include <linux/sched.h> addition though, which was also being done as part of that patch.
PATCH 1/1 ARM: ensure all sched_clock() implementations are notrace marked
Quoted 3 lines · Rabin Vincent
Yes, I now see U300 no longer needs the notrace addition. It still could do with the #include <
linux/sched.h> addition though, which was also being done as part of that patch.
Okay, added to u300, tegra, iop, and omap which weren't including linux/sched.h explicitly.