mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-31 20:51:52 +01:00
563627eb7b
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. This change enables disassembling the text sections to build various address maps that are potentially used by the virtual unwinder. A switch `--show-disassembly` is being added to print the disassembly code. Like the llvm-objdump tool, this change leverages existing LLVM components to parse and disassemble ELF binary files. So far X86 is supported. Test Plan: ninja check-llvm Reviewed By: wmi, wenlei Differential Revision: https://reviews.llvm.org/D89712
33 lines
3.6 KiB
Plaintext
33 lines
3.6 KiB
Plaintext
; REQUIRES: x86-registered-target
|
|
; RUN: llvm-mc -filetype=obj -triple=x86_64 %S/disassemble.s -o %t
|
|
; RUN: llvm-profgen --perfscript=%s --binary=%t --output=%t --show-mmap-events | FileCheck %s
|
|
|
|
PERF_RECORD_MMAP2 2580483/2580483: [0x400000(0x1000) @ 0 103:01 539973862 1972407324]: r-xp /home/a.out
|
|
PERF_RECORD_MMAP2 2580483/2580483: [0x7f2505b40000(0x224000) @ 0 08:04 19532214 4169021329]: r-xp /usr/lib64/ld-2.17.so
|
|
PERF_RECORD_MMAP2 2580483/2580483: [0x7ffe88097000(0x1000) @ 0 00:00 0 0]: r-xp [vdso]
|
|
PERF_RECORD_MMAP2 2580483/2580483: [0x7f2505d56000(0xa000) @ 0 08:04 19530021 4190740662]: r-xp /usr/lib64/perf_fopen_hook.so
|
|
PERF_RECORD_MMAP2 2580483/2580483: [0x7f250593c000(0x204000) @ 0 08:04 19532229 3585508847]: r-xp /usr/lib64/libdl-2.17.so
|
|
PERF_RECORD_MMAP2 2580483/2580483: [0x7f250556e000(0x3ce000) @ 0 08:04 19532221 4003737677]: r-xp /usr/lib64/libc-2.17.so
|
|
PERF_RECORD_MMAP2 2580483/2580483: [0x7f2505358000(0x216000) @ 0 08:04 19534595 2609212015]: r-xp /usr/lib64/libz.so.1.2.7
|
|
7f2505b49811
|
|
0x7f2505b49811/0x7f2505b509f0/P/-/-/0 0x7f2505b4974c/0x7f2505b4975b/P/-/-/0 0x7f2505b49837/0x7f2505b49720/P/-/-/0 0x7f2505b50a5a/0x7f2505b49816/P/-/-/0 0x7f2505b50a27/0x7f2505b50a50/P/-/-/0 0x7f2505b50a36/0x7f2505b50a20/P/-/-/0 0x7f2505b59dd0/0x7f2505b50a34/P/-/-/0 0x7f2505b59db4/0x7f2505b59dc3/P/-/-/0 0x7f2505b50a2f/0x7f2505b59db0/P/-/-/0 0x7f2505b50a15/0x7f2505b50a29/P/-/-/0 0x7f2505b59dd0/0x7f2505b50a05/P/-/-/0 0x7f2505b59db4/0x7f2505b59dc3/P/-/-/0 0x7f2505b50a00/0x7f2505b59db0/P/-/-/0 0x7f2505b49811/0x7f2505b509f0/P/-/-/0 0x7f2505b4974c/0x7f2505b4975b/P/-/-/0 0x7f2505b4a08a/0x7f2505b496a0/P/-/-/0
|
|
PERF_RECORD_MMAP2 2580483/2580483: [0x7f2505d56000(0x8000) @ 0 08:04 19530021 4190740662]: r-xp /usr/lib64/perf_fopen_hook.so
|
|
4006b1
|
|
0x4006b1/0x4006a0/P/-/-/0 0x4006b1/0x4006a0/P/-/-/0 0x4006b1/0x4006a0/P/-/-/0 0x4006b1/0x4006a0/P/-/-/0 0x4006b1/0x4006a0/P/-/-/0 0x4006b1/0x4006a0/P/-/-/0 0x4006b1/0x4006a0/P/-/-/0 0x4006b1/0x4006a0/P/-/-/0 0x4006b1/0x4006a0/P/-/-/0 0x4006b1/0x4006a0/P/-/-/0 0x4006b1/0x4006a0/P/-/-/0 0x4006b1/0x4006a0/P/-/-/0 0x4006b1/0x4006a0/P/-/-/0 0x4006b1/0x4006a0/P/-/-/0 0x4006b1/0x4006a0/P/-/-/0 0x4006b1/0x4006a0/P/-/-/0
|
|
PERF_RECORD_MMAP2 2580483/2580483: [0x7f2505156000(0x202000) @ 0 103:01 539962022 734061270]: r-xp /home/hoy/test/dlopen/helper.so
|
|
4006b1
|
|
0x4006b1/0x4006a0/P/-/-/0 0x4006b1/0x4006a0/P/-/-/0 0x4006b1/0x4006a0/P/-/-/0 0x4006b1/0x4006a0/P/-/-/0 0x4006b1/0x4006a0/P/-/-/0 0x4006b1/0x4006a0/P/-/-/0 0x4006b1/0x4006a0/P/-/-/0 0x4006b1/0x4006a0/P/-/-/0 0x4006b1/0x4006a0/P/-/-/0 0x4006b1/0x4006a0/P/-/-/0 0x4006b1/0x4006a0/P/-/-/0 0x4006b1/0x4006a0/P/-/-/0 0x4006b1/0x4006a0/P/-/-/0 0x4006b1/0x4006a0/P/-/-/0 0x4006b1/0x4006a0/P/-/-/0 0x4006b1/0x4006a0/P/-/-/0
|
|
PERF_RECORD_MMAP2 2580483/2580483: [0x7f2505156000(0x202000) @ 0 103:01 539962022 734061270]: r-xp /home/hoy/test/dlopen/helper.so
|
|
|
|
|
|
; CHECK: Mmap: Binary /home/a.out loaded at 0x400000
|
|
; CHECK: Mmap: Binary /usr/lib64/ld-2.17.so loaded at 0x7f2505b40000
|
|
; CHECK: Mmap: Binary [vdso] loaded at 0x7ffe88097000
|
|
; CHECK: Mmap: Binary /usr/lib64/perf_fopen_hook.so loaded at 0x7f2505d56000
|
|
; CHECK: Mmap: Binary /usr/lib64/libdl-2.17.so loaded at 0x7f250593c000
|
|
; CHECK: Mmap: Binary /usr/lib64/libc-2.17.so loaded at 0x7f250556e000
|
|
; CHECK: Mmap: Binary /usr/lib64/libz.so.1.2.7 loaded at 0x7f2505358000
|
|
; CHECK: Mmap: Binary /usr/lib64/perf_fopen_hook.so loaded at 0x7f2505d56000
|
|
; CHECK: Mmap: Binary /home/hoy/test/dlopen/helper.so loaded at 0x7f2505156000
|
|
; CHECK: Mmap: Binary /home/hoy/test/dlopen/helper.so loaded at 0x7f2505156000
|