Depends on D21612 which implements the building blocks for the compiler-rt implementation of the XRay runtime. We use a naive in-memory log of fixed-size entries that get written out to a log file when the buffers are full, and when the thread exits. This implementation lays some foundations on to allowing for more complex XRay records to be written to the log in subsequent changes. It also defines the format that the function call accounting tool in D21987 will start building upon. Once D21987 lands, we should be able to start defining more tests using that tool once the function call accounting tool becomes part of the llvm distribution. Reviewers: echristo, kcc, rnk, eugenis, majnemer, rSerge Subscribers: sdardis, rSerge, dberris, tberghammer, danalbert, srhines, majnemer, llvm-commits, mehdi_amini Differential Revision: https://reviews.llvm.org/D21982 llvm-svn: 279805
21 lines
530 B
C++
21 lines
530 B
C++
// Check to make sure that we have a log file with a fixed-size.
|
|
|
|
// RUN: %clangxx_xray -std=c++11 %s -o %t
|
|
// RUN: XRAY_OPTIONS="verbosity=1 xray_logfile_base=fixedsize-logging-" %run %t 2>&1 | FileCheck %s
|
|
//
|
|
// After all that, clean up the output xray log.
|
|
//
|
|
// RUN: rm fixedsize-logging-*
|
|
|
|
#include <cstdio>
|
|
|
|
[[clang::xray_always_instrument]] void foo() {
|
|
printf("foo() is always instrumented!");
|
|
}
|
|
|
|
int main() {
|
|
// CHECK: XRay: Log file in 'fixedsize-logging-{{.*}}'
|
|
foo();
|
|
// CHECK: foo() is always instrumented!
|
|
}
|