Skip to contentSkip to conversation

arm64: ftrace: fix build error with CONFIG_FUNCTION_GRAPH_TRACER=n

PATCH In review Arnd Bergmann 5 participants 5 messages Jun 23, 2023 – Jul 4, 2023 arm64

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 arm64: ftrace: fix build error with CONFIG_FUNCTION_GRAPH_TRACER=n

From: Arnd Bergmann <[email protected]>

It appears that a merge conflict ended up hiding a newly added constant in some configurations:

arch/arm64/kernel/entry-ftrace.S: Assembler messages:
arch/arm64/kernel/entry-ftrace.S:59: Error: undefined symbol FTRACE_OPS_DIRECT_CALL used as an immediate value

FTRACE_OPS_DIRECT_CALL is still used when CONFIG_DYNAMIC_FTRACE_WITH_DIRECT_CALLS is enabled, even if CONFIG_FUNCTION_GRAPH_TRACER is disabled, so change the ifdef accordingly.

Fixes 3646970322464 ("arm64: ftrace: Enable HAVE_FUNCTION_GRAPH_RETVAL")
---
 arch/arm64/kernel/asm-offsets.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/kernel/asm-offsets.c +1 -1
index 757d01a68ffd0..5ff1942b04fcf 100644
@@ -213,9 +213,9 @@ int main(void)
   DEFINE(FGRET_REGS_X7,			offsetof(struct fgraph_ret_regs, regs[7]));
   DEFINE(FGRET_REGS_FP,			offsetof(struct fgraph_ret_regs, fp));
   DEFINE(FGRET_REGS_SIZE,		sizeof(struct fgraph_ret_regs));
+#endif
 #ifdef CONFIG_DYNAMIC_FTRACE_WITH_DIRECT_CALLS
   DEFINE(FTRACE_OPS_DIRECT_CALL,	offsetof(struct ftrace_ops, direct_call));
-#endif
 #endif
   return 0;
 }
Signature · 1 line
2.39.2
Acked-by on v1 1/1
#1 lore raw
Quoted 35 lines · Arnd Bergmann

From: Arnd Bergmann <[email protected]>

It appears that a merge conflict ended up hiding a newly added constant in some configurations:

arch/arm64/kernel/entry-ftrace.S: Assembler messages:
arch/arm64/kernel/entry-ftrace.S:59: Error: undefined symbol FTRACE_OPS_DIRECT_CALL used as an immediate value

FTRACE_OPS_DIRECT_CALL is still used when CONFIG_DYNAMIC_FTRACE_WITH_DIRECT_CALLS is enabled, even if CONFIG_FUNCTION_GRAPH_TRACER is disabled, so change the ifdef accordingly.

Fixes 3646970322464 ("arm64: ftrace: Enable HAVE_FUNCTION_GRAPH_RETVAL")
---
 arch/arm64/kernel/asm-offsets.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/kernel/asm-offsets.c +1 -2
index 757d01a68ffd0..5ff1942b04fcf 100644
@@ -213,9 +213,9 @@ int main(void)
   DEFINE(FGRET_REGS_X7,                        offsetof(struct fgraph_ret_regs, regs[7]));
   DEFINE(FGRET_REGS_FP,                        offsetof(struct fgraph_ret_regs, fp));
   DEFINE(FGRET_REGS_SIZE,              sizeof(struct fgraph_ret_regs));
+#endif
 #ifdef CONFIG_DYNAMIC_FTRACE_WITH_DIRECT_CALLS
   DEFINE(FTRACE_OPS_DIRECT_CALL,       offsetof(struct ftrace_ops, direct_call));
-#endif
 #endif
   return 0;
 }
--
Quoted 2 lines

2.39.2

Good catch, thank you Arnd!

Reviewed-by Tested-by
#2 lore raw
Quoted 41 lines · Florent Revest
Quoted 35 lines · Arnd Bergmann

From: Arnd Bergmann <[email protected]>

It appears that a merge conflict ended up hiding a newly added constant in some configurations:

arch/arm64/kernel/entry-ftrace.S: Assembler messages:
arch/arm64/kernel/entry-ftrace.S:59: Error: undefined symbol FTRACE_OPS_DIRECT_CALL used as an immediate value

FTRACE_OPS_DIRECT_CALL is still used when CONFIG_DYNAMIC_FTRACE_WITH_DIRECT_CALLS is enabled, even if CONFIG_FUNCTION_GRAPH_TRACER is disabled, so change the ifdef accordingly.

