Files
clang-p2996/compiler-rt/test/xray/TestCases/Linux/fixedsize-logging.cc
Dean Michael Berris 427215ce5e [XRay][compiler-rt] Switch default XRay 'patch_premain' to false
Summary:
Currently, we assume that applications built with XRay would like to
have the instrumentation sleds patched before main starts. This patch
changes the default so that we do not patch the instrumentation sleds
before main. This default is more helpful for deploying applications in
environments where changing the current default is harder (i.e. on
remote machines, or work-pool-like systems).

This default (not to patch pre-main) makes it easier to selectively run
applications with XRay instrumentation enabled, than with the current
state.

Reviewers: echristo, timshen

Subscribers: mehdi_amini, llvm-commits

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

llvm-svn: 296445
2017-02-28 08:10:01 +00:00

21 lines
569 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="patch_premain=true xray_naive_log=true 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!
}