This is an archive of the discontinued LLVM Phabricator instance.

[XRay][tools] Support new kinds of instrumentation map entries
ClosedPublic

Authored by dberris on Aug 16 2017, 11:19 PM.

Details

Summary

When extracting the instrumentation map from a binary, we should be able
to recognize the new kinds of instrumentation sleds we've been emitting
with the compiler using -fxray-instrument. This change adds a test for
all the kinds of sleds we currently support (sans the tail-call sled,
which is a bit harder to force in a simple prebuilt input).

Diff Detail

Repository
rL LLVM

Event Timeline

dberris created this revision.Aug 16 2017, 11:19 PM
kpw accepted this revision.Aug 18 2017, 11:04 AM

I've missed the opportunity to do something similar in the past, but it would be nice to have a txt file in the X86/Inputs directory that explains how the binary data was generated and how it's layed out.

Maybe you could even put this into the extract-all-sledtypes.txt comments.

lib/XRay/InstrumentationMap.cpp
104–108 ↗(On Diff #111468)

It makes me sad that I couldn't find a good way to do this without duplicating the enum definitions.
Why can't the stdlib define something like:

template<underlying_t_value, enum_class_t>
struct is_enumerated {
    static const bool value = <whether there is a value in the enum class defined for underlying_t_value>;
};

Even exploring TMP necromancy didn't make it much better :(

This revision is now accepted and ready to land.Aug 18 2017, 11:04 AM
dberris updated this revision to Diff 111915.Aug 20 2017, 5:13 PM

Update comment in test on how the input is generated.

dberris marked an inline comment as done.Aug 20 2017, 5:14 PM
dberris added inline comments.
lib/XRay/InstrumentationMap.cpp
104–108 ↗(On Diff #111468)

Yeah, unfortunately we're going to have to wait for static reflection in C++ to be able to "properly" do this.

This revision was automatically updated to reflect the committed changes.
dberris marked an inline comment as done.