From 2b21d99e40a4c999ddb13c858b66800ec17cf24f Mon Sep 17 00:00:00 2001 From: Dean Michael Berris Date: Wed, 11 Jul 2018 07:14:27 +0000 Subject: [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 --- include/xray/xray_records.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'include/xray') 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; -- cgit v1.2.3