Skip to content

Commit 7f7797b

Browse files
rnavmpe
authored andcommitted
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: Naveen N Rao <naveen@kernel.org> Reviewed-by: Christophe Leroy <christophe.leroy@csgroup.eu> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://msgid.link/1eb6cc6c3141ddb77a2a25f8a9e83d83ff312b02.1687166935.git.naveen@kernel.org
1 parent 0240605 commit 7f7797b

3 files changed

Lines changed: 855 additions & 14 deletions

File tree

arch/powerpc/kernel/trace/Makefile

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,16 @@
66
ifdef CONFIG_FUNCTION_TRACER
77
# do not trace tracer code
88
CFLAGS_REMOVE_ftrace.o = $(CC_FLAGS_FTRACE)
9+
CFLAGS_REMOVE_ftrace_pg.o = $(CC_FLAGS_FTRACE)
910
endif
1011

11-
obj32-$(CONFIG_FUNCTION_TRACER) += ftrace_mprofile.o
12+
obj32-$(CONFIG_FUNCTION_TRACER) += ftrace_mprofile.o ftrace.o
1213
ifdef CONFIG_MPROFILE_KERNEL
13-
obj64-$(CONFIG_FUNCTION_TRACER) += ftrace_mprofile.o
14+
obj64-$(CONFIG_FUNCTION_TRACER) += ftrace_mprofile.o ftrace.o
1415
else
15-
obj64-$(CONFIG_FUNCTION_TRACER) += ftrace_64_pg.o
16+
obj64-$(CONFIG_FUNCTION_TRACER) += ftrace_64_pg.o ftrace_pg.o
1617
endif
17-
obj-$(CONFIG_FUNCTION_TRACER) += ftrace_low.o ftrace.o
18+
obj-$(CONFIG_FUNCTION_TRACER) += ftrace_low.o
1819
obj-$(CONFIG_TRACING) += trace_clock.o
1920

2021
obj-$(CONFIG_PPC64) += $(obj64-y)
@@ -25,3 +26,7 @@ GCOV_PROFILE_ftrace.o := n
2526
KCOV_INSTRUMENT_ftrace.o := n
2627
KCSAN_SANITIZE_ftrace.o := n
2728
UBSAN_SANITIZE_ftrace.o := n
29+
GCOV_PROFILE_ftrace_pg.o := n
30+
KCOV_INSTRUMENT_ftrace_pg.o := n
31+
KCSAN_SANITIZE_ftrace_pg.o := n
32+
UBSAN_SANITIZE_ftrace_pg.o := n

arch/powerpc/kernel/trace/ftrace.c

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -864,13 +864,3 @@ unsigned long prepare_ftrace_return(unsigned long parent, unsigned long ip,
864864
}
865865
#endif
866866
#endif /* CONFIG_FUNCTION_GRAPH_TRACER */
867-
868-
#ifdef CONFIG_PPC64_ELF_ABI_V1
869-
char *arch_ftrace_match_adjust(char *str, const char *search)
870-
{
871-
if (str[0] == '.' && search[0] != '.')
872-
return str + 1;
873-
else
874-
return str;
875-
}
876-
#endif /* CONFIG_PPC64_ELF_ABI_V1 */

0 commit comments

Comments
 (0)