summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib/xray/xray_init.cc
diff options
context:
space:
mode:
authorDean Michael Berris <dberris@google.com>2017-05-04 04:59:20 +0000
committerDean Michael Berris <dberris@google.com>2017-05-04 04:59:20 +0000
commit5cc4632b5bb5c63b7da8558de7d00fcc84f2f864 (patch)
treefc9f9c01d98c4a6b3f8c95b3ac444dbed4c3d779 /compiler-rt/lib/xray/xray_init.cc
parentebdccd0c2d92507a6c7dadaf9830a0eae840289b (diff)
downloadbcm5719-llvm-5cc4632b5bb5c63b7da8558de7d00fcc84f2f864.tar.gz
bcm5719-llvm-5cc4632b5bb5c63b7da8558de7d00fcc84f2f864.zip
[XRay][compiler-rt] Support patching/unpatching specific functions
Summary: This change allows us to patch/unpatch specific functions using the function ID. This is useful in cases where implementations might want to do coverage-style, or more fine-grained control of which functions to patch or un-patch at runtime. Depends on D32693. Reviewers: dblaikie, echristo, kpw Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D32695 llvm-svn: 302112
Diffstat (limited to 'compiler-rt/lib/xray/xray_init.cc')
-rw-r--r--compiler-rt/lib/xray/xray_init.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/compiler-rt/lib/xray/xray_init.cc b/compiler-rt/lib/xray/xray_init.cc
index 6f558d65614..aa660baa992 100644
--- a/compiler-rt/lib/xray/xray_init.cc
+++ b/compiler-rt/lib/xray/xray_init.cc
@@ -25,6 +25,8 @@ extern "C" {
void __xray_init();
extern const XRaySledEntry __start_xray_instr_map[] __attribute__((weak));
extern const XRaySledEntry __stop_xray_instr_map[] __attribute__((weak));
+extern const XRayFunctionSledIndex __start_xray_fn_idx[] __attribute__((weak));
+extern const XRayFunctionSledIndex __stop_xray_fn_idx[] __attribute__((weak));
}
using namespace __xray;
@@ -55,6 +57,8 @@ void __xray_init() XRAY_NEVER_INSTRUMENT {
__sanitizer::SpinMutexLock Guard(&XRayInstrMapMutex);
XRayInstrMap.Sleds = __start_xray_instr_map;
XRayInstrMap.Entries = __stop_xray_instr_map - __start_xray_instr_map;
+ XRayInstrMap.SledsIndex = __start_xray_fn_idx;
+ XRayInstrMap.Functions = __stop_xray_fn_idx - __start_xray_fn_idx;
}
__sanitizer::atomic_store(&XRayInitialized, true,
__sanitizer::memory_order_release);
OpenPOWER on IntegriCloud