This is an archive of the discontinued LLVM Phabricator instance.

[XRay][clang+compiler-rt] Support build-time mode selection
ClosedPublic

Authored by dberris on Apr 9 2018, 11:24 PM.

Details

Summary

This patch implements the -fxray-modes= flag which allows users
building with XRay instrumentation to decide which modes to pre-package
into the binary being linked. The default is the status quo, which will
link all the available modes.

For this to work we're also breaking apart the mode implementations
(xray-fdr and xray-basic) from the main xray runtime. This gives more
granular control of which modes are pre-packaged, and picked from
clang's invocation.

This fixes llvm.org/PR37066.

Note that in the future, we may change the default for clang to only
contain the profiling implementation under development in D44620, when
that implementation is ready.

Diff Detail

Repository
rL LLVM

Event Timeline

dberris created this revision.Apr 9 2018, 11:24 PM
echristo accepted this revision.Apr 10 2018, 6:13 PM

Sure.

clang/lib/Driver/XRayArgs.cpp
168 ↗(On Diff #141794)

Technically separate commit.

This revision is now accepted and ready to land.Apr 10 2018, 6:13 PM
dberris updated this revision to Diff 141940.Apr 10 2018, 6:22 PM
dberris marked an inline comment as done.

Revert unnecessary one-liner change.

This revision was automatically updated to reflect the committed changes.