[PATCH] D28623: [XRay][Arm] Enable back XRay testing on Arm32 and fix the failing tests
Serge Rogatch via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Jan 16 09:44:55 PST 2017
rSerge retitled this revision from "[XRay][Arm] Enable back XRay testing on Arm32" to "[XRay][Arm] Enable back XRay testing on Arm32 and fix the failing tests".
rSerge updated the summary for this revision.
rSerge updated this revision to Diff 84574.
rSerge added a comment.
PTAL.
https://reviews.llvm.org/D28623
Files:
lib/xray/xray_arm.cc
test/xray/lit.cfg
Index: test/xray/lit.cfg
===================================================================
--- test/xray/lit.cfg
+++ test/xray/lit.cfg
@@ -30,7 +30,9 @@
# Default test suffixes.
config.suffixes = ['.c', '.cc', '.cpp']
-if config.host_os not in ['Linux'] or config.host_arch.find('64') == -1:
+if config.host_os not in ['Linux']:
+ config.unsupported = True
+elif config.host_arch.find('64') == -1 and config.host_arch.find('arm') == -1:
config.unsupported = True
# Allow tests to use REQUIRES=stable-runtime. For use when you cannot use XFAIL
Index: lib/xray/xray_arm.cc
===================================================================
--- lib/xray/xray_arm.cc
+++ lib/xray/xray_arm.cc
@@ -19,6 +19,8 @@
#include <atomic>
#include <cassert>
+extern "C" void __clear_cache(void* start, void* end);
+
namespace __xray {
uint64_t cycleFrequency() XRAY_NEVER_INSTRUMENT {
@@ -116,23 +118,26 @@
// B #20
uint32_t *FirstAddress = reinterpret_cast<uint32_t *>(Sled.Address);
+ uint32_t *CurAddress = FirstAddress + 1;
if (Enable) {
- uint32_t *CurAddress = FirstAddress + 1;
CurAddress =
Write32bitLoadR0(CurAddress, reinterpret_cast<uint32_t>(FuncId));
CurAddress =
Write32bitLoadIP(CurAddress, reinterpret_cast<uint32_t>(TracingHook));
*CurAddress = uint32_t(PatchOpcodes::PO_BlxIp);
CurAddress++;
*CurAddress = uint32_t(PatchOpcodes::PO_PopR0Lr);
+ CurAddress++;
std::atomic_store_explicit(
reinterpret_cast<std::atomic<uint32_t> *>(FirstAddress),
uint32_t(PatchOpcodes::PO_PushR0Lr), std::memory_order_release);
} else {
std::atomic_store_explicit(
reinterpret_cast<std::atomic<uint32_t> *>(FirstAddress),
uint32_t(PatchOpcodes::PO_B20), std::memory_order_release);
}
+ __clear_cache(reinterpret_cast<char*>(FirstAddress),
+ reinterpret_cast<char*>(CurAddress));
return true;
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D28623.84574.patch
Type: text/x-patch
Size: 1972 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170116/c41b6553/attachment-0001.bin>
More information about the llvm-commits
mailing list