aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/ftrace.txt
diff options
context:
space:
mode:
Diffstat (limited to 'Documentation/ftrace.txt')
-rw-r--r--Documentation/ftrace.txt62
1 files changed, 32 insertions, 30 deletions
diff --git a/Documentation/ftrace.txt b/Documentation/ftrace.txt
index 9cc4d685dde5..35a78bc6651d 100644
--- a/Documentation/ftrace.txt
+++ b/Documentation/ftrace.txt
@@ -82,7 +82,7 @@ of ftrace. Here is a list of some of the key files:
82 tracer is not adding more data, they will display 82 tracer is not adding more data, they will display
83 the same information every time they are read. 83 the same information every time they are read.
84 84
85 iter_ctrl: This file lets the user control the amount of data 85 trace_options: This file lets the user control the amount of data
86 that is displayed in one of the above output 86 that is displayed in one of the above output
87 files. 87 files.
88 88
@@ -94,10 +94,10 @@ of ftrace. Here is a list of some of the key files:
94 only be recorded if the latency is greater than 94 only be recorded if the latency is greater than
95 the value in this file. (in microseconds) 95 the value in this file. (in microseconds)
96 96
97 trace_entries: This sets or displays the number of bytes each CPU 97 buffer_size_kb: This sets or displays the number of kilobytes each CPU
98 buffer can hold. The tracer buffers are the same size 98 buffer can hold. The tracer buffers are the same size
99 for each CPU. The displayed number is the size of the 99 for each CPU. The displayed number is the size of the
100 CPU buffer and not total size of all buffers. The 100 CPU buffer and not total size of all buffers. The
101 trace buffers are allocated in pages (blocks of memory 101 trace buffers are allocated in pages (blocks of memory
102 that the kernel uses for allocation, usually 4 KB in size). 102 that the kernel uses for allocation, usually 4 KB in size).
103 If the last page allocated has room for more bytes 103 If the last page allocated has room for more bytes
@@ -316,23 +316,23 @@ The above is mostly meaningful for kernel developers.
316 The rest is the same as the 'trace' file. 316 The rest is the same as the 'trace' file.
317 317
318 318
319iter_ctrl 319trace_options
320--------- 320-------------
321 321
322The iter_ctrl file is used to control what gets printed in the trace 322The trace_options file is used to control what gets printed in the trace
323output. To see what is available, simply cat the file: 323output. To see what is available, simply cat the file:
324 324
325 cat /debug/tracing/iter_ctrl 325 cat /debug/tracing/trace_options
326 print-parent nosym-offset nosym-addr noverbose noraw nohex nobin \ 326 print-parent nosym-offset nosym-addr noverbose noraw nohex nobin \
327 noblock nostacktrace nosched-tree 327 noblock nostacktrace nosched-tree nouserstacktrace nosym-userobj
328 328
329To disable one of the options, echo in the option prepended with "no". 329To disable one of the options, echo in the option prepended with "no".
330 330
331 echo noprint-parent > /debug/tracing/iter_ctrl 331 echo noprint-parent > /debug/tracing/trace_options
332 332
333To enable an option, leave off the "no". 333To enable an option, leave off the "no".
334 334
335 echo sym-offset > /debug/tracing/iter_ctrl 335 echo sym-offset > /debug/tracing/trace_options
336 336
337Here are the available options: 337Here are the available options:
338 338
@@ -378,6 +378,20 @@ Here are the available options:
378 When a trace is recorded, so is the stack of functions. 378 When a trace is recorded, so is the stack of functions.
379 This allows for back traces of trace sites. 379 This allows for back traces of trace sites.
380 380
381 userstacktrace - This option changes the trace.
382 It records a stacktrace of the current userspace thread.
383
384 sym-userobj - when user stacktrace are enabled, look up which object the
385 address belongs to, and print a relative address
386 This is especially useful when ASLR is on, otherwise you don't
387 get a chance to resolve the address to object/file/line after the app is no
388 longer running
389
390 The lookup is performed when you read trace,trace_pipe,latency_trace. Example:
391
392 a.out-1623 [000] 40874.465068: /root/a.out[+0x480] <-/root/a.out[+0
393x494] <- /root/a.out[+0x4a8] <- /lib/libc-2.7.so[+0x1e1a6]
394
381 sched-tree - TBD (any users??) 395 sched-tree - TBD (any users??)
382 396
383 397
@@ -1299,41 +1313,29 @@ trace entries
1299------------- 1313-------------
1300 1314
1301Having too much or not enough data can be troublesome in diagnosing 1315Having too much or not enough data can be troublesome in diagnosing
1302an issue in the kernel. The file trace_entries is used to modify 1316an issue in the kernel. The file buffer_size_kb is used to modify
1303the size of the internal trace buffers. The number listed 1317the size of the internal trace buffers. The number listed
1304is the number of entries that can be recorded per CPU. To know 1318is the number of entries that can be recorded per CPU. To know
1305the full size, multiply the number of possible CPUS with the 1319the full size, multiply the number of possible CPUS with the
1306number of entries. 1320number of entries.
1307 1321
1308 # cat /debug/tracing/trace_entries 1322 # cat /debug/tracing/buffer_size_kb
130965620 13231408 (units kilobytes)
1310 1324
1311Note, to modify this, you must have tracing completely disabled. To do that, 1325Note, to modify this, you must have tracing completely disabled. To do that,
1312echo "nop" into the current_tracer. If the current_tracer is not set 1326echo "nop" into the current_tracer. If the current_tracer is not set
1313to "nop", an EINVAL error will be returned. 1327to "nop", an EINVAL error will be returned.
1314 1328
1315 # echo nop > /debug/tracing/current_tracer 1329 # echo nop > /debug/tracing/current_tracer
1316 # echo 100000 > /debug/tracing/trace_entries 1330 # echo 10000 > /debug/tracing/buffer_size_kb
1317 # cat /debug/tracing/trace_entries 1331 # cat /debug/tracing/buffer_size_kb
1318100045 133210000 (units kilobytes)
1319
1320
1321Notice that we echoed in 100,000 but the size is 100,045. The entries
1322are held in individual pages. It allocates the number of pages it takes
1323to fulfill the request. If more entries may fit on the last page
1324then they will be added.
1325
1326 # echo 1 > /debug/tracing/trace_entries
1327 # cat /debug/tracing/trace_entries
132885
1329
1330This shows us that 85 entries can fit in a single page.
1331 1333
1332The number of pages which will be allocated is limited to a percentage 1334The number of pages which will be allocated is limited to a percentage
1333of available memory. Allocating too much will produce an error. 1335of available memory. Allocating too much will produce an error.
1334 1336
1335 # echo 1000000000000 > /debug/tracing/trace_entries 1337 # echo 1000000000000 > /debug/tracing/buffer_size_kb
1336-bash: echo: write error: Cannot allocate memory 1338-bash: echo: write error: Cannot allocate memory
1337 # cat /debug/tracing/trace_entries 1339 # cat /debug/tracing/buffer_size_kb
133885 134085
1339 1341