[XRay] Implement `llvm-xray extract`, start of the llvm-xray tool
authorDean Michael Berris <dberris@google.com>
Wed, 26 Oct 2016 04:14:34 +0000 (04:14 +0000)
committerDean Michael Berris <dberris@google.com>
Wed, 26 Oct 2016 04:14:34 +0000 (04:14 +0000)
commitc92bfb5a044b4a135c492fd81c0028c620060a26
tree4978ca3583f8262f279c0a9d65d31813451eb1c1
parentc773c9f49174de58f6a8a2232d169d71787a67ed
[XRay] Implement `llvm-xray extract`, start of the llvm-xray tool

Usage:

  llvm-xray extract <object file> [-o <filename or '-'>]

The tool gets the XRay instrumentation map from an object file and turns
it into YAML.  We first support ELF64 sleds on x86_64 binaries, with
provision for supporting other supported platforms and formats later.

This is the first of a many-part change to fully implement the
`llvm-xray` tool.

We also define a subcommand registration and dispatch mechanism to be
used by other further subcommand implementations for llvm-xray.

Diffusion Revision: https://reviews.llvm.org/D21987

llvm-svn: 285165
20 files changed:
llvm/test/lit.cfg
llvm/test/tools/llvm-xray/X86/Inputs/elf32-noxray.bin [new file with mode: 0755]
llvm/test/tools/llvm-xray/X86/Inputs/elf64-badentrysizes.bin [new file with mode: 0755]
llvm/test/tools/llvm-xray/X86/Inputs/elf64-example.bin [new file with mode: 0755]
llvm/test/tools/llvm-xray/X86/Inputs/elf64-noinstr-map.bin [new file with mode: 0755]
llvm/test/tools/llvm-xray/X86/Inputs/empty-file.bin [new file with mode: 0644]
llvm/test/tools/llvm-xray/X86/bad-instrmap-sizes.bin [new file with mode: 0644]
llvm/test/tools/llvm-xray/X86/empty.txt [new file with mode: 0644]
llvm/test/tools/llvm-xray/X86/extract-instrmap.ll [new file with mode: 0644]
llvm/test/tools/llvm-xray/X86/lit.local.cfg [new file with mode: 0644]
llvm/test/tools/llvm-xray/X86/no-instr-map.txt [new file with mode: 0644]
llvm/test/tools/llvm-xray/X86/no-such-file.txt [new file with mode: 0644]
llvm/test/tools/llvm-xray/X86/unsupported-elf32.txt [new file with mode: 0644]
llvm/tools/llvm-xray/CMakeLists.txt [new file with mode: 0644]
llvm/tools/llvm-xray/llvm-xray.cc [new file with mode: 0644]
llvm/tools/llvm-xray/xray-extract.cc [new file with mode: 0644]
llvm/tools/llvm-xray/xray-extract.h [new file with mode: 0644]
llvm/tools/llvm-xray/xray-registry.cc [new file with mode: 0644]
llvm/tools/llvm-xray/xray-registry.h [new file with mode: 0644]
llvm/tools/llvm-xray/xray-sleds.h [new file with mode: 0644]