Skip to contentSkip to conversation

powerpc: split ftrace bits into a separate file

PATCH Superseded Naveen N. Rao 3 participants 3 messages Nov 22, 2016 – Nov 23, 2016

Subsystems (2)

v2 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

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
index 26b5a5e..298c98d 100644
@@ -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
#2 lore raw
In reply to Naveen N. Rao
Quoted 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.

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