llvm-project/compiler-rt/test/xray/TestCases/Linux
Dean Michael Berris d06e917b9e [XRay][compiler-rt] Use a hand-written circular buffer in BufferQueue
Summary:
This change removes the dependency on using a std::deque<...> for the
storage of the buffers in the buffer queue. We instead implement a
fixed-size circular buffer that's resilient to exhaustion, and preserves
the semantics of the BufferQueue.

We're moving away from using std::deque<...> for two reasons:

  - We want to remove dependencies on the STL for data structures.

  - We want the data structure we use to not require re-allocation in
    the normal course of operation.

The internal implementation of the buffer queue uses heap-allocated
arrays that are initialized once when the BufferQueue is created, and
re-uses slots in the buffer array as buffers are returned in order.

We also change the lock used in the implementation to a spinlock
instead of a blocking mutex. We reason that since the release operations
now take very little time in the critical section, that a spinlock would
be appropriate.

This change is related to D38073.

This change is a re-submit with the following changes:

  - Keeping track of the live buffers with a counter independent of the
    pointers keeping track of the extents of the circular buffer.

  - Additional documentation of what the data members are meant to
    represent.

Reviewers: dblaikie, kpw, pelikan

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D38119

llvm-svn: 314877
2017-10-04 05:20:13 +00:00
..
always-never-instrument.cc [XRay][compiler-rt][NFC] Move test case into correct directory. 2017-06-28 05:21:15 +00:00
arg1-arg0-logging.cc [XRay][compiler-rt][NFC] Add a test for both arg1 and arg0 handling in the same binary 2017-06-19 03:52:25 +00:00
arg1-logger.cc [XRay] [compiler-rt] FDR logging arg1 handler 2017-09-28 05:29:59 +00:00
arg1-logging-implicit-this.cc Add test for logging the implicit "this" argument for C++ member functions. 2017-06-16 03:24:07 +00:00
argv0-log-file-name.cc [compiler-rt][xray][mips] Mark some tests as unsupported. 2017-09-06 10:17:29 +00:00
coverage-sample.cc [compiler-rt][xray][mips] Mark some tests as unsupported. 2017-09-06 10:17:29 +00:00
custom-event-handler-alignment.cc [XRay][compiler-rt] Support sled versioning for custom event sleds 2017-08-23 04:42:37 +00:00
custom-event-logging.cc [XRay][compiler-rt] Support sled versioning for custom event sleds 2017-08-23 04:42:37 +00:00
fdr-mode.cc [XRay] [compiler-rt] FDR logging arg1 handler 2017-09-28 05:29:59 +00:00
fdr-single-thread.cc [XRay] [compiler-rt] make sure single threaded programs get traced too 2017-10-04 05:12:00 +00:00
fdr-thread-order.cc [XRay][compiler-rt] Use a hand-written circular buffer in BufferQueue 2017-10-04 05:20:13 +00:00
fixedsize-logging.cc [compiler-rt][xray][mips] Mark some tests as unsupported. 2017-09-06 10:17:29 +00:00
func-id-utils.cc [compiler-rt][xray][mips] Mark some tests as unsupported. 2017-09-06 10:17:29 +00:00
optional-inmemory-log.cc [compiler-rt][xray][mips] Mark some tests as unsupported. 2017-09-06 10:17:29 +00:00
patching-unpatching.cc [compiler-rt][xray][mips] Mark some tests as unsupported. 2017-09-06 10:17:29 +00:00
pic_test.cc [compiler-rt][xray][mips] Mark some tests as unsupported. 2017-09-06 10:17:29 +00:00
quiet-start.cc [XRay][compiler-rt] Fix test to not be too strict with output order. 2017-07-31 06:58:09 +00:00