summaryrefslogtreecommitdiff
path: root/lib/xray/xray_fdr_logging.cc
diff options
context:
space:
mode:
Diffstat (limited to 'lib/xray/xray_fdr_logging.cc')
-rw-r--r--lib/xray/xray_fdr_logging.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/xray/xray_fdr_logging.cc b/lib/xray/xray_fdr_logging.cc
index 6e67b7deb..dd88df194 100644
--- a/lib/xray/xray_fdr_logging.cc
+++ b/lib/xray/xray_fdr_logging.cc
@@ -20,6 +20,7 @@
#include <cassert>
#include <cstring>
#include <memory>
+#include <sys/syscall.h>
#include <sys/time.h>
#include <time.h>
#include <unistd.h>
@@ -200,8 +201,8 @@ void setupNewBuffer(const BufferQueue::Buffer &Buffer) XRAY_NEVER_INSTRUMENT {
auto &NewBuffer = *reinterpret_cast<MetadataRecord *>(&Records[0]);
NewBuffer.Type = RecordType::Metadata;
NewBuffer.RecordKind = MetadataRecord::RecordKinds::NewBuffer;
- pid_t Pid = getpid();
- std::memcpy(&NewBuffer.Data, &Pid, sizeof(pid_t));
+ pid_t Tid = syscall(SYS_gettid);
+ std::memcpy(&NewBuffer.Data, &Tid, sizeof(pid_t));
}
// Also write the WalltimeMarker record.