diff options
author | Dean Michael Berris <dberris@google.com> | 2018-07-11 07:14:27 +0000 |
---|---|---|
committer | Dean Michael Berris <dberris@google.com> | 2018-07-11 07:14:27 +0000 |
commit | 2b21d99e40a4c999ddb13c858b66800ec17cf24f (patch) | |
tree | 9e1f65d76ee3f27f99b94f1fe90ce076be975dc0 /include/xray | |
parent | a23f2b1f37752905e78ef7a8480da2d1b45b64dc (diff) |
[XRay] basic mode PID and TID always fetch
Summary: XRayRecords now includes a PID field. Basic handlers fetch pid and tid each time they are called instead of caching the value. Added a testcase that calls fork and checks if the child TID is different from the parent TID to verify that the processes' TID are different in the trace.
Reviewers: dberris, Maknee
Reviewed By: dberris, Maknee
Subscribers: kpw, llvm-commits, #sanitizers
Differential Revision: https://reviews.llvm.org/D49025
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@336769 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/xray')
-rw-r--r-- | include/xray/xray_records.h | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/include/xray/xray_records.h b/include/xray/xray_records.h index 2b415bbc9..8cfdeee8c 100644 --- a/include/xray/xray_records.h +++ b/include/xray/xray_records.h @@ -95,8 +95,11 @@ struct alignas(32) XRayRecord { // The thread ID for the currently running thread. uint32_t TId = 0; + // The ID of process that is currently running + uint32_t PId = 0; + // Use some bytes in the end of the record for buffers. - char Buffer[12] = {}; + char Buffer[8] = {}; } __attribute__((packed)); static_assert(sizeof(XRayRecord) == 32, "XRayRecord != 32 bytes"); @@ -115,8 +118,8 @@ struct alignas(32) XRayArgPayload { // The thread ID for the currently running thread. uint32_t TId = 0; - // Add more padding. - uint8_t Padding2[4] = {}; + // The ID of process that is currently running + uint32_t PId = 0; // The argument payload. uint64_t Arg = 0; |