[2/3] arm64: arch_timer: mark functions as __always_inline

Message ID 20190603091402.25115-1-anders.roxell@linaro.org
State Accepted
Commit f31e98bfae1c8792701ef03acd47344866cb2e14
Headers show
Series
  • [1/3] clocksource/arm_arch_timer: mark arch_counter_get_* as notrace
Related show

Commit Message

Anders Roxell June 3, 2019, 9:14 a.m.
If CONFIG_FUNCTION_GRAPH_TRACER is enabled function
arch_counter_get_cntvct() is marked as notrace. However, function
__arch_counter_get_cntvct is marked as inline. If
CONFIG_OPTIMIZE_INLINING is set that will make the two functions
tracable which they shouldn't.

Rework so that functions __arch_counter_get_* are marked with
__always_inline so they will be inlined even if CONFIG_OPTIMIZE_INLINING
is turned on.

Fixes: 0ea415390cd3 ("clocksource/arm_arch_timer: Use arch_timer_read_counter to access stable counters")
Signed-off-by: Anders Roxell <anders.roxell@linaro.org>

---
 arch/arm64/include/asm/arch_timer.h | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

-- 
2.20.1

Comments

Will Deacon June 5, 2019, 11:56 a.m. | #1
On Mon, Jun 03, 2019 at 11:14:02AM +0200, Anders Roxell wrote:
> If CONFIG_FUNCTION_GRAPH_TRACER is enabled function

> arch_counter_get_cntvct() is marked as notrace. However, function

> __arch_counter_get_cntvct is marked as inline. If

> CONFIG_OPTIMIZE_INLINING is set that will make the two functions

> tracable which they shouldn't.

> 

> Rework so that functions __arch_counter_get_* are marked with

> __always_inline so they will be inlined even if CONFIG_OPTIMIZE_INLINING

> is turned on.

> 

> Fixes: 0ea415390cd3 ("clocksource/arm_arch_timer: Use arch_timer_read_counter to access stable counters")

> Signed-off-by: Anders Roxell <anders.roxell@linaro.org>

> ---

>  arch/arm64/include/asm/arch_timer.h | 8 ++++----

>  1 file changed, 4 insertions(+), 4 deletions(-)


I can pick this up if Marc is happy with it.

Will
Marc Zyngier June 5, 2019, 12:23 p.m. | #2
On 05/06/2019 12:56, Will Deacon wrote:
> On Mon, Jun 03, 2019 at 11:14:02AM +0200, Anders Roxell wrote:

>> If CONFIG_FUNCTION_GRAPH_TRACER is enabled function

>> arch_counter_get_cntvct() is marked as notrace. However, function

>> __arch_counter_get_cntvct is marked as inline. If

>> CONFIG_OPTIMIZE_INLINING is set that will make the two functions

>> tracable which they shouldn't.

>>

>> Rework so that functions __arch_counter_get_* are marked with

>> __always_inline so they will be inlined even if CONFIG_OPTIMIZE_INLINING

>> is turned on.

>>

>> Fixes: 0ea415390cd3 ("clocksource/arm_arch_timer: Use arch_timer_read_counter to access stable counters")

>> Signed-off-by: Anders Roxell <anders.roxell@linaro.org>

>> ---

>>  arch/arm64/include/asm/arch_timer.h | 8 ++++----

>>  1 file changed, 4 insertions(+), 4 deletions(-)

> 

> I can pick this up if Marc is happy with it.


Yup, looks good to me. Please add my

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


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

Patch

diff --git a/arch/arm64/include/asm/arch_timer.h b/arch/arm64/include/asm/arch_timer.h
index b7bca1ae09e6..50b3ab7ded4f 100644
--- a/arch/arm64/include/asm/arch_timer.h
+++ b/arch/arm64/include/asm/arch_timer.h
@@ -193,7 +193,7 @@  static inline void arch_timer_set_cntkctl(u32 cntkctl)
 	: "=r" (tmp) : "r" (_val));					\
 } while (0)
 
-static inline u64 __arch_counter_get_cntpct_stable(void)
+static __always_inline u64 __arch_counter_get_cntpct_stable(void)
 {
 	u64 cnt;
 
@@ -203,7 +203,7 @@  static inline u64 __arch_counter_get_cntpct_stable(void)
 	return cnt;
 }
 
-static inline u64 __arch_counter_get_cntpct(void)
+static __always_inline u64 __arch_counter_get_cntpct(void)
 {
 	u64 cnt;
 
@@ -213,7 +213,7 @@  static inline u64 __arch_counter_get_cntpct(void)
 	return cnt;
 }
 
-static inline u64 __arch_counter_get_cntvct_stable(void)
+static __always_inline u64 __arch_counter_get_cntvct_stable(void)
 {
 	u64 cnt;
 
@@ -223,7 +223,7 @@  static inline u64 __arch_counter_get_cntvct_stable(void)
 	return cnt;
 }
 
-static inline u64 __arch_counter_get_cntvct(void)
+static __always_inline u64 __arch_counter_get_cntvct(void)
 {
 	u64 cnt;