diff options
Diffstat (limited to 'Documentation/ftrace.txt')
-rw-r--r-- | Documentation/ftrace.txt | 62 |
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 | ||
319 | iter_ctrl | 319 | trace_options |
320 | --------- | 320 | ------------- |
321 | 321 | ||
322 | The iter_ctrl file is used to control what gets printed in the trace | 322 | The trace_options file is used to control what gets printed in the trace |
323 | output. To see what is available, simply cat the file: | 323 | output. 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 | ||
329 | To disable one of the options, echo in the option prepended with "no". | 329 | To 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 | ||
333 | To enable an option, leave off the "no". | 333 | To 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 | ||
337 | Here are the available options: | 337 | Here 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 | ||
393 | x494] <- /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 | ||
1301 | Having too much or not enough data can be troublesome in diagnosing | 1315 | Having too much or not enough data can be troublesome in diagnosing |
1302 | an issue in the kernel. The file trace_entries is used to modify | 1316 | an issue in the kernel. The file buffer_size_kb is used to modify |
1303 | the size of the internal trace buffers. The number listed | 1317 | the size of the internal trace buffers. The number listed |
1304 | is the number of entries that can be recorded per CPU. To know | 1318 | is the number of entries that can be recorded per CPU. To know |
1305 | the full size, multiply the number of possible CPUS with the | 1319 | the full size, multiply the number of possible CPUS with the |
1306 | number of entries. | 1320 | number of entries. |
1307 | 1321 | ||
1308 | # cat /debug/tracing/trace_entries | 1322 | # cat /debug/tracing/buffer_size_kb |
1309 | 65620 | 1323 | 1408 (units kilobytes) |
1310 | 1324 | ||
1311 | Note, to modify this, you must have tracing completely disabled. To do that, | 1325 | Note, to modify this, you must have tracing completely disabled. To do that, |
1312 | echo "nop" into the current_tracer. If the current_tracer is not set | 1326 | echo "nop" into the current_tracer. If the current_tracer is not set |
1313 | to "nop", an EINVAL error will be returned. | 1327 | to "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 |
1318 | 100045 | 1332 | 10000 (units kilobytes) |
1319 | |||
1320 | |||
1321 | Notice that we echoed in 100,000 but the size is 100,045. The entries | ||
1322 | are held in individual pages. It allocates the number of pages it takes | ||
1323 | to fulfill the request. If more entries may fit on the last page | ||
1324 | then they will be added. | ||
1325 | |||
1326 | # echo 1 > /debug/tracing/trace_entries | ||
1327 | # cat /debug/tracing/trace_entries | ||
1328 | 85 | ||
1329 | |||
1330 | This shows us that 85 entries can fit in a single page. | ||
1331 | 1333 | ||
1332 | The number of pages which will be allocated is limited to a percentage | 1334 | The number of pages which will be allocated is limited to a percentage |
1333 | of available memory. Allocating too much will produce an error. | 1335 | of 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 |
1338 | 85 | 1340 | 85 |
1339 | 1341 | ||