diff options
Diffstat (limited to 'kernel/trace/trace.c')
-rw-r--r-- | kernel/trace/trace.c | 92 |
1 files changed, 78 insertions, 14 deletions
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c index 3dc7999594e1..829b2bee24e8 100644 --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c | |||
@@ -3300,20 +3300,84 @@ static const struct file_operations tracing_iter_fops = { | |||
3300 | 3300 | ||
3301 | static const char readme_msg[] = | 3301 | static const char readme_msg[] = |
3302 | "tracing mini-HOWTO:\n\n" | 3302 | "tracing mini-HOWTO:\n\n" |
3303 | "# mount -t debugfs nodev /sys/kernel/debug\n\n" | 3303 | "# echo 0 > tracing_on : quick way to disable tracing\n" |
3304 | "# cat /sys/kernel/debug/tracing/available_tracers\n" | 3304 | "# echo 1 > tracing_on : quick way to re-enable tracing\n\n" |
3305 | "wakeup wakeup_rt preemptirqsoff preemptoff irqsoff function nop\n\n" | 3305 | " Important files:\n" |
3306 | "# cat /sys/kernel/debug/tracing/current_tracer\n" | 3306 | " trace\t\t\t- The static contents of the buffer\n" |
3307 | "nop\n" | 3307 | "\t\t\t To clear the buffer write into this file: echo > trace\n" |
3308 | "# echo wakeup > /sys/kernel/debug/tracing/current_tracer\n" | 3308 | " trace_pipe\t\t- A consuming read to see the contents of the buffer\n" |
3309 | "# cat /sys/kernel/debug/tracing/current_tracer\n" | 3309 | " current_tracer\t- function and latency tracers\n" |
3310 | "wakeup\n" | 3310 | " available_tracers\t- list of configured tracers for current_tracer\n" |
3311 | "# cat /sys/kernel/debug/tracing/trace_options\n" | 3311 | " buffer_size_kb\t- view and modify size of per cpu buffer\n" |
3312 | "noprint-parent nosym-offset nosym-addr noverbose\n" | 3312 | " buffer_total_size_kb - view total size of all cpu buffers\n\n" |
3313 | "# echo print-parent > /sys/kernel/debug/tracing/trace_options\n" | 3313 | " trace_clock\t\t-change the clock used to order events\n" |
3314 | "# echo 1 > /sys/kernel/debug/tracing/tracing_on\n" | 3314 | " local: Per cpu clock but may not be synced across CPUs\n" |
3315 | "# cat /sys/kernel/debug/tracing/trace > /tmp/trace.txt\n" | 3315 | " global: Synced across CPUs but slows tracing down.\n" |
3316 | "# echo 0 > /sys/kernel/debug/tracing/tracing_on\n" | 3316 | " counter: Not a clock, but just an increment\n" |
3317 | " uptime: Jiffy counter from time of boot\n" | ||
3318 | " perf: Same clock that perf events use\n" | ||
3319 | #ifdef CONFIG_X86_64 | ||
3320 | " x86-tsc: TSC cycle counter\n" | ||
3321 | #endif | ||
3322 | "\n trace_marker\t\t- Writes into this file writes into the kernel buffer\n" | ||
3323 | " tracing_cpumask\t- Limit which CPUs to trace\n" | ||
3324 | " instances\t\t- Make sub-buffers with: mkdir instances/foo\n" | ||
3325 | "\t\t\t Remove sub-buffer with rmdir\n" | ||
3326 | " trace_options\t\t- Set format or modify how tracing happens\n" | ||
3327 | "\t\t\t Disable an option by adding a suffix 'no' to the option name\n" | ||
3328 | #ifdef CONFIG_DYNAMIC_FTRACE | ||
3329 | "\n available_filter_functions - list of functions that can be filtered on\n" | ||
3330 | " set_ftrace_filter\t- echo function name in here to only trace these functions\n" | ||
3331 | " accepts: func_full_name, *func_end, func_begin*, *func_middle*\n" | ||
3332 | " modules: Can select a group via module\n" | ||
3333 | " Format: :mod:<module-name>\n" | ||
3334 | " example: echo :mod:ext3 > set_ftrace_filter\n" | ||
3335 | " triggers: a command to perform when function is hit\n" | ||
3336 | " Format: <function>:<trigger>[:count]\n" | ||
3337 | " trigger: traceon, traceoff\n" | ||
3338 | " enable_event:<system>:<event>\n" | ||
3339 | " disable_event:<system>:<event>\n" | ||
3340 | #ifdef CONFIG_STACKTRACE | ||
3341 | " stacktrace\n" | ||
3342 | #endif | ||
3343 | #ifdef CONFIG_TRACER_SNAPSHOT | ||
3344 | " snapshot\n" | ||
3345 | #endif | ||
3346 | " example: echo do_fault:traceoff > set_ftrace_filter\n" | ||
3347 | " echo do_trap:traceoff:3 > set_ftrace_filter\n" | ||
3348 | " The first one will disable tracing every time do_fault is hit\n" | ||
3349 | " The second will disable tracing at most 3 times when do_trap is hit\n" | ||
3350 | " The first time do trap is hit and it disables tracing, the counter\n" | ||
3351 | " will decrement to 2. If tracing is already disabled, the counter\n" | ||
3352 | " will not decrement. It only decrements when the trigger did work\n" | ||
3353 | " To remove trigger without count:\n" | ||
3354 | " echo '!<function>:<trigger> > set_ftrace_filter\n" | ||
3355 | " To remove trigger with a count:\n" | ||
3356 | " echo '!<function>:<trigger>:0 > set_ftrace_filter\n" | ||
3357 | " set_ftrace_notrace\t- echo function name in here to never trace.\n" | ||
3358 | " accepts: func_full_name, *func_end, func_begin*, *func_middle*\n" | ||
3359 | " modules: Can select a group via module command :mod:\n" | ||
3360 | " Does not accept triggers\n" | ||
3361 | #endif /* CONFIG_DYNAMIC_FTRACE */ | ||
3362 | #ifdef CONFIG_FUNCTION_TRACER | ||
3363 | " set_ftrace_pid\t- Write pid(s) to only function trace those pids (function)\n" | ||
3364 | #endif | ||
3365 | #ifdef CONFIG_FUNCTION_GRAPH_TRACER | ||
3366 | " set_graph_function\t- Trace the nested calls of a function (function_graph)\n" | ||
3367 | " max_graph_depth\t- Trace a limited depth of nested calls (0 is unlimited)\n" | ||
3368 | #endif | ||
3369 | #ifdef CONFIG_TRACER_SNAPSHOT | ||
3370 | "\n snapshot\t\t- Like 'trace' but shows the content of the static snapshot buffer\n" | ||
3371 | "\t\t\t Read the contents for more information\n" | ||
3372 | #endif | ||
3373 | #ifdef CONFIG_STACKTRACE | ||
3374 | " stack_trace\t\t- Shows the max stack trace when active\n" | ||
3375 | " stack_max_size\t- Shows current max stack size that was traced\n" | ||
3376 | "\t\t\t Write into this file to reset the max size (trigger a new trace)\n" | ||
3377 | #ifdef CONFIG_DYNAMIC_FTRACE | ||
3378 | " stack_trace_filter\t- Like set_ftrace_filter but limits what stack_trace traces\n" | ||
3379 | #endif | ||
3380 | #endif /* CONFIG_STACKTRACE */ | ||
3317 | ; | 3381 | ; |
3318 | 3382 | ||
3319 | static ssize_t | 3383 | static ssize_t |