[XRay][compiler-rt] XRay Buffer Queue
authorDean Michael Berris <dberris@google.com>
Tue, 6 Dec 2016 06:24:08 +0000 (06:24 +0000)
committerDean Michael Berris <dberris@google.com>
Tue, 6 Dec 2016 06:24:08 +0000 (06:24 +0000)
commitabe04e3295450afd1b9e03a1b91cf87ee3725780
tree898d4263d7e5b839ce2eb1559092b12231dc53a5
parent8b058aec1d9499015e4a3fd2e5a503273a5d384b
[XRay][compiler-rt] XRay Buffer Queue

This implements a simple buffer queue to manage a pre-allocated queue of
fixed-sized buffers to hold XRay records. We need this to support
Flight Data Recorder (FDR) mode. We also implement this as a sub-library
first to allow for development before actually using it in an
implementation.

Some important properties of the buffer queue:

- Thread-safe enqueueing/dequeueing of fixed-size buffers.
- Pre-allocation of buffers at construction.

This is a re-roll of the previous attempt to submit, because it caused
failures in arm and aarch64.

Reviewers: majnemer, echristo, rSerge

Subscribers: tberghammer, danalbert, srhines, modocache, mehdi_amini, mgorny, llvm-commits

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

llvm-svn: 288775
compiler-rt/lib/xray/CMakeLists.txt
compiler-rt/lib/xray/tests/CMakeLists.txt [new file with mode: 0644]
compiler-rt/lib/xray/tests/unit/CMakeLists.txt [new file with mode: 0644]
compiler-rt/lib/xray/tests/unit/buffer_queue_test.cc [new file with mode: 0644]
compiler-rt/lib/xray/tests/unit/xray_unit_test_main.cc [new file with mode: 0644]
compiler-rt/lib/xray/xray_buffer_queue.cc [new file with mode: 0644]
compiler-rt/lib/xray/xray_buffer_queue.h [new file with mode: 0644]
compiler-rt/test/xray/CMakeLists.txt
compiler-rt/test/xray/Unit/lit.site.cfg.in [new file with mode: 0644]