wolfpld / tracy

Frame profiler
https://tracy.nereid.pl/
Other
8.61k stars 592 forks source link

Profiler: Custom namespace delimiter for zone name shortening #777

Open nixxquality opened 2 months ago

nixxquality commented 2 months ago

Relevant function: https://github.com/wolfpld/tracy/blob/d1300c491ca50962b5ba4d5b7d5a56b34b9e99ad/profiler/src/profiler/TracyUtility.cpp#L19

The shortening feature is very useful, but I was wondering if it could be extended to handle other namespace delimiters, either on a per-trace basis or as a profiler setting.

This would mostly be useful for instances where Tracy is integrated with other languages, like Lua where the delimiter is ..

wolfpld commented 1 month ago

Do you have a trace that would show where this is a problem?

nixxquality commented 1 month ago

Absolutely, here is a very simple trace: love2d_overusing_newImage.zip It's from a proof of concept of adding Tracy instrumentation to the LÖVE engine. That engine mostly runs in Lua so it would make sense to show functions with their Lua names where they are "namespaced" into tables rather than the C++ namespaces. In this case, it might make sense to add some code during engine startup to tell the Tracy server that for this trace, please consider . a namespace separator. As I said, this is just a proof of concept, and there's really no rush. The actual developers of the engine haven't gotten back to me about how they feel about this integration. I mostly wanted to know your thoughts on it.