Relax SourceLocationOverflowFailure limit?
Hi,
We're reaching the source locations limit. Could this be relaxed somehow using uint16_t instead of int16_t for the maps? 64k would be enough for our use case.
No, the other side of the range is also used.
I see... Looks like a big change, but given that ZoneEvent wastes space due to alignment, could it be changed to use something like this that would take the same space?
uint64_t _start;
int32_t _srcloc;
uint32_t _child2;
uint64_t _end_child1;
uint32_t extra;
BTW, looks like SetChild sets the uint16_t _child2 via memcpy( &_child2, &child, 4 ), is that intentional?
Most of Tracy data structures do not follow the alignment requirements to not waste memory (which should also explain how the memcpy works).
Increasing the amount of source locations would explode the memory requirements in other places, for example this per-captured-thread allocation has to account for all source locations:
td->stackCount = (uint8_t*)m_slab.AllocBig( sizeof( uint8_t ) * 64*1024 );
Understood. I wouldn't mind those per-thread allocations if that meant we could have more zones, but we'll try to reduce the amount of zones.
However, I'm not sure I understood why uint16_t _child2 is copied with a size of 4.
Also, the ZoneEvent struct isn't marked as packed so it should surely be adding some padding around _child2? Or is it setting some compile flag to always pack structs?
I am also running into this issue, while profiling a game engine that runs an interpreted language. 32k source locations is surprisingly low.
If it can't be increased, could we instead fail silently instead of crashing out? Partial source information is better than no information for my usecase.