[PATCH] D29319: [XRay] Define the InstrumentationMap type

Dean Michael Berris via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 31 01:23:39 PST 2017


dberris created this revision.
Herald added a subscriber: mgorny.

This change implements the instrumentation map loading library which can
understand both YAML-defined instrumentation maps, and ELF 64-bit object
files that have the XRay instrumentation map section. We break it out
into a library on its own to allow for other applications to deal with
the XRay instrumentation map defined in XRay-instrumented binaries.

This type provides both raw access to the logical representation of the
instrumentation map entries as well as higher level functions for
converting a function ID into a function address.

At this point we only support ELF64 binaries and YAML-defined XRay
instrumentation maps. Future changes should extend this to support
32-bit ELF binaries, as well as other binary formats (like MachO).

As part of this change we also migrate all uses of the extraction logic
that used to be defined in tools/llvm-xray/ to use this new type and
interface for loading from files. We also remove the flag from the
`llvm-xray` tool that required users to specify the type of the
instrumentation map file being provided to instead make the library
auto-detect the file type.


https://reviews.llvm.org/D29319

Files:
  include/llvm/XRay/InstrumentationMap.h
  lib/XRay/CMakeLists.txt
  lib/XRay/InstrumentationMap.cpp
  test/tools/llvm-xray/X86/account-deduce-tail-call.yaml
  test/tools/llvm-xray/X86/account-keep-going.yaml
  test/tools/llvm-xray/X86/account-simple-case.yaml
  test/tools/llvm-xray/X86/account-simple-sorting.yaml
  test/tools/llvm-xray/X86/convert-with-yaml-instrmap.txt
  test/tools/llvm-xray/X86/graph-color-simple-case.yaml
  test/tools/llvm-xray/X86/graph-deduce-tail-call.yaml
  test/tools/llvm-xray/X86/graph-simple-case.yaml
  tools/llvm-xray/xray-account.cc
  tools/llvm-xray/xray-converter.cc
  tools/llvm-xray/xray-extract.cc
  tools/llvm-xray/xray-extract.h
  tools/llvm-xray/xray-graph.cc
  tools/llvm-xray/xray-sleds.h

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D29319.86394.patch
Type: text/x-patch
Size: 49384 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170131/d8513a98/attachment.bin>


More information about the llvm-commits mailing list