162306a36Sopenharmony_ciFor a higher level overview, try: perf report --sort comm,dso
262306a36Sopenharmony_ciSample related events with: perf record -e '{cycles,instructions}:S'
362306a36Sopenharmony_ciCompare performance results with: perf diff [<old file> <new file>]
462306a36Sopenharmony_ciBoolean options have negative forms, e.g.: perf report --no-children
562306a36Sopenharmony_ciCustomize output of perf script with: perf script -F event,ip,sym
662306a36Sopenharmony_ciGenerate a script for your data: perf script -g <lang>
762306a36Sopenharmony_ciSave output of perf stat using: perf stat record <target workload>
862306a36Sopenharmony_ciCreate an archive with symtabs to analyse on other machine: perf archive
962306a36Sopenharmony_ciSearch options using a keyword: perf report -h <keyword>
1062306a36Sopenharmony_ciUse parent filter to see specific call path: perf report -p <regex>
1162306a36Sopenharmony_ciList events using substring match: perf list <keyword>
1262306a36Sopenharmony_ciTo see list of saved events and attributes: perf evlist -v
1362306a36Sopenharmony_ciUse --symfs <dir> if your symbol files are in non-standard locations
1462306a36Sopenharmony_ciTo see callchains in a more compact form: perf report -g folded
1562306a36Sopenharmony_ciShow individual samples with: perf script
1662306a36Sopenharmony_ciLimit to show entries above 5% only: perf report --percent-limit 5
1762306a36Sopenharmony_ciProfiling branch (mis)predictions with: perf record -b / perf report
1862306a36Sopenharmony_ciTo show assembler sample contexts use perf record -b / perf script -F +brstackinsn --xed
1962306a36Sopenharmony_ciTreat branches as callchains: perf report --branch-history
2062306a36Sopenharmony_ciTo count events in every 1000 msec: perf stat -I 1000
2162306a36Sopenharmony_ciPrint event counts in CSV format with: perf stat -x,
2262306a36Sopenharmony_ciIf you have debuginfo enabled, try: perf report -s sym,srcline
2362306a36Sopenharmony_ciFor memory address profiling, try: perf mem record / perf mem report
2462306a36Sopenharmony_ciFor tracepoint events, try: perf report -s trace_fields
2562306a36Sopenharmony_ciTo record callchains for each sample: perf record -g
2662306a36Sopenharmony_ciTo record every process run by a user: perf record -u <user>
2762306a36Sopenharmony_ciSkip collecting build-id when recording: perf record -B
2862306a36Sopenharmony_ciTo change sampling frequency to 100 Hz: perf record -F 100
2962306a36Sopenharmony_ciSee assembly instructions with percentage: perf annotate <symbol>
3062306a36Sopenharmony_ciIf you prefer Intel style assembly, try: perf annotate -M intel
3162306a36Sopenharmony_ciFor hierarchical output, try: perf report --hierarchy
3262306a36Sopenharmony_ciOrder by the overhead of source file name and line number: perf report -s srcline
3362306a36Sopenharmony_ciSystem-wide collection from all CPUs: perf record -a
3462306a36Sopenharmony_ciShow current config key-value pairs: perf config --list
3562306a36Sopenharmony_ciShow user configuration overrides: perf config --user --list
3662306a36Sopenharmony_ciTo add Node.js USDT(User-Level Statically Defined Tracing): perf buildid-cache --add `which node`
3762306a36Sopenharmony_ciTo report cacheline events from previous recording: perf c2c report
3862306a36Sopenharmony_ciTo browse sample contexts use perf report --sample 10 and select in context menu
3962306a36Sopenharmony_ciTo separate samples by time use perf report --sort time,overhead,sym
4062306a36Sopenharmony_ciTo set sample time separation other than 100ms with --sort time use --time-quantum
4162306a36Sopenharmony_ciAdd -I to perf record to sample register values, which will be visible in perf report sample context.
4262306a36Sopenharmony_ciTo show IPC for sampling periods use perf record -e '{cycles,instructions}:S' and then browse context
4362306a36Sopenharmony_ciTo show context switches in perf report sample context add --switch-events to perf record.
44