PERF-ANNOTATE(1)
๐ PERF-ANNOTATE โ ok bestie, let's read your perf.data together ๐
so this little icon lives in the perf Manual, section 1, and it's about taking a perf.data file and making the code make sense. ngl it's lowkey one of the prettiest things perf does. let's go ๐ซถ
โจ NAME โจ
perf-annotate โ Read perf.data (created by perf record) and display annotated code ๐
๐ธ SYNOPSIS ๐ธ
perf annotate [-i <file> | --input=file] [symbol_name]
๐ฆ DESCRIPTION ๐ฆ
okay so picture this: this command reads the input file and shows you a whole annotated version of the code. โจ
and the way that it gets better โ if the object file has debug symbols, you get the source code displayed alongside the assembly code. like, side by side. main character energy fr.
but if there's no debug info in the object? no stress, you just get the annotated assembly displayed instead. still slay, just more raw. ๐
๐ OPTIONS ๐
-i,--input=<file>โ the input file name, bestie. (default:perf.dataunless stdin is a fifo ๐)-d,--dsos=<dso[,dso...]>โ only consider symbols in these dsos. just these ones. narrow the vibe.-s,--symbol=<symbol>โ the symbol you wanna annotate ๐ฏ-f,--forceโ don't do ownership validation. just. don't. ๐-v,--verboseโ be more verbose. (Show symbol address, etc) โ she's chatty and we love that-q,--quietโ do not show any warnings or messages. (Suppress-v) โ she's giving silent treatment-n,--show-nr-samplesโ show the number of samples for each symbol ๐ข-D,--dump-raw-traceโ dump raw trace in ASCII. raw. unfiltered. ๐-k,--vmlinux=<file>โ vmlinux pathname.
โ ๏ธ-m,--modulesโ load module symbols. WARNING: use only with-kand LIVE kernel. like, fr fr, read that twice.
--ignore-vmlinuxโ ignore vmlinux files. not today โ-l,--print-lineโ print matching source lines (may be slow ๐)-P,--full-pathsโ don't shorten the displayed pathnames. full government name energy--stdioโ use the stdio interface.--stdio2โ use the stdio2 interface, non-interactive, uses the TUI formatting. iconic but offscreen--stdio-color=<mode>โalways,neverorauto, allowing configuring color output via the command line, in addition to via"color.ui".perfconfig. Use--stdio-color alwaysto generate color even when redirecting to a pipe or file. Using just--stdio-coloris equivalent to usingalways. ๐ (yes that's the whole mood)--tuiโ use the TUI interface. Use of--tuirequires a tty; if one is not present, as when piping to other commands, the stdio interface is used. This interfaces starts by centering on the line with more samples, TAB/UNTAB cycles through the lines with more samples. keyboard girlies rise ๐--gtkโ use the GTK interface.-C,--cpu=<cpu>โ only report samples for the list of CPUs provided. Multiple CPUs can be provided as a comma-separated list with no space:0,1. Ranges of CPUs are specified with-:0-2. Default is to report samples on all CPUs. ๐ป--asm-rawโ show raw instruction encoding of assembly instructions.--show-total-periodโ show a column with the sum of periods.--sourceโ interleave source code with assembly code. Enabled by default, disable with--no-source.--symfs=<directory[,layout]>โ look for files with symbols relative to this directory. The optional layout can behierarchy(default, matches full path) orflat(only matches base name). This is useful when debug files are stored in a flat directory structure. ๐๏ธ-M,--disassembler-style=โ set disassembler style for objdump.--addr2line=<path>โ path toaddr2linebinary.--objdump=<path>โ path toobjdumpbinary.--prefix=PREFIX,--prefix-strip=Nโ remove first N entries from source file path names in executables and add PREFIX. This allows to display source code compiled on systems with different file system layout. ๐ง--skip-missingโ skip symbols that cannot be annotated.--groupโ show event group information together.--demangleโ demangle symbol names to human readable form. It's enabled by default, disable with--no-demangle.--demangle-kernelโ demangle kernel symbol names to human readable form (for C++ kernels). yes, C++ kernels are a thing ๐--percent-typeโ set annotation percent type from following choices:global-period,local-period,global-hits,local-hits
The local/global keywords set if the percentage is computed in the scope of the function (local) or the whole data (global). The period/hits keywords set the base the percentage is computed on โ the samples period or the number of samples (hits). ๐งฎ
--percent-limitโ do not show functions which have an overhead under that percent onstdioorstdio2(Default:0). Note that this is about selection of functions to display, not about lines within the function. ok that distinction matters, don't @ me--data-type[=TYPE_NAME]โ display data type annotation instead of code. It infers data type of samples (if they are memory accessing instructions) using DWARF debug information. It can take an optional argument of data type name. In that case it'd show annotation for the type only, otherwise it'd show all data types it finds. ๐โจ--type-statโ show stats for the data type annotation.--skip-emptyโ do not display empty (or dummy) events.--code-with-typeโ show data type info in code annotation (for memory instructions only).
๐ง --itrace deep dive (this one's a whole personality) ๐
--itraceโ Options for decoding instruction tracing data. The options are:iโ synthesize instructions eventsyโ synthesize cycles eventsbโ synthesize branches eventscโ synthesize branches events (calls only)rโ synthesize branches events (returns only)xโ synthesize transactions eventswโ synthesize ptwrite eventspโ synthesize power events (incl. PSB events for Intel PT)oโ synthesize other events recorded due to the use of aux-output (refer to perf record)Iโ synthesize interrupt or similar (asynchronous) events (e.g. Intel PT Event Trace)eโ synthesize error eventsdโ create a debug logfโ synthesize first level cache eventsmโ synthesize last level cache eventsMโ synthesize memory eventstโ synthesize TLB eventsaโ synthesize remote access eventsgโ synthesize a call chain (use withiorx)Gโ synthesize a call chain on existing event recordslโ synthesize last branch entries (use withiorx)Lโ synthesize last branch entries on existing event recordssโ skip initial number of eventsqโ quicker (less detailed) decodingAโ approximate IPCZโ prefer to ignore timestamps (so-called "timeless" decoding)Tโ use the timestamp trace as kernel time
The default is all events i.e. the same as --itrace=iybxwpe, except for perf script where it is --itrace=ce. ๐
In addition, the period (default 100000, except for perf script where it is 1) for instructions events can be specified in units of:
iโ instructionstโ ticksmsโ millisecondsusโ microsecondsnsโ nanoseconds (default)
Also the call chain size (default 16, max. 1024) for instructions or transactions events can be specified. ๐
Also the number of last branch entries (default 64, max. 1024) for instructions or transactions events can be specified.
Similar to options g and l, size may also be specified for options G and L. On x86, note that G and L work poorly when data has been recorded with large PEBS. Refer linkperf:perf-intel-pt[1] man page for details. ๐ญ (yes, "work poorly" โ that's the actual situation)
It is also possible to skip events generated (instructions, branches, transactions, ptwrite, power) at the beginning. This is useful to ignore initialization code.
--itrace=i0nss1000000
skips the first million instructions. ๐ซก
The e option may be followed by flags which affect what errors will or will not be reported. Each flag must be preceded by either + or -. The flags are:
oโ overflowlโ trace data lost
If supported, the d option may be followed by flags which affect what debug messages will or will not be logged. Each flag must be preceded by either + or -. The flags are:
aโ all perf eventseโ output only on errors (size configurable โ seelinkperf:perf-config[1])oโ output to stdout
If supported, the q option may be repeated to increase the effect. ๐
๐
๐
To disable decoding entirely, use --no-itrace. bye ๐
๐ SEE ALSO ๐
perf-record(1), perf-report(1)
okay that's the whole page bestie, you're officially an annotate girlie now ๐โจ go forth and annotate. and remember: use --modules only with -k and a LIVE kernel or I will find out ๐ค๐ซถ
perf Manual ยท 10/31/2026 โ signed, sealed, delivered, periodt. ๐๐
๐ฆ where this page comes from
- arch rolling: perf 7.3.1-1 ยท GPL-2.0-only
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms