[compiler-rt] r296445 - [XRay][compiler-rt] Switch default XRay 'patch_premain' to false

Dean Michael Berris via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 28 00:10:02 PST 2017


Author: dberris
Date: Tue Feb 28 02:10:01 2017
New Revision: 296445

URL: http://llvm.org/viewvc/llvm-project?rev=296445&view=rev
Log:
[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

Modified:
    compiler-rt/trunk/lib/xray/xray_flags.inc
    compiler-rt/trunk/test/xray/TestCases/Linux/argv0-log-file-name.cc
    compiler-rt/trunk/test/xray/TestCases/Linux/fixedsize-logging.cc
    compiler-rt/trunk/test/xray/TestCases/Linux/optional-inmemory-log.cc
    compiler-rt/trunk/test/xray/TestCases/Linux/pic_test.cc

Modified: compiler-rt/trunk/lib/xray/xray_flags.inc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/xray/xray_flags.inc?rev=296445&r1=296444&r2=296445&view=diff
==============================================================================
--- compiler-rt/trunk/lib/xray/xray_flags.inc (original)
+++ compiler-rt/trunk/lib/xray/xray_flags.inc Tue Feb 28 02:10:01 2017
@@ -14,7 +14,7 @@
 #error "Define XRAY_FLAG prior to including this file!"
 #endif
 
-XRAY_FLAG(bool, patch_premain, true,
+XRAY_FLAG(bool, patch_premain, false,
           "Whether to patch instrumentation points before main.")
 XRAY_FLAG(bool, xray_naive_log, true,
           "Whether to install the naive log implementation.")

Modified: compiler-rt/trunk/test/xray/TestCases/Linux/argv0-log-file-name.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/xray/TestCases/Linux/argv0-log-file-name.cc?rev=296445&r1=296444&r2=296445&view=diff
==============================================================================
--- compiler-rt/trunk/test/xray/TestCases/Linux/argv0-log-file-name.cc (original)
+++ compiler-rt/trunk/test/xray/TestCases/Linux/argv0-log-file-name.cc Tue Feb 28 02:10:01 2017
@@ -2,7 +2,7 @@
 // name.
 
 // RUN: %clangxx_xray -std=c++11 %s -o %t
-// RUN: %run %t > xray.log.file.name 2>&1
+// RUN: XRAY_OPTIONS="patch_premain=true xray_naive_log=true" %run %t > xray.log.file.name 2>&1
 // RUN: ls | FileCheck xray.log.file.name
 // RUN: rm xray-log.* xray.log.file.name
 

Modified: compiler-rt/trunk/test/xray/TestCases/Linux/fixedsize-logging.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/xray/TestCases/Linux/fixedsize-logging.cc?rev=296445&r1=296444&r2=296445&view=diff
==============================================================================
--- compiler-rt/trunk/test/xray/TestCases/Linux/fixedsize-logging.cc (original)
+++ compiler-rt/trunk/test/xray/TestCases/Linux/fixedsize-logging.cc Tue Feb 28 02:10:01 2017
@@ -1,7 +1,7 @@
 // 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
+// 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.
 //

Modified: compiler-rt/trunk/test/xray/TestCases/Linux/optional-inmemory-log.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/xray/TestCases/Linux/optional-inmemory-log.cc?rev=296445&r1=296444&r2=296445&view=diff
==============================================================================
--- compiler-rt/trunk/test/xray/TestCases/Linux/optional-inmemory-log.cc (original)
+++ compiler-rt/trunk/test/xray/TestCases/Linux/optional-inmemory-log.cc Tue Feb 28 02:10:01 2017
@@ -2,7 +2,7 @@
 // we turn it off via options.
 
 // RUN: %clangxx_xray -std=c++11 %s -o %t
-// RUN: XRAY_OPTIONS="verbosity=1 xray_naive_log=false xray_logfile_base=optional-inmemory-log.xray-" %run %t 2>&1 | FileCheck %s
+// 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.
 //

Modified: compiler-rt/trunk/test/xray/TestCases/Linux/pic_test.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/xray/TestCases/Linux/pic_test.cc?rev=296445&r1=296444&r2=296445&view=diff
==============================================================================
--- compiler-rt/trunk/test/xray/TestCases/Linux/pic_test.cc (original)
+++ compiler-rt/trunk/test/xray/TestCases/Linux/pic_test.cc Tue Feb 28 02:10:01 2017
@@ -1,7 +1,7 @@
 // Test to check if we handle pic code properly.
 
 // RUN: %clangxx_xray -fxray-instrument -std=c++11 -fpic %s -o %t
-// RUN: XRAY_OPTIONS="verbosity=1 xray_logfile_base=pic-test-logging-" %run %t 2>&1 | FileCheck %s
+// RUN: XRAY_OPTIONS="patch_premain=true verbosity=1 xray_logfile_base=pic-test-logging-" %run %t 2>&1 | FileCheck %s
 // After all that, clean up the output xray log.
 //
 // RUN: rm pic-test-logging-*




More information about the llvm-commits mailing list