X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;f=common%2Ftrace_writer.cpp;h=d69e93fc9650211ca8d6418d173b027a4fa3cc26;hb=8b58e2fc73717437867a3a944dd34c4e917af9e7;hp=1679989d6b11f3eed7da17ca61a6af5c3ceaea40;hpb=eb64451efcd8100d02ec89ff2ae6ea2c78c7645b;p=apitrace diff --git a/common/trace_writer.cpp b/common/trace_writer.cpp index 1679989..d69e93f 100644 --- a/common/trace_writer.cpp +++ b/common/trace_writer.cpp @@ -134,8 +134,9 @@ inline bool lookup(std::vector &map, size_t index) { } } -unsigned Writer::beginEnter(const FunctionSig *sig) { +unsigned Writer::beginEnter(const FunctionSig *sig, unsigned thread_id) { _writeByte(trace::EVENT_ENTER); + _writeUInt(thread_id); _writeUInt(sig->id); if (!lookup(functions, sig->id)) { _writeString(sig->name); @@ -189,6 +190,10 @@ void Writer::beginStruct(const StructSig *sig) { } } +void Writer::beginRepr(void) { + _writeByte(trace::TYPE_REPR); +} + void Writer::writeBool(bool value) { _writeByte(value ? trace::TYPE_TRUE : trace::TYPE_FALSE); } @@ -293,13 +298,13 @@ void Writer::writeNull(void) { _writeByte(trace::TYPE_NULL); } -void Writer::writeOpaque(const void *addr) { +void Writer::writePointer(unsigned long long addr) { if (!addr) { Writer::writeNull(); return; } _writeByte(trace::TYPE_OPAQUE); - _writeUInt((size_t)addr); + _writeUInt(addr); }