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
22 lines
661 B
C++
22 lines
661 B
C++
// Make sure that we don't get the inmemory logging implementation enabled when
|
|
// we turn it off via options.
|
|
|
|
// RUN: %clangxx_xray -std=c++11 %s -o %t
|
|
// RUN: XRAY_OPTIONS="patch_premain=true verbosity=1 xray_naive_log=false xray_logfile_base=optional-inmemory-log.xray-" %run %t 2>&1 | FileCheck %s
|
|
//
|
|
// Make sure we clean out the logs in case there was a bug.
|
|
//
|
|
// RUN: rm -f optional-inmemory-log.xray-*
|
|
|
|
#include <cstdio>
|
|
|
|
[[clang::xray_always_instrument]] void foo() {
|
|
printf("foo() is always instrumented!");
|
|
}
|
|
|
|
int main() {
|
|
// CHECK-NOT: XRay: Log file in 'optional-inmemory-log.xray-{{.*}}'
|
|
foo();
|
|
// CHECK: foo() is always instrumented!
|
|
}
|