Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Relax SourceLocationOverflowFailure limit? #928

Open
jacereda opened this issue Nov 19, 2024 · 4 comments
Open

Relax SourceLocationOverflowFailure limit? #928

jacereda opened this issue Nov 19, 2024 · 4 comments

Comments

@jacereda
Copy link

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.

@wolfpld
Copy link
Owner

wolfpld commented Nov 19, 2024

No, the other side of the range is also used.

@jacereda
Copy link
Author

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?

@wolfpld
Copy link
Owner

wolfpld commented Nov 20, 2024

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 );

@jacereda
Copy link
Author

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants