Skip to content

Commit 90a871f

Browse files
committed
Merge tag 'ftrace-v6.17' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace
Pull ftrace updates from Steven Rostedt: - Keep track of when fgraph_ops are registered or not Keep accounting of when fgraph_ops are registered as if a fgraph_ops is registered twice it can mess up the accounting and it will not work as expected later. Trigger a warning if something registers it twice as to catch bugs before they are found by things just not working as expected. - Make DYNAMIC_FTRACE always enabled for architectures that support it As static ftrace (where all functions are always traced) is very expensive and only exists to help architectures support ftrace, do not make it an option. As soon as an architecture supports DYNAMIC_FTRACE make it use it. This simplifies the code. - Remove redundant config HAVE_FTRACE_MCOUNT_RECORD 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. - Make pid_ptr string size match the comment In print_graph_proc() the pid_ptr string is of size 11, but the comment says /* sign + log10(MAX_INT) + '\0' */ which is actually 12. * tag 'ftrace-v6.17' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace: tracing: Remove redundant config HAVE_FTRACE_MCOUNT_RECORD ftrace: Make DYNAMIC_FTRACE always enabled for architectures that support it fgraph: Keep track of when fgraph_ops are registered or not fgraph: Make pid_str size match the comment
2 parents 2223228 + 4d6d0a6 commit 90a871f

File tree

24 files changed

+31
-52
lines changed

24 files changed

+31
-52
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
@@ -105,7 +105,6 @@ config ARM
105105
select HAVE_EFFICIENT_UNALIGNED_ACCESS if (CPU_V6 || CPU_V6K || CPU_V7) && MMU
106106
select HAVE_EXIT_THREAD
107107
select HAVE_GUP_FAST if ARM_LPAE
108-
select HAVE_FTRACE_MCOUNT_RECORD if !XIP_KERNEL
109108
select HAVE_FUNCTION_ERROR_INJECTION
110109
select HAVE_FUNCTION_GRAPH_TRACER
111110
select HAVE_FUNCTION_TRACER if !XIP_KERNEL

arch/arm64/Kconfig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,6 @@ config ARM64
221221
select HAVE_EFFICIENT_UNALIGNED_ACCESS
222222
select HAVE_GUP_FAST
223223
select HAVE_FTRACE_GRAPH_FUNC
224-
select HAVE_FTRACE_MCOUNT_RECORD
225224
select HAVE_FUNCTION_TRACER
226225
select HAVE_FUNCTION_ERROR_INJECTION
227226
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
@@ -143,7 +143,6 @@ config LOONGARCH
143143
select HAVE_EXIT_THREAD
144144
select HAVE_GUP_FAST
145145
select HAVE_FTRACE_GRAPH_FUNC
146-
select HAVE_FTRACE_MCOUNT_RECORD
147146
select HAVE_FUNCTION_ARG_ACCESS_API
148147
select HAVE_FUNCTION_ERROR_INJECTION
149148
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
@@ -244,7 +244,6 @@ config PPC
244244
select HAVE_EFFICIENT_UNALIGNED_ACCESS
245245
select HAVE_GUP_FAST
246246
select HAVE_FTRACE_GRAPH_FUNC
247-
select HAVE_FTRACE_MCOUNT_RECORD
248247
select HAVE_FUNCTION_ARG_ACCESS_API
249248
select HAVE_FUNCTION_DESCRIPTORS if PPC64_ELF_ABI_V1
250249
select HAVE_FUNCTION_ERROR_INJECTION

arch/riscv/Kconfig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,6 @@ config RISCV
157157
select HAVE_DYNAMIC_FTRACE_WITH_CALL_OPS if (DYNAMIC_FTRACE_WITH_ARGS && !CFI_CLANG)
158158
select HAVE_DYNAMIC_FTRACE_WITH_ARGS if HAVE_DYNAMIC_FTRACE
159159
select HAVE_FTRACE_GRAPH_FUNC
160-
select HAVE_FTRACE_MCOUNT_RECORD if !XIP_KERNEL
161160
select HAVE_FUNCTION_GRAPH_TRACER if HAVE_DYNAMIC_FTRACE_WITH_ARGS
162161
select HAVE_FUNCTION_GRAPH_FREGS
163162
select HAVE_FUNCTION_TRACER if !XIP_KERNEL && HAVE_DYNAMIC_FTRACE

0 commit comments

Comments
 (0)