This is an archive of the discontinued LLVM Phabricator instance.

[XRay][compiler-rt] FDR Mode: Allow multiple runs
ClosedPublic

Authored by dberris on Jul 15 2018, 8:39 PM.

Details

Summary

Fix a bug in FDR mode which didn't allow for re-initialising the logging
in the same process. This change ensures that:

  • When we flush the FDR mode logging, that the state of the logging implementation is XRAY_LOG_UNINITIALIZED.
  • Fix up the thread-local initialisation to use aligned storage and pthread_getspecific as well as pthread_setspecific for the thread-specific data.
  • Actually use the pointer provided to the thread-exit cleanup handling, instead of assuming that the thread has thread-local data associated with it, and reaching at thread-exit time.

In this change we also have an explicit test for two consecutive
sessions for FDR mode tracing, and ensuring both sessions succeed.

Diff Detail

Repository
rL LLVM

Event Timeline

dberris created this revision.Jul 15 2018, 8:39 PM
This revision was not accepted when it landed; it landed in state Needs Review.Jul 17 2018, 6:36 PM
This revision was automatically updated to reflect the committed changes.