llvm-project/compiler-rt/test/xray/TestCases/Linux
Dean Michael Berris 504b0c28f3 [XRay][compiler-rt] Coalesce calls to mprotect to reduce patching overhead
Summary:
Before this change, XRay would conservatively patch sections of the code
one sled at a time. Upon testing/profiling, this turns out to take an
inordinate amount of time and cycles. For an instrumented clang binary,
the cycles spent both in the patching/unpatching routine constituted 4%
of the cycles -- this didn't count the time spent in the kernel while
performing the mprotect calls in quick succession.

With this change, we're coalescing the number of calls to mprotect from
being linear to the number of instrumentation points, to now being a
lower constant when patching all the sleds through `__xray_patch()` or
`__xray_unpatch()`. In the case of calling `__xray_patch_function()` or
`__xray_unpatch_function()` we're now doing an mprotect call once for
all the sleds for that function (reduction of at least 2x calls to
mprotect).

Reviewers: kpw, eizan

Subscribers: llvm-commits

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

llvm-svn: 320664
2017-12-14 02:51:20 +00:00
..
always-never-instrument.cc [XRay][compiler-rt][NFC] Move test case into correct directory. 2017-06-28 05:21:15 +00:00
arg1-arg0-logging.cc [XRay][compiler-rt][NFC] Add a test for both arg1 and arg0 handling in the same binary 2017-06-19 03:52:25 +00:00
arg1-logger.cc [XRay][compiler-rt] Migrate basic mode logging to the XRay framework 2017-11-21 07:29:21 +00:00
arg1-logging-implicit-this.cc Add test for logging the implicit "this" argument for C++ member functions. 2017-06-16 03:24:07 +00:00
argv0-log-file-name.cc [compiler-rt][xray][mips] Mark some tests as unsupported. 2017-09-06 10:17:29 +00:00
basic-filtering.cc [XRay][compiler-rt] Implement XRay Basic Mode Filtering 2017-12-05 12:21:14 +00:00
common-trampoline-alignment.cc [XRay][compiler-rt][x86_64] Align the stack before and after calling handlers 2017-11-15 03:35:42 +00:00
coverage-sample.cc [XRay][compiler-rt] Coalesce calls to mprotect to reduce patching overhead 2017-12-14 02:51:20 +00:00
custom-event-handler-alignment.cc [XRay][compiler-rt] Support sled versioning for custom event sleds 2017-08-23 04:42:37 +00:00
custom-event-logging.cc [XRay][compiler-rt] Support sled versioning for custom event sleds 2017-08-23 04:42:37 +00:00
fdr-mode.cc [XRay] [compiler-rt] FDR logging arg1 handler 2017-09-28 05:29:59 +00:00
fdr-single-thread.cc [XRay][compiler-rt][NFC] Clean up xray log files before running test 2017-10-25 05:19:20 +00:00
fdr-thread-order.cc [XRay][compiler-rt] Use a hand-written circular buffer in BufferQueue 2017-10-04 05:20:13 +00:00
fixedsize-logging.cc [compiler-rt][xray][mips] Mark some tests as unsupported. 2017-09-06 10:17:29 +00:00
func-id-utils.cc [compiler-rt][xray][mips] Mark some tests as unsupported. 2017-09-06 10:17:29 +00:00
logging-modes.cc [XRay][compiler-rt] Implement logging implementation registration 2017-12-05 12:08:56 +00:00
optional-inmemory-log.cc [compiler-rt][xray][mips] Mark some tests as unsupported. 2017-09-06 10:17:29 +00:00
patching-unpatching.cc [compiler-rt][xray][mips] Mark some tests as unsupported. 2017-09-06 10:17:29 +00:00
pic_test.cc [XRay][compiler-rt] Migrate basic mode logging to the XRay framework 2017-11-21 07:29:21 +00:00
quiet-start.cc [XRay][compiler-rt] Fix test to not be too strict with output order. 2017-07-31 06:58:09 +00:00