1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 02:52:53 +02:00
llvm-mirror/docs/CommandGuide/llvm-profgen.rst
wlei cc95d46ee1 [CSSPGO][llvm-profgen] Parse mmap events from perf script
This stack of changes introduces `llvm-profgen` utility which generates a profile data file from given perf script data files for sample-based PGO. It’s part of(not only) the CSSPGO work. Specifically to support context-sensitive with/without pseudo probe profile, it implements a series of functionalities including perf trace parsing, instruction symbolization, LBR stack/call frame stack unwinding, pseudo probe decoding, etc. Also high throughput is achieved by multiple levels of sample aggregation and compatible format with one stop is generated at the end. Please refer to: https://groups.google.com/g/llvm-dev/c/1p1rdYbL93s for the CSSPGO RFC.

As a starter, this change sets up an entry point by introducing PerfReader to load profiled binaries and perf traces(including perf events and perf samples). For the event, here it parses the mmap2 events from perf script to build the loader snaps, which is used to retrieve the image load address in the subsequent perf tracing parsing.

As described in llvm-profgen.rst, the tool being built aims to support multiple input perf data (preprocessed by perf script) as well as multiple input binary images. It should also support dynamic reload/unload shared objects by leveraging the loader snaps being built by this change

Reviewed By: wenlei, wmi

Differential Revision: https://reviews.llvm.org/D89707
2020-11-20 14:26:26 -08:00

43 lines
981 B
ReStructuredText

llvm-profgen - LLVM SPGO profile generation tool
=================================
.. program:: llvm-profgen
SYNOPSIS
--------
:program:`llvm-profgen` [*commands*] [*options*]
DESCRIPTION
-----------
The :program:`llvm-profgen` utility generates a profile data file
from given perf script data files for sample-based profile guided
optimization(SPGO).
COMMANDS
--------
At least one of the following commands are required:
.. option:: --perfscript=<string[,string,...]>
Path of perf-script trace created by Linux perf tool with `script`
command(the raw perf.data should be profiled with -b).
.. option:: --output=<string>
Path of the output profile file.
OPTIONS
-------
:program:`llvm-profgen` supports the following options:
.. option:: --binary=<string[,string,...]>
Path of the input profiled binary files. If no file path is specified, the
path of the actual profiled binaries will be used instead.
.. option:: --show-mmap-events
Print mmap events.