Commit 7f7797b3 authored by Naveen N Rao's avatar Naveen N Rao Committed by Michael Ellerman
Browse files

powerpc64/ftrace: Move ELFv1 and -pg support code into a separate file



ELFv1 support is deprecated and on the way out. Pre -mprofile-kernel
ftrace support (-pg only) is very limited and is retained primarily for
clang builds. It won't be necessary once clang lands support for
-fpatchable-function-entry.

Copy the existing ftrace code supporting these into ftrace_pg.c.
ftrace.c can then be refactored and enhanced with a focus on ppc32 and
ppc64 ELFv2.

Signed-off-by: default avatarNaveen N Rao <naveen@kernel.org>
Reviewed-by: default avatarChristophe Leroy <christophe.leroy@csgroup.eu>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
Link: https://msgid.link/1eb6cc6c3141ddb77a2a25f8a9e83d83ff312b02.1687166935.git.naveen@kernel.org
parent 02406059
Loading
Loading
Loading
Loading
+9 −4
Original line number Diff line number Diff line
@@ -6,15 +6,16 @@
ifdef CONFIG_FUNCTION_TRACER
# do not trace tracer code
CFLAGS_REMOVE_ftrace.o = $(CC_FLAGS_FTRACE)
CFLAGS_REMOVE_ftrace_pg.o = $(CC_FLAGS_FTRACE)
endif

obj32-$(CONFIG_FUNCTION_TRACER)		+= ftrace_mprofile.o
obj32-$(CONFIG_FUNCTION_TRACER)		+= ftrace_mprofile.o ftrace.o
ifdef CONFIG_MPROFILE_KERNEL
obj64-$(CONFIG_FUNCTION_TRACER)		+= ftrace_mprofile.o
obj64-$(CONFIG_FUNCTION_TRACER)		+= ftrace_mprofile.o ftrace.o
else
obj64-$(CONFIG_FUNCTION_TRACER)		+= ftrace_64_pg.o
obj64-$(CONFIG_FUNCTION_TRACER)		+= ftrace_64_pg.o ftrace_pg.o
endif
obj-$(CONFIG_FUNCTION_TRACER)		+= ftrace_low.o ftrace.o
obj-$(CONFIG_FUNCTION_TRACER)		+= ftrace_low.o
obj-$(CONFIG_TRACING)			+= trace_clock.o

obj-$(CONFIG_PPC64)			+= $(obj64-y)
@@ -25,3 +26,7 @@ GCOV_PROFILE_ftrace.o := n
KCOV_INSTRUMENT_ftrace.o := n
KCSAN_SANITIZE_ftrace.o := n
UBSAN_SANITIZE_ftrace.o := n
GCOV_PROFILE_ftrace_pg.o := n
KCOV_INSTRUMENT_ftrace_pg.o := n
KCSAN_SANITIZE_ftrace_pg.o := n
UBSAN_SANITIZE_ftrace_pg.o := n
+0 −10
Original line number Diff line number Diff line
@@ -864,13 +864,3 @@ unsigned long prepare_ftrace_return(unsigned long parent, unsigned long ip,
}
#endif
#endif /* CONFIG_FUNCTION_GRAPH_TRACER */

#ifdef CONFIG_PPC64_ELF_ABI_V1
char *arch_ftrace_match_adjust(char *str, const char *search)
{
	if (str[0] == '.' && search[0] != '.')
		return str + 1;
	else
		return str;
}
#endif /* CONFIG_PPC64_ELF_ABI_V1 */
+846 −0

File added.

Preview size limit exceeded, changes collapsed.