Fixes 3646970322464 ("arm64: ftrace: Enable HAVE_FUNCTION_GRAPH_RETVAL")
---
 arch/arm64/kernel/asm-offsets.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/kernel/asm-offsets.c +1 -2
index 757d01a68ffd0..5ff1942b04fcf 100644
@@ -213,9 +213,9 @@ int main(void)
   DEFINE(FGRET_REGS_X7,                        offsetof(struct fgraph_ret_regs, regs[7]));
   DEFINE(FGRET_REGS_FP,                        offsetof(struct fgraph_ret_regs, fp));
   DEFINE(FGRET_REGS_SIZE,              sizeof(struct fgraph_ret_regs));
+#endif
 #ifdef CONFIG_DYNAMIC_FTRACE_WITH_DIRECT_CALLS
   DEFINE(FTRACE_OPS_DIRECT_CALL,       offsetof(struct ftrace_ops, direct_call));
-#endif
 #endif
   return 0;
 }
--
Quoted 2 lines

2.39.2

Quoted 1 line

Good catch, thank you Arnd!

Thanks.

Signature · 1 line
~Randy
maintainer Acked-by on v1 1/1
#3 lore raw
In reply to Arnd Bergmann
Quoted 23 lines · Arnd Bergmann

From: Arnd Bergmann <[email protected]>

It appears that a merge conflict ended up hiding a newly added constant in some configurations:

arch/arm64/kernel/entry-ftrace.S: Assembler messages:
arch/arm64/kernel/entry-ftrace.S:59: Error: undefined symbol FTRACE_OPS_DIRECT_CALL used as an immediate value

FTRACE_OPS_DIRECT_CALL is still used when CONFIG_DYNAMIC_FTRACE_WITH_DIRECT_CALLS is enabled, even if CONFIG_FUNCTION_GRAPH_TRACER is disabled, so change the ifdef accordingly.

Fixes 3646970322464 ("arm64: ftrace: Enable HAVE_FUNCTION_GRAPH_RETVAL")
---
 arch/arm64/kernel/asm-offsets.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/kernel/asm-offsets.c +0 -0
index 757d01a68ffd0..5ff1942b04fcf 100644

arch/arm64/kernel/asm-offsets.c int main(void) · line 221

Quoted 10 lines
arch/arm64/kernel/asm-offsets.c +1 -1
@@ -213,9 +213,9 @@ int main(void)
   DEFINE(FGRET_REGS_X7,			offsetof(struct fgraph_ret_regs, regs[7]));
   DEFINE(FGRET_REGS_FP,			offsetof(struct fgraph_ret_regs, fp));
   DEFINE(FGRET_REGS_SIZE,		sizeof(struct fgraph_ret_regs));
+#endif
 #ifdef CONFIG_DYNAMIC_FTRACE_WITH_DIRECT_CALLS
   DEFINE(FTRACE_OPS_DIRECT_CALL,	offsetof(struct ftrace_ops, direct_call));
-#endif
 #endif
   return 0;
 }

Steven, since the fixed commit went in via your tree, could you please pick this up as well for -rc1? Otherwise I'll queue it for -rc2 once the ftrace changes turn up in -rc1.

Thanks.

Signature · 1 line
Catalin
#4 lore raw
Quoted 18 lines · On Fri, 30 Jun 2023 17:02:39 +0100 Catalin Marinas <[email protected]>…
Quoted 5 lines
arch/arm64/kernel/asm-offsets.c +0 -0
index 757d01a68ffd0..5ff1942b04fcf 100644

arch/arm64/kernel/asm-offsets.c int main(void) · line 221

Quoted 10 lines
arch/arm64/kernel/asm-offsets.c +1 -1
@@ -213,9 +213,9 @@ int main(void)
   DEFINE(FGRET_REGS_X7,			offsetof(struct fgraph_ret_regs, regs[7]));
   DEFINE(FGRET_REGS_FP,			offsetof(struct fgraph_ret_regs, fp));
   DEFINE(FGRET_REGS_SIZE,		sizeof(struct fgraph_ret_regs));
+#endif
 #ifdef CONFIG_DYNAMIC_FTRACE_WITH_DIRECT_CALLS
   DEFINE(FTRACE_OPS_DIRECT_CALL,	offsetof(struct ftrace_ops, direct_call));
-#endif
 #endif
   return 0;
 }  
Quoted 3 lines

Steven, since the fixed commit went in via your tree, could you please pick this up as well for -rc1? Otherwise I'll queue it for -rc2 once the ftrace changes turn up in -rc1.

I'm working on a fixes pull request for Linus. I'll apply this to it and start my testing on it. I should have a pull request to Linus before the end of the week.

-- Steve

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel