diff options
| author | Stefan Boberg <[email protected]> | 2026-04-23 12:39:51 +0200 |
|---|---|---|
| committer | GitHub Enterprise <[email protected]> | 2026-04-23 12:39:51 +0200 |
| commit | acbe46d5f37af01efc3e46398e8af60e4461e68f (patch) | |
| tree | 24f4fcdf1383fc5969487c575fc07d1650f9d64f | |
| parent | 5.8.7 (diff) | |
| download | archived-zen-acbe46d5f37af01efc3e46398e8af60e4461e68f.tar.xz archived-zen-acbe46d5f37af01efc3e46398e8af60e4461e68f.zip | |
trace: declare Region event name fields as AnsiString (#1012)
RegionName and Category on Misc.RegionBeginWithId were declared as
uint8[] — a byte array with no Field_String class flag. UE Insights'
FEventData::GetString() explicitly requires Field_String and returns
false otherwise, so Insights analyzers that check(GetString(...)) fire
when reading zen traces.
Upstream UE declares these fields as WideString; zen's source strings
are std::string_view, so AnsiString is the natural fit and the wire
bytes are unchanged (same Field_8 aux stream — only the schema class
bit differs). Insights' FString GetString variant accepts either ANSI
or WIDE, so analyzers work without change.
Zen's own tourist-based analyzer in src/zen/trace/trace_model.cpp
reads raw aux bytes via Array<uint8[]> regardless of the schema tag,
and its DecodeRegionName already handles both 1-byte and 2-byte
widths, so it's unaffected.
| -rw-r--r-- | src/zencore/trace.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/zencore/trace.cpp b/src/zencore/trace.cpp index 2dec0511c..d6a0b2e92 100644 --- a/src/zencore/trace.cpp +++ b/src/zencore/trace.cpp @@ -30,8 +30,8 @@ namespace { TRACE_EVENT_BEGIN(Misc, RegionBeginWithId, NoSync) TRACE_EVENT_FIELD(uint64, CycleAndId) -TRACE_EVENT_FIELD(uint8[], RegionName) -TRACE_EVENT_FIELD(uint8[], Category) +TRACE_EVENT_FIELD(UE::Trace::AnsiString, RegionName) +TRACE_EVENT_FIELD(UE::Trace::AnsiString, Category) TRACE_EVENT_END() TRACE_EVENT_BEGIN(Misc, RegionEndWithId, NoSync) @@ -191,10 +191,8 @@ TraceBeginRegion(std::string_view RegionName, std::string_view Category) { uint64_t RegionId = GetHifreqTimerValue(); TRACE_LOG(Misc, RegionBeginWithId, true) << RegionBeginWithId.CycleAndId(RegionId) - << RegionBeginWithId.RegionName(reinterpret_cast<const uint8*>(RegionName.data()), - int32_t(RegionName.size())) - << RegionBeginWithId.Category(reinterpret_cast<const uint8*>(Category.data()), - int32_t(Category.size())); + << RegionBeginWithId.RegionName(RegionName.data(), int32_t(RegionName.size())) + << RegionBeginWithId.Category(Category.data(), int32_t(Category.size())); return RegionId; } |