[PATCH v2] powerpc: split ftrace bits into a separate file

Michael Ellerman mpe at ellerman.id.au
Wed Nov 23 23:07:56 AEDT 2016


"Naveen N. Rao" <naveen.n.rao at linux.vnet.ibm.com> writes:

> 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 <mpe at ellerman.id.au>
> Signed-off-by: Naveen N. Rao <naveen.n.rao at linux.vnet.ibm.com>
> ---
> 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


More information about the Linuxppc-dev mailing list