llvm-project/compiler-rt/lib/xray
Dean Michael Berris 9b57ca171d [XRay] [compiler-rt] Write buffer length to FDR log before writing buffer.
Summary:
Currently the FDR log writer, upon flushing, dumps a sequence of buffers from
its freelist to disk. A reader can read the first buffer up to an EOB record,
but then it is unclear how far ahead to scan to find the next threads traces.

There are a few ways to handle this problem.
1. The reader has externalized knowledge of the buffer size.
2. The size of buffers is in the file header or otherwise encoded in the log.
3. Only write out the portion of the buffer with records. When released, the
   buffers are marked with a size.
4. The reader looks for memory that matches a pattern and synchronizes on it.

2 and 3 seem the most flexible and 2 does not rule 3 out.

This is an implementation of 2.

In addition, the function handler for fdr more aggressively checks for
finalization and makes an attempt to release its buffer.

Reviewers: pelikan, dberris

Reviewed By: dberris

Subscribers: llvm-commits

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

llvm-svn: 298982
2017-03-29 05:56:37 +00:00
..
tests [XRay][compiler-rt] Use sanitizer_common's atomic ops 2017-03-27 07:13:35 +00:00
CMakeLists.txt [XRay] Change the ppc trampoline asm file into a different name, to not collide with the cc file. NFC. 2017-02-22 00:19:43 +00:00
xray_AArch64.cc [XRay] [compiler-rt] Allow logging the first argument of a function call. 2017-03-06 07:25:41 +00:00
xray_arm.cc [XRay] [compiler-rt] Allow logging the first argument of a function call. 2017-03-06 07:25:41 +00:00
xray_buffer_queue.cc [XRay][compiler-rt] Use sanitizer_common's atomic ops 2017-03-27 07:13:35 +00:00
xray_buffer_queue.h [XRay] [compiler-rt] Write buffer length to FDR log before writing buffer. 2017-03-29 05:56:37 +00:00
xray_defs.h [XRay][compiler-rt] Disable XRay instrumentation of the XRay runtime. 2016-11-16 01:01:13 +00:00
xray_fdr_log_records.h [XRay] [compiler-rt] Refactor logic for xray fdr logging. NFC. 2017-03-15 03:12:01 +00:00
xray_fdr_logging.cc [XRay] [compiler-rt] Write buffer length to FDR log before writing buffer. 2017-03-29 05:56:37 +00:00
xray_fdr_logging.h [XRay][compiler-rt] Add an end-to-end test for FDR Logging 2017-03-29 05:19:24 +00:00
xray_fdr_logging_impl.h [XRay] [compiler-rt] Write buffer length to FDR log before writing buffer. 2017-03-29 05:56:37 +00:00
xray_flags.cc [XRay][compiler-rt] Allow for defining defaults at compile-time 2017-02-18 02:09:51 +00:00
xray_flags.h [XRay][compiler-rt][NFC] Turn ProudCase functions to humbleCase functions 2017-02-07 23:35:34 +00:00
xray_flags.inc [XRay][compiler-rt] Switch default XRay 'patch_premain' to false 2017-02-28 08:10:01 +00:00
xray_init.cc [XRay][compiler-rt] Use sanitizer_common's atomic ops 2017-03-27 07:13:35 +00:00
xray_inmemory_log.cc [XRay][compiler-rt] Support TSC emulation even for x86_64 2017-03-15 02:28:00 +00:00
xray_interface.cc [XRay][compiler-rt] Use sanitizer_common's atomic ops 2017-03-27 07:13:35 +00:00
xray_interface_internal.h [XRay] [compiler-rt] Allow logging the first argument of a function call. 2017-03-06 07:25:41 +00:00
xray_log_interface.cc [XRay][compiler-rt] Add an end-to-end test for FDR Logging 2017-03-29 05:19:24 +00:00
xray_mips.cc [XRay] [compiler-rt] Stub out architectures we don't do arg1 logging on. 2017-03-06 08:26:21 +00:00
xray_mips64.cc [XRay] [compiler-rt] Stub out architectures we don't do arg1 logging on. 2017-03-06 08:26:21 +00:00
xray_powerpc64.cc [XRay] [compiler-rt] Stub out architectures we don't do arg1 logging on. 2017-03-06 08:26:21 +00:00
xray_powerpc64.inc Re-commit r295017, since we have a potential fix of the tests, r295248, landed. 2017-02-15 22:40:29 +00:00
xray_trampoline_AArch64.S Add NO_EXEC_STACK_DIRECTIVE to xray assembly files. 2017-03-15 21:18:47 +00:00
xray_trampoline_arm.S Add NO_EXEC_STACK_DIRECTIVE to xray assembly files. 2017-03-15 21:18:47 +00:00
xray_trampoline_mips.S [Compiler-rt][XRAY][MIPS] Support xray on mips/mipsel/mips64/mips64el 2017-02-15 10:54:09 +00:00
xray_trampoline_mips64.S [Compiler-rt][XRAY][MIPS] Support xray on mips/mipsel/mips64/mips64el 2017-02-15 10:54:09 +00:00
xray_trampoline_powerpc64.cc Re-commit r295017, since we have a potential fix of the tests, r295248, landed. 2017-02-15 22:40:29 +00:00
xray_trampoline_powerpc64_asm.S [XRay] Change the ppc trampoline asm file into a different name, to not collide with the cc file. NFC. 2017-02-22 00:19:43 +00:00
xray_trampoline_x86_64.S Add NO_EXEC_STACK_DIRECTIVE to xray assembly files. 2017-03-15 21:18:47 +00:00
xray_tsc.h [XRay][compiler-rt] Support TSC emulation even for x86_64 2017-03-15 02:28:00 +00:00
xray_utils.cc [XRay][compiler-rt] Add an end-to-end test for FDR Logging 2017-03-29 05:19:24 +00:00
xray_utils.h [XRay] Refactor TSC related functions into a single header. NFC. 2017-02-10 20:30:43 +00:00
xray_x86_64.cc [XRay] [compiler-rt] Plug a file descriptor leak in a failure case. 2017-03-24 05:02:51 +00:00
xray_x86_64.inc [XRay] Refactor TSC related functions into a single header. NFC. 2017-02-10 20:30:43 +00:00