.\" Automatically generated by Pandoc 3.1.3 .\" .\" Define V font for inline verbatim, using C font in formats .\" that render this, and otherwise B font. .ie "\f[CB]x\f[]"x" \{\ . ftr V B . ftr VI BI . ftr VB B . ftr VBI BI .\} .el \{\ . ftr V CR . ftr VI CI . ftr VB CB . ftr VBI CBI .\} .TH "UFTRACE-REPORT" "1" "Sep, 2018" "Uftrace User Manuals" "" .hy .SH NAME .PP uftrace-report - Print statistics and summary for trace data .SH SYNOPSIS .PP uftrace report [\f[I]options\f[R]] .SH DESCRIPTION .PP This command collects trace data from a given data file and prints statistics and summary information. It shows function statistics by default, but can show task statistics with the \f[V]--task\f[R] option and show differences between traces with the \f[V]--diff\f[R] option. .SH REPORT OPTIONS .TP -f \f[I]FIELD\f[R], --output-fields=\f[I]FIELD\f[R] Customize field in the output. Possible values are: \f[V]total\f[R], \f[V]total-avg\f[R], \f[V]total-min\f[R], \f[V]total-max\f[R], \f[V]total-stdv\f[R], \f[V]self\f[R], \f[V]self-avg\f[R], \f[V]self-min\f[R], \f[V]self-max\f[R], \f[V]self-stdv\f[R], \f[V]size\f[R], \f[V]call\f[R] and \f[V]all\f[R]. Multiple fields can be set by using comma. Special field of `none' can be used (solely) to hide all fields and `all' can be used to show all fields. Default is `total,self,call'. See \f[I]FIELDS\f[R]. \f[V]stdv\f[R] stands for the relative standard deviation (RSD), which is the standard deviation expressed as a percentage of the mean. The relative standard deviation is calculated using the formula: .RS .PP [ RSD = ( ) % ] .PP where: - ( ) represents the standard deviation. - ( ) represents the mean of the function\[cq]s time. .RE .TP -s \f[I]KEYS\f[R][,\f[I]KEYS\f[R],\&...], --sort=\f[I]KEYS\f[R][,\f[I]KEYS\f[R],\&...] Sort functions by given KEYS. Multiple KEYS can be given, separated by comma (,). Possible keys are \f[V]total\f[R] (time), \f[V]total-avg\f[R], \f[V]total-min\f[R], \f[V]total-max\f[R], \f[V]total-stdv\f[R], \f[V]self\f[R] (time), \f[V]self-avg\f[R], \f[V]self-min\f[R], \f[V]self-max\f[R], \f[V]self-stdv\f[R], \f[V]size\f[R], \f[V]call\f[R] and \f[V]func\f[R]. But if either \f[V]--avg-total\f[R] or \f[V]--avg-self\f[R] is used, the possible keys can be \f[V]avg\f[R], \f[V]min\f[R] and \f[V]max\f[R] that apply to total or self time respectively. .TP --avg-total Show average, min, max, relative standard deviation of each function\[cq]s total time. .TP --avg-self Show average, min, max, relative standard deviation of each function\[cq]s self time. .TP --task Report task summary information rather than function statistics. Customize field in the output with -f option. Possible values are: \f[V]total\f[R], \f[V]self\f[R], \f[V]func\f[R] and \f[V]tid\f[R]. Multiple fields can be set by using comma. Special field of `none' can be used (solely) to hide all fields. Default is `total,self,func,tid'. See \f[I]TASK FIELDS\f[R]. .TP --diff=\f[I]DATA\f[R] Report differences between the input trace data and the given DATA. .TP --diff-policy=\f[I]POLICY\f[R] Apply custom diff policy. Available values are: \[lq]abs\[rq], \[lq]no-abs\[rq], \[lq]percent\[rq], \[lq]no-percent\[rq], \[lq]compact\[rq] and \[lq]full\[rq]. The \[lq]abs\[rq] is to sort diff result using absolute value so positive and negative entries can be shown together while \[lq]no-abs\[rq] will show positive entries first and then negative ones. The \[lq]percent\[rq] is to show diff in percentage while \[lq]no-percent\[rq] is to show the values. The \[lq]full\[rq] is to show all three columns of baseline, new data and difference while \[lq]compact\[rq] only shows the difference. The default is \[lq]abs\[rq], \[lq]compact\[rq] and \[lq]no-percent\[rq]. .TP --sort-column=\f[I]IDX\f[R] When \f[V]--diff\f[R] is used with \[lq]full\[rq] policy, 3 columns will be shown for each total time, self time and call count. This option selects the index of the column to be used as a sort key. Index 0 is for original data given by the \f[V]--data\f[R] option, index 1 is for data given by the \f[V]--diff\f[R] option, and index 2 is for (percentage) differences between the two data. .TP --srcline Show source location of each function if available. .TP --format=\f[I]TYPE\f[R] Show format style output. Currently, normal and html styles are supported. .SH COMMON OPTIONS .TP -F \f[I]FUNC\f[R], --filter=\f[I]FUNC\f[R] Set filter to trace selected functions and their children functions. This option can be used more than once. See \f[V]uftrace-replay\f[R](1) for an explanation of filters. .TP -N \f[I]FUNC\f[R], --notrace=\f[I]FUNC\f[R] Set filter not to trace selected functions and their children functions. This option can be used more than once. See \f[V]uftrace-replay\f[R](1) for an explanation of filters. .TP -C \f[I]FUNC\f[R], --caller-filter=\f[I]FUNC\f[R] Set filter to trace callers of selected functions only. This option can be used more than once. See \f[V]uftrace-replay\f[R](1) for an explanation of filters. .TP -T \f[I]TRG\f[R], --trigger=\f[I]TRG\f[R] Set trigger on selected functions. This option can be used more than once. See \f[V]uftrace-replay\f[R](1) for an explanation of triggers. .TP -D \f[I]DEPTH\f[R], --depth \f[I]DEPTH\f[R] Set trace limit in nesting level. .TP -t \f[I]TIME\f[R], --time-filter=\f[I]TIME\f[R] Do not account functions which run under the time threshold. If some functions explicitly have the `trace' trigger applied, those are always accounted regardless of execution time. .TP -Z \f[I]SIZE\f[R], --size-filter=\f[I]SIZE\f[R] Do not show functions smaller than SIZE bytes. .TP -L \f[I]LOCATION\f[R], --loc-filter=\f[I]LOCATION\f[R] Set filter to trace selected source locations. This option can be used more than once. .TP --no-libcall Do not show library calls. .TP --no-event Do not show any events. Implies \f[V]--no-sched\f[R]. .TP --no-sched Do not show schedule events. .TP --no-sched-preempt Do not show preempt schedule events but show regular(sleeping) schedule events. .TP --match=\f[I]TYPE\f[R] Use pattern match using TYPE. Possible types are \f[V]regex\f[R] and \f[V]glob\f[R]. Default is \f[V]regex\f[R]. .TP --with-syms=\f[I]DIR\f[R] Read symbol data from the .sym files in \f[I]DIR\f[R] directory instead of the binary. This can be useful to deal with stripped binaries. The file name of the main binary should be the same when saved and used. .SH COMMON ANALYSIS OPTIONS .TP -H \f[I]FUNC\f[R], --hide=\f[I]FUNC\f[R] Set filter not to trace selected functions. It doesn\[cq]t affect their subtrees, but hides only the given functions. This option can be used more than once. See \f[V]uftrace-replay\f[R](1) for an explanation of filters. .TP --kernel-full Show all kernel functions, including those called outside of user functions. .TP --kernel-only Show kernel functions only without user functions. .TP --event-full Show all (user) events outside of user functions. .TP --tid=\f[I]TID\f[R][,\f[I]TID\f[R],\&...] Only print functions called by the given tasks. To see the list of tasks in the data file, you can use \f[V]uftrace report --task\f[R] or \f[V]uftrace info\f[R]. This option can also be used more than once. .TP --demangle=\f[I]TYPE\f[R] Use demangled C++ symbol names for filters, triggers, arguments and/or return values. Possible values are \[lq]full\[rq], \[lq]simple\[rq] and \[lq]no\[rq]. Default is \[lq]simple\[rq] which ignores function arguments and template parameters. .TP -r \f[I]RANGE\f[R], --time-range=\f[I]RANGE\f[R] Only show functions executed within the time RANGE. The RANGE can be \[ti] (separated by \[lq]\[ti]\[rq]) and one of and can be omitted. The and are timestamp or elapsed time if they have postfix, for example `100us'. The timestamp or elapsed time can be shown with \f[V]-f time\f[R] or \f[V]-f elapsed\f[R] option respectively in \f[V]uftrace replay\f[R](1). .SH EXAMPLE .PP This command shows information like the following: .IP .nf \f[C] $ uftrace record fibonacci $ uftrace report Total time Self time Calls Function ========== ========== ========== ==================== 3.781 us 0.124 us 1 main 3.657 us 3.657 us 41 fib 0.345 us 0.345 us 1 __monstartup 0.269 us 0.269 us 1 __cxa_atexit $ uftrace report -s call,self Total time Self time Calls Function ========== ========== ========== ==================== 3.657 us 3.657 us 41 fib 0.345 us 0.345 us 1 __monstartup 0.269 us 0.269 us 1 __cxa_atexit 3.781 us 0.124 us 1 main $ uftrace report --avg-self Self avg Self min Self max Self stdv Function ========== ========== ========== ========== ==================== 0.414 us 0.414 us 0.414 us 0.00% __monstartup 0.356 us 0.356 us 0.356 us 0.00% __cxa_atexit 0.113 us 0.113 us 0.113 us 0.00% main 0.087 us 0.032 us 0.369 us 78.13% fib $ uftrace report --task Total time Self time TID Num funcs Task name ========== ========== ====== ========== ==================== 4.395 us 4.395 us 28662 44 fibonacci $ uftrace record --srcline abc $ uftrace report --srcline Total time Self time Calls Function [Source] ========== ========== ========== ==================== 17.508 us 2.199 us 1 main [./tests/s-abc.c:26] 15.309 us 2.384 us 1 a [./tests/s-abc.c:11] 12.925 us 2.633 us 1 b [./tests/s-abc.c:16] 10.292 us 5.159 us 1 c [./tests/s-abc.c:21] 5.133 us 5.133 us 1 getpid 3.437 us 3.437 us 1 __monstartup 1.959 us 1.959 us 1 __cxa_atexit \f[R] .fi .PP To see a difference between two data: .IP .nf \f[C] $ uftrace record abc $ uftrace report --diff uftrace.data.old # # uftrace diff # [0] base: uftrace.data (from uftrace record abc ) # [1] diff: uftrace.data.old (from uftrace record abc ) # Total time Self time Calls Function ========== ========== ========== ==================== -0.301 us -0.038 us +0 main -0.263 us -0.070 us +0 a -0.193 us -0.042 us +0 b -0.151 us -0.090 us +0 c -0.131 us -0.131 us +0 __cxa_atexit -0.061 us -0.061 us +0 getpid \f[R] .fi .PP The above example shows difference sorted by absolute value of total time. The following changes it to use (non-absolute) value of self time. .IP .nf \f[C] $ uftrace report --diff uftrace.data.old -s self --diff-policy no-abs # # uftrace diff # [0] base: uftrace.data (from uftrace record abc ) # [1] diff: uftrace.data.old (from uftrace record abc ) # Total time Self time Calls Function ========== ========== ========== ==================== -0.301 us -0.038 us +0 main -0.193 us -0.042 us +0 b -0.061 us -0.061 us +0 getpid -0.263 us -0.070 us +0 a -0.151 us -0.090 us +0 c -0.131 us -0.131 us +0 __cxa_atexit \f[R] .fi .PP By using \[lq]full\[rq] policy, user can see raw data as well like below. Also it\[cq]s possible to sort by different column (for raw data). The example below will sort output by total time of the base data. .IP .nf \f[C] $ uftrace report --diff uftrace.data.old --sort-column 0 --diff-policy full,percent # # uftrace diff # [0] base: uftrace.data (from uftrace record abc ) # [1] diff: uftrace.data.old (from uftrace record abc ) # Total time (diff) Self time (diff) Nr. called (diff) Function ================================ ================================ ================================ ==================== 2.812 us 2.511 us -10.70% 0.403 us 0.365 us -9.43% 1 1 +0 main 2.409 us 2.146 us -10.92% 0.342 us 0.272 us -20.47% 1 1 +0 a 2.067 us 1.874 us -9.34% 0.410 us 0.368 us -10.24% 1 1 +0 b 1.657 us 1.506 us -9.11% 0.890 us 0.800 us -10.11% 1 1 +0 c 0.920 us 0.789 us -14.24% 0.920 us 0.789 us -14.24% 1 1 +0 __cxa_atexit 0.767 us 0.706 us -7.95% 0.767 us 0.706 us -7.95% 1 1 +0 getpid \f[R] .fi .SH FIELDS .PP The uftrace allows user to customize the report output with a couple of fields. By default it uses total, self and call fields, but you can use other fields in any order like: .IP .nf \f[C] $ uftrace report -f total,total-max,self-min,call Total time Total max Self min Calls Function ========== ========== ========== ========== ==================== 97.234 us 36.033 us 1.073 us 3 lib_a 50.552 us 26.690 us 2.828 us 2 lib_b 46.806 us 46.806 us 3.290 us 1 main 43.516 us 43.516 us 7.483 us 1 foo 32.010 us 20.847 us 9.684 us 2 lib_c \f[R] .fi .PP Each field can be used as sort key: .IP .nf \f[C] $ uftrace report -f total,total-max,self-min,call -s call Total time Total max Self min Calls Function ========== ========== ========== ========== ==================== 97.234 us 36.033 us 1.073 us 3 lib_a 50.552 us 26.690 us 2.828 us 2 lib_b 32.010 us 20.847 us 9.684 us 2 lib_c 43.516 us 43.516 us 7.483 us 1 foo 46.806 us 46.806 us 3.290 us 1 main $ uftrace report -f total,total-max,self-min,total-min,call -s self-min,total-min Total time Total max Self min Total min Calls Function ========== ========== ========== ========== ========== ==================== 32.010 us 20.847 us 9.684 us 11.163 us 2 lib_c 43.516 us 43.516 us 7.483 us 43.516 us 1 foo 46.806 us 46.806 us 3.290 us 46.806 us 1 main 50.552 us 26.690 us 2.828 us 23.862 us 2 lib_b 97.234 us 36.033 us 1.073 us 27.763 us 3 lib_a \f[R] .fi .PP Each field can be used with \[en]diff option: .IP .nf \f[C] $ uftrace report --diff uftrace.data.old -f total,total-min # # uftrace diff # [0] base: uftrace.data (from uftrace record test/t-lib) # [1] diff: uftrace.data.old (from uftrace record test/t-lib) # Total time Total min Function =========== =========== ==================== +34.560 us +9.884 us lib_a +18.086 us +8.517 us lib_b +16.887 us +16.887 us main +15.479 us +15.479 us foo +10.600 us +3.127 us lib_c $ uftrace report --diff uftrace.data.old -f total,total-min,self-avg --diff-policy full # # uftrace diff # [0] base: uftrace.data (from uftrace record --srcline test/t-lib) # [1] diff: uftrace.data.old (from uftrace record --srcline test/t-lib) # Total time (diff) Total min (diff) Self avg (diff) Function =================================== =================================== =================================== ==================== 14.616 us 13.796 us +0.820 us 4.146 us 3.823 us +0.323 us 0.443 us 0.459 us -0.016 us lib_a 6.529 us 5.957 us +0.572 us 6.529 us 5.957 us +0.572 us 0.436 us 0.356 us +0.080 us main 7.700 us 7.173 us +0.527 us 3.677 us 3.426 us +0.251 us 0.365 us 0.363 us +0.002 us lib_b 6.093 us 5.601 us +0.492 us 6.093 us 5.601 us +0.492 us 0.741 us 0.476 us +0.265 us foo 5.638 us 5.208 us +0.430 us 2.346 us 2.187 us +0.159 us 1.646 us 1.510 us +0.136 us lib_c \f[R] .fi .PP Each field has following meaning: .IP \[bu] 2 total: total time of each function. .IP \[bu] 2 total-avg: average of total time of each function. .IP \[bu] 2 total-min: min of total time of each function. .IP \[bu] 2 total-max: max of total time of each function. .IP \[bu] 2 self: self time of each function. .IP \[bu] 2 self-avg: average of self time of each function. .IP \[bu] 2 self-min: min of self time of each function. .IP \[bu] 2 self-max: max of self time of each function. .IP \[bu] 2 call: called count of each function. .PP The default value is `total,self,call'. If given field name starts with \[lq]+\[rq], then it\[cq]ll be appended to the default fields. So \[lq]-f +total-avg\[rq] is as same as \[lq]-f total,self,call,total-avg\[rq]. And it also accepts a special field name of `none' which disables the field display and shows function output only. .SH TASK FIELDS .IP \[bu] 2 total: total time of each task. .IP \[bu] 2 self: self time of each task. .IP \[bu] 2 func: number of functions in the task. .IP \[bu] 2 tid: task ID. .PP The default value is `total,self,func,tid'. See \f[I]FIELDS\f[R] for field usage. .SH SEE ALSO .PP \f[V]uftrace\f[R](1), \f[V]uftrace-record\f[R](1), \f[V]uftrace-replay\f[R](1), \f[V]uftrace-tui\f[R](1) .SH AUTHORS Namhyung Kim .