[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-10-19 06:36:54 +02:00
|
|
|
llvm-profgen - LLVM SPGO profile generation tool
|
2020-11-21 01:20:37 +01:00
|
|
|
=================================================
|
[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-10-19 06:36:54 +02:00
|
|
|
|
|
|
|
.. 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).
|
|
|
|
|
2020-10-19 19:02:05 +02:00
|
|
|
.. option:: --binary=<string[,string,...]>
|
|
|
|
|
|
|
|
Path of the input profiled binary files.
|
|
|
|
|
[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-10-19 06:36:54 +02:00
|
|
|
.. option:: --output=<string>
|
|
|
|
|
|
|
|
Path of the output profile file.
|
|
|
|
|
|
|
|
OPTIONS
|
|
|
|
-------
|
|
|
|
:program:`llvm-profgen` supports the following options:
|
|
|
|
|
|
|
|
.. option:: --show-mmap-events
|
|
|
|
|
|
|
|
Print mmap events.
|
2020-10-19 19:02:05 +02:00
|
|
|
|
|
|
|
.. option:: --show-disassembly
|
|
|
|
|
|
|
|
Print disassembled code.
|
|
|
|
|
|
|
|
.. option:: --x86-asm-syntax=[att|intel]
|
|
|
|
|
|
|
|
Specify whether to print assembly code in AT&T syntax (the default) or Intel
|
|
|
|
syntax.
|