Skip to content

Commit 4d6d0a6

Browse files
committed
tracing: Remove redundant config HAVE_FTRACE_MCOUNT_RECORD
Ftrace is tightly coupled with architecture specific code because it requires the use of trampolines written in assembly. This means that when a new feature or optimization is made, it must be done for all architectures. To simplify the approach, CONFIG_HAVE_FTRACE_* configs are added to denote which architecture has the new enhancement so that other architectures can still function until they too have been updated. The CONFIG_HAVE_FTRACE_MCOUNT was added to help simplify the DYNAMIC_FTRACE work, but now every architecture that implements DYNAMIC_FTRACE also has HAVE_FTRACE_MCOUNT set too, making it redundant with the HAVE_DYNAMIC_FTRACE. Remove the HAVE_FTRACE_MCOUNT config and use DYNAMIC_FTRACE directly where applicable. Link: https://lore.kernel.org/all/[email protected]/ Cc: Masami Hiramatsu <[email protected]> Cc: Mathieu Desnoyers <[email protected]> Cc: Mark Rutland <[email protected]> Cc: Linus Torvalds <[email protected]> Link: https://lore.kernel.org/[email protected] Signed-off-by: Steven Rostedt (Google) <[email protected]>
1 parent 9b4d5d3 commit 4d6d0a6

File tree

22 files changed

+16
-47
lines changed

22 files changed

+16
-47
lines changed

Documentation/trace/ftrace-design.rst

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -238,19 +238,15 @@ You need very few things to get the syscalls tracing in an arch.
238238
- Tag this arch as HAVE_SYSCALL_TRACEPOINTS.
239239

240240

241-
HAVE_FTRACE_MCOUNT_RECORD
242-
-------------------------
241+
HAVE_DYNAMIC_FTRACE
242+
-------------------
243243

244244
See scripts/recordmcount.pl for more info. Just fill in the arch-specific
245245
details for how to locate the addresses of mcount call sites via objdump.
246246
This option doesn't make much sense without also implementing dynamic ftrace.
247247

248-
249-
HAVE_DYNAMIC_FTRACE
250-
-------------------
251-
252-
You will first need HAVE_FTRACE_MCOUNT_RECORD and HAVE_FUNCTION_TRACER, so
253-
scroll your reader back up if you got over eager.
248+
You will first need HAVE_FUNCTION_TRACER, so scroll your reader back up if you
249+
got over eager.
254250

255251
Once those are out of the way, you will need to implement:
256252
- asm/ftrace.h:

arch/arm/Kconfig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,6 @@ config ARM
107107
select HAVE_EFFICIENT_UNALIGNED_ACCESS if (CPU_V6 || CPU_V6K || CPU_V7) && MMU
108108
select HAVE_EXIT_THREAD
109109
select HAVE_GUP_FAST if ARM_LPAE
110-
select HAVE_FTRACE_MCOUNT_RECORD if !XIP_KERNEL
111110
select HAVE_FUNCTION_ERROR_INJECTION
112111
select HAVE_FUNCTION_GRAPH_TRACER
113112
select HAVE_FUNCTION_TRACER if !XIP_KERNEL

arch/arm64/Kconfig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,6 @@ config ARM64
223223
select HAVE_EFFICIENT_UNALIGNED_ACCESS
224224
select HAVE_GUP_FAST
225225
select HAVE_FTRACE_GRAPH_FUNC
226-
select HAVE_FTRACE_MCOUNT_RECORD
227226
select HAVE_FUNCTION_TRACER
228227
select HAVE_FUNCTION_ERROR_INJECTION
229228
select HAVE_FUNCTION_GRAPH_FREGS

arch/csky/Kconfig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@ config CSKY
8080
select HAVE_FUNCTION_TRACER
8181
select HAVE_FUNCTION_GRAPH_TRACER
8282
select HAVE_FUNCTION_ERROR_INJECTION
83-
select HAVE_FTRACE_MCOUNT_RECORD
8483
select HAVE_KERNEL_GZIP
8584
select HAVE_KERNEL_LZO
8685
select HAVE_KERNEL_LZMA

arch/loongarch/Kconfig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,6 @@ config LOONGARCH
144144
select HAVE_EXIT_THREAD
145145
select HAVE_GUP_FAST
146146
select HAVE_FTRACE_GRAPH_FUNC
147-
select HAVE_FTRACE_MCOUNT_RECORD
148147
select HAVE_FUNCTION_ARG_ACCESS_API
149148
select HAVE_FUNCTION_ERROR_INJECTION
150149
select HAVE_FUNCTION_GRAPH_FREGS

arch/microblaze/Kconfig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ config MICROBLAZE
2828
select HAVE_DEBUG_KMEMLEAK
2929
select HAVE_DMA_CONTIGUOUS
3030
select HAVE_DYNAMIC_FTRACE
31-
select HAVE_FTRACE_MCOUNT_RECORD
3231
select HAVE_FUNCTION_GRAPH_TRACER
3332
select HAVE_FUNCTION_TRACER
3433
select HAVE_PAGE_SIZE_4KB

arch/mips/Kconfig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@ config MIPS
7373
select HAVE_EBPF_JIT if !CPU_MICROMIPS
7474
select HAVE_EXIT_THREAD
7575
select HAVE_GUP_FAST
76-
select HAVE_FTRACE_MCOUNT_RECORD
7776
select HAVE_FUNCTION_GRAPH_TRACER
7877
select HAVE_FUNCTION_TRACER
7978
select HAVE_GCC_PLUGINS

arch/parisc/Kconfig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,6 @@ config PARISC
8181
select HAVE_KPROBES
8282
select HAVE_KRETPROBES
8383
select HAVE_DYNAMIC_FTRACE if $(cc-option,-fpatchable-function-entry=1,1)
84-
select HAVE_FTRACE_MCOUNT_RECORD if HAVE_DYNAMIC_FTRACE
8584
select FTRACE_MCOUNT_USE_PATCHABLE_FUNCTION_ENTRY if DYNAMIC_FTRACE
8685
select HAVE_KPROBES_ON_FTRACE
8786
select HAVE_DYNAMIC_FTRACE_WITH_REGS

arch/powerpc/Kconfig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,6 @@ config PPC
246246
select HAVE_EFFICIENT_UNALIGNED_ACCESS
247247
select HAVE_GUP_FAST
248248
select HAVE_FTRACE_GRAPH_FUNC
249-
select HAVE_FTRACE_MCOUNT_RECORD
250249
select HAVE_FUNCTION_ARG_ACCESS_API
251250
select HAVE_FUNCTION_DESCRIPTORS if PPC64_ELF_ABI_V1
252251
select HAVE_FUNCTION_ERROR_INJECTION

arch/riscv/Kconfig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,6 @@ config RISCV
159159
select HAVE_DYNAMIC_FTRACE_WITH_CALL_OPS if (DYNAMIC_FTRACE_WITH_ARGS && !CFI_CLANG)
160160
select HAVE_DYNAMIC_FTRACE_WITH_ARGS if HAVE_DYNAMIC_FTRACE
161161
select HAVE_FTRACE_GRAPH_FUNC
162-
select HAVE_FTRACE_MCOUNT_RECORD if !XIP_KERNEL
163162
select HAVE_FUNCTION_GRAPH_TRACER if HAVE_DYNAMIC_FTRACE_WITH_ARGS
164163
select HAVE_FUNCTION_GRAPH_FREGS
165164
select HAVE_FUNCTION_TRACER if !XIP_KERNEL

0 commit comments

Comments
 (0)