summaryrefslogtreecommitdiffstats
path: root/llvm/lib/MC/MCMachOStreamer.cpp
diff options
context:
space:
mode:
authorDean Michael Berris <dberris@google.com>2017-12-14 02:51:20 +0000
committerDean Michael Berris <dberris@google.com>2017-12-14 02:51:20 +0000
commit504b0c28f30dee3fc403643cb874f0a451f2b586 (patch)
tree4ca5bdaf570b2110871fcd3fbbadf4d0bc46e5aa /llvm/lib/MC/MCMachOStreamer.cpp
parent6c18f027ff9d7b23bf138aed43d48d27b8810852 (diff)
downloadbcm5719-llvm-504b0c28f30dee3fc403643cb874f0a451f2b586.tar.gz
bcm5719-llvm-504b0c28f30dee3fc403643cb874f0a451f2b586.zip
[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
Diffstat (limited to 'llvm/lib/MC/MCMachOStreamer.cpp')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud