This is an archive of the discontinued LLVM Phabricator instance.

[XRay][compiler-rt] Implement logging implementation registration
ClosedPublic

Authored by dberris on Dec 1 2017, 1:12 AM.

Details

Summary

This change allows for registration of multiple logging implementations
through a central mechanism in XRay, mapping an implementation to a
"mode". Modes are strings that are used as keys to determine which
implementation to install through a single API. This mechanism allows
users to choose which implementation to install either from the
environment variable 'XRAY_OPTIONS' with the xray_mode= flag, or
programmatically using the __xray_select_mode(...) function.

Here, we introduce two API functions for the XRay logging:

__xray_log_register_mode(Mode, Impl): Associates an XRayLogImpl to a
string Mode. We can only have one implementation associated with a given
Mode.

__xray_log_select_mode(Mode): Finds the associated Impl for Mode and
installs it as if by calling __xray_set_log_impl(...).

Along with these changes, we also deprecate the xray_naive_log and
xray_fdr_log flags and encourage users to instead use the xray_mode
flag.

Diff Detail

Repository
rL LLVM

Event Timeline

dberris created this revision.Dec 1 2017, 1:12 AM
eizan accepted this revision.Dec 5 2017, 2:57 AM
This revision is now accepted and ready to land.Dec 5 2017, 2:57 AM
This revision was automatically updated to reflect the committed changes.