Path: blob/master/tools/perf/Documentation/perf-annotate.txt
26282 views
perf-annotate(1)1================23NAME4----5perf-annotate - Read perf.data (created by perf record) and display annotated code67SYNOPSIS8--------9[verse]10'perf annotate' [-i <file> | --input=file] [symbol_name]1112DESCRIPTION13-----------14This command reads the input file and displays an annotated version of the15code. If the object file has debug symbols then the source code will be16displayed alongside assembly code.1718If there is no debug info in the object, then annotated assembly is displayed.1920OPTIONS21-------22-i::23--input=<file>::24Input file name. (default: perf.data unless stdin is a fifo)2526-d::27--dsos=<dso[,dso...]>::28Only consider symbols in these dsos.29-s::30--symbol=<symbol>::31Symbol to annotate.3233-f::34--force::35Don't do ownership validation.3637-v::38--verbose::39Be more verbose. (Show symbol address, etc)4041-q::42--quiet::43Do not show any warnings or messages. (Suppress -v)4445-n::46--show-nr-samples::47Show the number of samples for each symbol4849-D::50--dump-raw-trace::51Dump raw trace in ASCII.5253-k::54--vmlinux=<file>::55vmlinux pathname.5657--ignore-vmlinux::58Ignore vmlinux files.5960--itrace::61Options for decoding instruction tracing data. The options are:6263include::itrace.txt[]6465To disable decoding entirely, use --no-itrace.6667-m::68--modules::69Load module symbols. WARNING: use only with -k and LIVE kernel.7071-l::72--print-line::73Print matching source lines (may be slow).7475-P::76--full-paths::77Don't shorten the displayed pathnames.7879--stdio:: Use the stdio interface.8081--stdio2:: Use the stdio2 interface, non-interactive, uses the TUI formatting.8283--stdio-color=<mode>::84'always', 'never' or 'auto', allowing configuring color output85via the command line, in addition to via "color.ui" .perfconfig.86Use '--stdio-color always' to generate color even when redirecting87to a pipe or file. Using just '--stdio-color' is equivalent to88using 'always'.8990--tui:: Use the TUI interface. Use of --tui requires a tty, if one is not91present, as when piping to other commands, the stdio interface is92used. This interfaces starts by centering on the line with more93samples, TAB/UNTAB cycles through the lines with more samples.9495--gtk:: Use the GTK interface.9697-C::98--cpu=<cpu>:: Only report samples for the list of CPUs provided. Multiple CPUs can99be provided as a comma-separated list with no space: 0,1. Ranges of100CPUs are specified with -: 0-2. Default is to report samples on all101CPUs.102103--asm-raw::104Show raw instruction encoding of assembly instructions.105106--show-total-period:: Show a column with the sum of periods.107108--source::109Interleave source code with assembly code. Enabled by default,110disable with --no-source.111112--symfs=<directory>::113Look for files with symbols relative to this directory.114115-M::116--disassembler-style=:: Set disassembler style for objdump.117118--addr2line=<path>::119Path to addr2line binary.120121--objdump=<path>::122Path to objdump binary.123124--prefix=PREFIX::125--prefix-strip=N::126Remove first N entries from source file path names in executables127and add PREFIX. This allows to display source code compiled on systems128with different file system layout.129130--skip-missing::131Skip symbols that cannot be annotated.132133--group::134Show event group information together135136--demangle::137Demangle symbol names to human readable form. It's enabled by default,138disable with --no-demangle.139140--demangle-kernel::141Demangle kernel symbol names to human readable form (for C++ kernels).142143--percent-type::144Set annotation percent type from following choices:145global-period, local-period, global-hits, local-hits146147The local/global keywords set if the percentage is computed148in the scope of the function (local) or the whole data (global).149The period/hits keywords set the base the percentage is computed150on - the samples period or the number of samples (hits).151152--percent-limit::153Do not show functions which have an overhead under that percent on154stdio or stdio2 (Default: 0). Note that this is about selection of155functions to display, not about lines within the function.156157--data-type[=TYPE_NAME]::158Display data type annotation instead of code. It infers data type of159samples (if they are memory accessing instructions) using DWARF debug160information. It can take an optional argument of data type name. In161that case it'd show annotation for the type only, otherwise it'd show162all data types it finds.163164--type-stat::165Show stats for the data type annotation.166167--skip-empty::168Do not display empty (or dummy) events.169170--code-with-type::171Show data type info in code annotation (for memory instructions only).172Currently it only works with --stdio option.173174175SEE ALSO176--------177linkperf:perf-record[1], linkperf:perf-report[1]178179180