[PATCH] D104087: Add llvm-mipdata tool

Ellis Hoag via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 10 18:29:25 PDT 2021


ellis created this revision.
Herald added subscribers: hiraditya, mgorny.
ellis requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

The `llvm-mipdata` tool is used to create, merge, and show machine profiles.

Usage:
The compiler provides us with a map file `default.mipmap` at build time which we need to convert to a profile.

  $ llvm-mipdata create -p default.mip default.mipmap

When we run the instrumented binary, it will produce a raw file `default.mipraw` that we can merge into our profile.

  $ llvm-mipdata merge -p default.mip default.mipraw

Then we view the contents of the profile. If we have debug info, we can also view source info from the profile.

  $ llvm-mipdata show -p default.mip --debug a.out
  _Z3fooi
    Source Info: /home/main.cpp:9
    Call Count: 0
    Block Coverage:
       COLD COLD COLD COLD HOT
  
  _Z3bari
    Source Info: /home/main.cpp:16
    Call Count: 1
    Block Coverage:
       HOT  HOT  COLD HOT  HOT


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D104087

Files:
  llvm/include/llvm/CodeGen/MIPReader.h
  llvm/include/llvm/CodeGen/MIPWriter.h
  llvm/include/llvm/CodeGen/MIPYaml.h
  llvm/include/llvm/MIP/MIP.h
  llvm/lib/CodeGen/CMakeLists.txt
  llvm/lib/CodeGen/MIP.cpp
  llvm/lib/CodeGen/MIPReader.cpp
  llvm/lib/CodeGen/MIPWriter.cpp
  llvm/test/CMakeLists.txt
  llvm/test/tools/llvm-mipdata/Inputs/function-coverage.mipmap.hex
  llvm/test/tools/llvm-mipdata/Inputs/function-coverage.mipraw.hex
  llvm/test/tools/llvm-mipdata/Inputs/profile.yaml
  llvm/test/tools/llvm-mipdata/function-coverage.test
  llvm/test/tools/llvm-mipdata/yaml.test
  llvm/tools/llvm-mipdata/CMakeLists.txt
  llvm/tools/llvm-mipdata/LLVMBuild.txt
  llvm/tools/llvm-mipdata/SymReader.cpp
  llvm/tools/llvm-mipdata/SymReader.h
  llvm/tools/llvm-mipdata/llvm-mipdata.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D104087.351325.patch
Type: text/x-patch
Size: 60188 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210611/23053039/attachment.bin>


More information about the llvm-commits mailing list