summaryrefslogtreecommitdiff
path: root/lib/xray/xray_arm.cc
diff options
context:
space:
mode:
authorDean Michael Berris <dberris@google.com>2016-10-13 23:56:54 +0000
committerDean Michael Berris <dberris@google.com>2016-10-13 23:56:54 +0000
commitd9e6c738682c2012e5e7e87909941becd55cfbbd (patch)
tree57003a05a0b05d90c626341da1936bc6505698c4 /lib/xray/xray_arm.cc
parentfc1639bfbc51826037ac6647c7faf280790c6bf9 (diff)
[compiler-rt][XRay] Support tail call sleds
Summary: This change depends on D23986 which adds tail call-specific sleds. For now we treat them first as normal exits, and in the future leave room for implementing this as a different kind of log entry. The reason for deferring the change is so that we can keep the naive logging implementation more accurate without additional complexity for reading the log. The accuracy is gained in effectively interpreting call stacks like: A() B() C() Which when tail-call merged will end up not having any exit entries for A() nor B(), but effectively in turn can be reasoned about as: A() B() C() Although we lose the fact that A() had called B() then had called C() with the naive approach, a later iteration that adds the explicit tail call entries would be a change in the log format and thus necessitate a version change for the header. We can do this later to have a chance at releasing some tools (in D21987) that are able to handle the naive log format, then support higher version numbers of the log format too. Reviewers: echristo, kcc, rSerge, majnemer Subscribers: mehdi_amini, llvm-commits, dberris Differential Revision: https://reviews.llvm.org/D23988 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@284178 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/xray/xray_arm.cc')
-rw-r--r--lib/xray/xray_arm.cc7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/xray/xray_arm.cc b/lib/xray/xray_arm.cc
index d1b953e2e..4c1980364 100644
--- a/lib/xray/xray_arm.cc
+++ b/lib/xray/xray_arm.cc
@@ -127,4 +127,11 @@ bool patchFunctionExit(const bool Enable, const uint32_t FuncId,
return patchSled(Enable, FuncId, Sled, __xray_FunctionExit);
}
+bool patchFunctionTailExit(const bool Enable, const uint32_t FuncId,
+ const XRaySledEntry &Sled) {
+ // FIXME: In the future we'd need to distinguish between non-tail exits and
+ // tail exits for better information preservation.
+ return patchSled(Enable, FuncId, Sled, __xray_FunctionExit);
+}
+
} // namespace __xray