116444a8aSArnaldo Carvalho de Melo# 216444a8aSArnaldo Carvalho de Melo# Architectures that offer an FTRACE implementation should select HAVE_FTRACE: 316444a8aSArnaldo Carvalho de Melo# 416444a8aSArnaldo Carvalho de Meloconfig HAVE_FTRACE 516444a8aSArnaldo Carvalho de Melo bool 6bc0c38d1SSteven Rostedt 7677aa9f7SSteven Rostedtconfig HAVE_DYNAMIC_FTRACE 8677aa9f7SSteven Rostedt bool 9677aa9f7SSteven Rostedt 10352ad25aSSteven Rostedtconfig TRACER_MAX_TRACE 11352ad25aSSteven Rostedt bool 12352ad25aSSteven Rostedt 13bc0c38d1SSteven Rostedtconfig TRACING 14bc0c38d1SSteven Rostedt bool 15bc0c38d1SSteven Rostedt select DEBUG_FS 1686387f7eSIngo Molnar select STACKTRACE 17bc0c38d1SSteven Rostedt 181b29b018SSteven Rostedtconfig FTRACE 191b29b018SSteven Rostedt bool "Kernel Function Tracer" 20694379e9SIngo Molnar depends on HAVE_FTRACE 211b29b018SSteven Rostedt select FRAME_POINTER 221b29b018SSteven Rostedt select TRACING 2335e8e302SSteven Rostedt select CONTEXT_SWITCH_TRACER 241b29b018SSteven Rostedt help 251b29b018SSteven Rostedt Enable the kernel to trace every kernel function. This is done 261b29b018SSteven Rostedt by using a compiler feature to insert a small, 5-byte No-Operation 271b29b018SSteven Rostedt instruction to the beginning of every kernel function, which NOP 281b29b018SSteven Rostedt sequence is then dynamically patched into a tracer call when 291b29b018SSteven Rostedt tracing is enabled by the administrator. If it's runtime disabled 301b29b018SSteven Rostedt (the bootup default), then the overhead of the instructions is very 311b29b018SSteven Rostedt small and not measurable even in micro-benchmarks. 3235e8e302SSteven Rostedt 3381d68a96SSteven Rostedtconfig IRQSOFF_TRACER 3481d68a96SSteven Rostedt bool "Interrupts-off Latency Tracer" 3581d68a96SSteven Rostedt default n 3681d68a96SSteven Rostedt depends on TRACE_IRQFLAGS_SUPPORT 3781d68a96SSteven Rostedt depends on GENERIC_TIME 38c1d2327bSIngo Molnar depends on HAVE_FTRACE 3981d68a96SSteven Rostedt select TRACE_IRQFLAGS 4081d68a96SSteven Rostedt select TRACING 4181d68a96SSteven Rostedt select TRACER_MAX_TRACE 4281d68a96SSteven Rostedt help 4381d68a96SSteven Rostedt This option measures the time spent in irqs-off critical 4481d68a96SSteven Rostedt sections, with microsecond accuracy. 4581d68a96SSteven Rostedt 4681d68a96SSteven Rostedt The default measurement method is a maximum search, which is 4781d68a96SSteven Rostedt disabled by default and can be runtime (re-)started 4881d68a96SSteven Rostedt via: 4981d68a96SSteven Rostedt 5081d68a96SSteven Rostedt echo 0 > /debugfs/tracing/tracing_max_latency 5181d68a96SSteven Rostedt 526cd8a4bbSSteven Rostedt (Note that kernel size and overhead increases with this option 536cd8a4bbSSteven Rostedt enabled. This option and the preempt-off timing option can be 546cd8a4bbSSteven Rostedt used together or separately.) 556cd8a4bbSSteven Rostedt 566cd8a4bbSSteven Rostedtconfig PREEMPT_TRACER 576cd8a4bbSSteven Rostedt bool "Preemption-off Latency Tracer" 586cd8a4bbSSteven Rostedt default n 596cd8a4bbSSteven Rostedt depends on GENERIC_TIME 606cd8a4bbSSteven Rostedt depends on PREEMPT 61c1d2327bSIngo Molnar depends on HAVE_FTRACE 626cd8a4bbSSteven Rostedt select TRACING 636cd8a4bbSSteven Rostedt select TRACER_MAX_TRACE 646cd8a4bbSSteven Rostedt help 656cd8a4bbSSteven Rostedt This option measures the time spent in preemption off critical 666cd8a4bbSSteven Rostedt sections, with microsecond accuracy. 676cd8a4bbSSteven Rostedt 686cd8a4bbSSteven Rostedt The default measurement method is a maximum search, which is 696cd8a4bbSSteven Rostedt disabled by default and can be runtime (re-)started 706cd8a4bbSSteven Rostedt via: 716cd8a4bbSSteven Rostedt 726cd8a4bbSSteven Rostedt echo 0 > /debugfs/tracing/tracing_max_latency 736cd8a4bbSSteven Rostedt 746cd8a4bbSSteven Rostedt (Note that kernel size and overhead increases with this option 756cd8a4bbSSteven Rostedt enabled. This option and the irqs-off timing option can be 766cd8a4bbSSteven Rostedt used together or separately.) 776cd8a4bbSSteven Rostedt 78*f06c3810SIngo Molnarconfig SYSPROF_TRACER 79*f06c3810SIngo Molnar bool "Sysprof Tracer" 80*f06c3810SIngo Molnar depends on DEBUG_KERNEL 81*f06c3810SIngo Molnar select TRACING 82*f06c3810SIngo Molnar help 83*f06c3810SIngo Molnar This tracer provides the trace needed by the 'Sysprof' userspace 84*f06c3810SIngo Molnar tool. 85*f06c3810SIngo Molnar 86352ad25aSSteven Rostedtconfig SCHED_TRACER 87352ad25aSSteven Rostedt bool "Scheduling Latency Tracer" 88c1d2327bSIngo Molnar depends on HAVE_FTRACE 89352ad25aSSteven Rostedt select TRACING 90352ad25aSSteven Rostedt select CONTEXT_SWITCH_TRACER 91352ad25aSSteven Rostedt select TRACER_MAX_TRACE 92352ad25aSSteven Rostedt help 93352ad25aSSteven Rostedt This tracer tracks the latency of the highest priority task 94352ad25aSSteven Rostedt to be scheduled in, starting from the point it has woken up. 95352ad25aSSteven Rostedt 9635e8e302SSteven Rostedtconfig CONTEXT_SWITCH_TRACER 9735e8e302SSteven Rostedt bool "Trace process context switches" 98c1d2327bSIngo Molnar depends on HAVE_FTRACE 9935e8e302SSteven Rostedt select TRACING 10035e8e302SSteven Rostedt select MARKERS 10135e8e302SSteven Rostedt help 10235e8e302SSteven Rostedt This tracer gets called from the context switch and records 10335e8e302SSteven Rostedt all switching of tasks. 10435e8e302SSteven Rostedt 1053d083395SSteven Rostedtconfig DYNAMIC_FTRACE 1063d083395SSteven Rostedt bool "enable/disable ftrace tracepoints dynamically" 1073d083395SSteven Rostedt depends on FTRACE 108677aa9f7SSteven Rostedt depends on HAVE_DYNAMIC_FTRACE 1093d083395SSteven Rostedt default y 1103d083395SSteven Rostedt help 1113d083395SSteven Rostedt This option will modify all the calls to ftrace dynamically 1123d083395SSteven Rostedt (will patch them out of the binary image and replaces them 1133d083395SSteven Rostedt with a No-Op instruction) as they are called. A table is 1143d083395SSteven Rostedt created to dynamically enable them again. 1153d083395SSteven Rostedt 1163d083395SSteven Rostedt This way a CONFIG_FTRACE kernel is slightly larger, but otherwise 1173d083395SSteven Rostedt has native performance as long as no tracing is active. 1183d083395SSteven Rostedt 1193d083395SSteven Rostedt The changes to the code are done by a kernel thread that 1203d083395SSteven Rostedt wakes up once a second and checks to see if any ftrace calls 1213d083395SSteven Rostedt were made. If so, it runs stop_machine (stops all CPUS) 1223d083395SSteven Rostedt and modifies the code to jump over the call to ftrace. 12360a11774SSteven Rostedt 12460a11774SSteven Rostedtconfig FTRACE_SELFTEST 12560a11774SSteven Rostedt bool 12660a11774SSteven Rostedt 12760a11774SSteven Rostedtconfig FTRACE_STARTUP_TEST 12860a11774SSteven Rostedt bool "Perform a startup test on ftrace" 12960a11774SSteven Rostedt depends on TRACING 13060a11774SSteven Rostedt select FTRACE_SELFTEST 13160a11774SSteven Rostedt help 13260a11774SSteven Rostedt This option performs a series of startup tests on ftrace. On bootup 13360a11774SSteven Rostedt a series of tests are made to verify that the tracer is 13460a11774SSteven Rostedt functioning properly. It will do tests on all the configured 13560a11774SSteven Rostedt tracers of ftrace. 136