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

Dean Michael Berris via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Jul 15 20:39:27 PDT 2018


dberris created this revision.
dberris added reviewers: kpw, eizan.

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.


https://reviews.llvm.org/D49359

Files:
  compiler-rt/lib/xray/xray_fdr_logging.cc
  compiler-rt/test/xray/TestCases/Posix/fdr-mode-multiple.cc

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D49359.155612.patch
Type: text/x-patch
Size: 9939 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180716/4ddf9ba3/attachment.bin>


More information about the llvm-commits mailing list