llvm-project/compiler-rt
Dean Michael Berris c6ee33852b [XRay] [compiler-rt] Refactor logic for xray fdr logging. NFC.
Summary:
Separated the IO and the thread local storage state machine of logging
from the writing of log records once the contents are deterministic.

Finer granularity functions are provided as inline functions in the same
header such that stack does not grow due to the functions being separated.

An executable utility xray_fdr_log_printer is also implemented to use the
finest granularity functions to produce binary test data in the FDR format
with a relatively convenient text input.

For example, one can take a file with textual contents layed out in rows
and feed it to the binary to generate data that llvm-xray convert can then
read. This is a convenient way to build a test suite for llvm-xray convert
to ensure it's robust to the fdr format.

Example:

$cat myFile.txt
NewBuffer : { time = 2 , Tid=5}
NewCPU : { CPU =1 , TSC = 123}
Function : { FuncId = 5, TSCDelta = 3, EntryType = Entry }
Function : { FuncId = 5, TSCDelta = 5, EntryType = Exit}
TSCWrap : { TSC = 678 }
Function : { FuncId = 6, TSCDelta = 0, EntryType = Entry }
Function : { FuncId = 6, TSCDelta = 50, EntryType = Exit }
EOB : { }
$cat myFile.txt | ./bin/xray_fdr_log_printer > /tmp/binarydata.bin
$./bin/llvm-xray convert -output-format=yaml -output=- /tmp/binarydata.bin

yaml format comes out as expected.

Reviewers: dberris, pelikan

Reviewed By: dberris

Subscribers: llvm-commits, mgorny

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

llvm-svn: 297801
2017-03-15 03:12:01 +00:00
..
cmake Enable PROFILE, TSAN and UBSAN for Android 2017-02-18 01:12:55 +00:00
docs [sanitizers] Make it possible to XFAIL on the effective target, not just the default. 2016-08-09 11:50:53 +00:00
include [XRay] [compiler-rt] Allow logging the first argument of a function call. 2017-03-06 07:25:41 +00:00
lib [XRay] [compiler-rt] Refactor logic for xray fdr logging. NFC. 2017-03-15 03:12:01 +00:00
test [msan] Intercept wcsncpy, wcsnlen. 2017-03-14 23:48:37 +00:00
unittests [lit] Limit parallelism of sanitizer tests on Darwin [compiler-rt part, take 2] 2017-01-20 00:25:01 +00:00
www Update references to new lists.llvm.org mailing lists. 2015-08-05 03:58:00 +00:00
.arcconfig Upgrade all the .arcconfigs to https. 2016-07-14 13:15:37 +00:00
.gitignore
CMakeLists.txt [sanitizer] Re-enable -fno-function-sections for powerpc64le 2017-01-30 22:31:49 +00:00
CODE_OWNERS.TXT [sanitizers] remove earthdok@ from owners 2016-05-18 18:52:18 +00:00
CREDITS.TXT
LICENSE.TXT Update copyright year to 2016. 2016-03-30 22:38:50 +00:00
README.txt

README.txt

Compiler-RT
================================

This directory and its subdirectories contain source code for the compiler
support routines.

Compiler-RT is open source software. You may freely distribute it under the
terms of the license agreement found in LICENSE.txt.

================================