[PATCH] D89712: [AutoFDO][llvm-profgen] Disassemble text sections

Lei Wang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 19 10:03:53 PDT 2020


wlei created this revision.
Herald added subscribers: llvm-commits, wenlei, pengfei, mgorny.
Herald added a project: LLVM.
wlei requested review of this revision.

This stack of changes introduces `llvm-profgen` utility which generates a SPGO profile data file from given perf script data files. 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 script parsing, instruction symbolization, LBR stack unwinding, pseudo probe decoding, etc. Also high throughput is achieved by different 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:


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D89712

Files:
  llvm/docs/CommandGuide/llvm-profgen.rst
  llvm/test/tools/llvm-profgen/disassemble.s
  llvm/test/tools/llvm-profgen/lit.local.cfg
  llvm/test/tools/llvm-profgen/mmapEvent.test
  llvm/tools/llvm-profgen/CMakeLists.txt
  llvm/tools/llvm-profgen/ErrorHandling.h
  llvm/tools/llvm-profgen/LLVMBuild.txt
  llvm/tools/llvm-profgen/ProfiledBinary.cpp
  llvm/tools/llvm-profgen/ProfiledBinary.h
  llvm/tools/llvm-profgen/llvm-profgen.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D89712.299086.patch
Type: text/x-patch
Size: 22205 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20201019/c05397f5/attachment.bin>


More information about the llvm-commits mailing list