powerpc: split ftrace bits into a separate file
PATCH v2 1/1 powerpc: split ftrace bits into a separate file
entry_*.S now includes a lot more than just kernel entry/exit code. As a first step at cleaning this up, let's split out the ftrace bits into separate files.
No functional changes.
---
v2: updated commit description.
arch/powerpc/kernel/Makefile | 2 + arch/powerpc/kernel/entry_32.S | 107 ----------- arch/powerpc/kernel/entry_64.S | 380 -------------------------------------- arch/powerpc/kernel/ftrace_32.S | 118 ++++++++++++ arch/powerpc/kernel/ftrace_64.S | 391 ++++++++++++++++++++++++++++++++++++++++ 5 files changed, 511 insertions(+), 487 deletions(-) create mode 100644 arch/powerpc/kernel/ftrace_32.S create mode 100644 arch/powerpc/kernel/ftrace_64.S
arch/powerpc/kernel/Makefile +2 -0
@@ -112,6 +112,8 @@ obj64-$(CONFIG_AUDIT) += compat_audit.o obj-$(CONFIG_PPC_IO_WORKAROUNDS) += io-workarounds.o +obj32-$(CONFIG_FUNCTION_TRACER) += ftrace_32.o +obj64-$(CONFIG_FUNCTION_TRACER) += ftrace_64.o obj-$(CONFIG_DYNAMIC_FTRACE) += ftrace.o obj-$(CONFIG_FUNCTION_GRAPH_TRACER) += ftrace.o obj-$(CONFIG_FTRACE_SYSCALLS) += ftrace.o
arch/powerpc/kernel/entry_32.S +0 -107
116 lines not on this page · raw message
arch/powerpc/kernel/entry_64.S +0 -380
395 lines not on this page · raw message
arch/powerpc/kernel/ftrace_32.S new file +118 -0
118 lines not on this page · raw message
arch/powerpc/kernel/ftrace_64.S new file +391 -0
391 lines not on this page · raw message
Signature · 1 line
2.10.2
Quoted 8 lines · On Tue, 22 Nov 2016 22:04:39 +0530 "Naveen N. Rao"…
entry_*.S now includes a lot more than just kernel entry/exit code. As a first step at cleaning this up, let's split out the ftrace bits into separate files.
No functional changes.
Suggested-by Michael Ellerman <[email protected]>Signed-off-by Naveen N. Rao <[email protected]>
Looks good to me.
-- Steve
Michael Ellerman
reviewerQuoted 8 lines · Naveen N. Rao
entry_*.S now includes a lot more than just kernel entry/exit code. As a first step at cleaning this up, let's split out the ftrace bits into separate files.
No functional changes.
Suggested-by Michael Ellerman <[email protected]>Signed-off-by Naveen N. Rao <[email protected]>
Quoted 8 lines
---
v2: updated commit description.arch/powerpc/kernel/Makefile | 2 + arch/powerpc/kernel/entry_32.S | 107 ----------- arch/powerpc/kernel/entry_64.S | 380 -------------------------------------- arch/powerpc/kernel/ftrace_32.S | 118 ++++++++++++ arch/powerpc/kernel/ftrace_64.S | 391 ++++++++++++++++++++++++++++++++++++++++
Thanks for having a crack at this.
I think I'd actually like to go the whole way, and move all the tracing code into arch/powerpc/trace (or ftrace?).
There's the 32 and 64-bit asm, and ftrace.c, and trace_clock.c. And then possibly later some of the ftrace module code could move in there too.
And as part of moving the asm, I think we can come up with a better way to organise the code. If you look at the ftrace code in entry_64.S for example the ifdefs look like:
#ifdef CONFIG_FUNCTION_TRACER
#ifdef CONFIG_DYNAMIC_FTRACE
#ifdef CONFIG_FUNCTION_GRAPH_TRACER
#endif
#else /* CC_USING_MPROFILE_KERNEL */
#ifdef CONFIG_LIVEPATCH
#endif
#ifdef CONFIG_LIVEPATCH
#endif
#ifdef CONFIG_LIVEPATCH
#endif
#ifdef CONFIG_FUNCTION_GRAPH_TRACER
#endif
#endif /* CC_USING_MPROFILE_KERNEL */
#ifdef CONFIG_LIVEPATCH
#endif
#else
#ifdef CONFIG_FUNCTION_GRAPH_TRACER
#endif
#endif /* CONFIG_DYNAMIC_FTRACE */
#ifdef CONFIG_FUNCTION_GRAPH_TRACER
#else /* CC_USING_MPROFILE_KERNEL */
#endif /* CC_USING_MPROFILE_KERNEL */
#endif /* CONFIG_FUNCTION_GRAPH_TRACER */
#endif /* CONFIG_FUNCTION_TRACER */
Which is not easy to follow.
I think the main axis is CC_USING_MPROFILE_KERNEL y/n, so perhaps we split it into two .S files based on that?
cheers