aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/trace/Kconfig
diff options
context:
space:
mode:
authorSteven Rostedt <srostedt@redhat.com>2009-03-20 12:50:56 -0400
committerSteven Rostedt <srostedt@redhat.com>2009-03-24 23:40:00 -0400
commitbac429f037f1a51a74d62bad6d1518c3be065df3 (patch)
tree40c3dbdd0f6c097c3c9a1087d219dd8632bd7b74 /kernel/trace/Kconfig
parent425480081e936d8725f0d44b8829d699bf088c6b (diff)
tracing: add function profiler
Impact: new profiling feature This patch adds a function profiler. In debugfs/tracing/ two new files are created. function_profile_enabled - to enable or disable profiling trace_stat/functions - the profiled functions. For example: echo 1 > /debugfs/tracing/function_profile_enabled ./hackbench 50 echo 0 > /debugfs/tracing/function_profile_enabled yields: cat /debugfs/tracing/trace_stat/functions Function Hit -------- --- _spin_lock 10106442 _spin_unlock 10097492 kfree 6013704 _spin_unlock_irqrestore 4423941 _spin_lock_irqsave 4406825 __phys_addr 4181686 __slab_free 4038222 dput 4030130 path_put 4023387 unroll_tree_refs 4019532 [...] The most hit functions are listed first. Functions that are not hit are not listed. This feature depends on and uses dynamic function tracing. When the function profiling is disabled, no overhead occurs. But it still takes up around 300KB to hold the data, thus it is not recomended to keep it enabled for systems low on memory. When a '1' is echoed into the function_profile_enabled file, the counters for is function is reset back to zero. Thus you can see what functions are hit most by different programs. Signed-off-by: Steven Rostedt <srostedt@redhat.com>
Diffstat (limited to 'kernel/trace/Kconfig')
-rw-r--r--kernel/trace/Kconfig19
1 files changed, 19 insertions, 0 deletions
diff --git a/kernel/trace/Kconfig b/kernel/trace/Kconfig
index 8a4d72931042..95e9ad5735d9 100644
--- a/kernel/trace/Kconfig
+++ b/kernel/trace/Kconfig
@@ -105,6 +105,7 @@ config FUNCTION_GRAPH_TRACER
105 This is done by setting the current return address on the current 105 This is done by setting the current return address on the current
106 task structure into a stack of calls. 106 task structure into a stack of calls.
107 107
108
108config IRQSOFF_TRACER 109config IRQSOFF_TRACER
109 bool "Interrupts-off Latency Tracer" 110 bool "Interrupts-off Latency Tracer"
110 default n 111 default n
@@ -376,6 +377,24 @@ config DYNAMIC_FTRACE
376 were made. If so, it runs stop_machine (stops all CPUS) 377 were made. If so, it runs stop_machine (stops all CPUS)
377 and modifies the code to jump over the call to ftrace. 378 and modifies the code to jump over the call to ftrace.
378 379
380config FUNCTION_PROFILER
381 bool "Kernel function profiler"
382 depends on DYNAMIC_FTRACE
383 default n
384 help
385 This option enables the kernel function profiler. When the dynamic
386 function tracing is enabled, a counter is added into the function
387 records used by the dynamic function tracer. A file is created in
388 debugfs called function_profile_enabled which defaults to zero.
389 When a 1 is echoed into this file profiling begins, and when a
390 zero is entered, profiling stops. A file in the trace_stats
391 directory called functions, that show the list of functions that
392 have been hit and their counters.
393
394 This takes up around 320K more memory.
395
396 If in doubt, say N
397
379config FTRACE_MCOUNT_RECORD 398config FTRACE_MCOUNT_RECORD
380 def_bool y 399 def_bool y
381 depends on DYNAMIC_FTRACE 400 depends on DYNAMIC_FTRACE