wolfpld / tracy

Frame profiler
https://tracy.nereid.pl/
Other
10.25k stars 692 forks source link

class/namespace not showing in zone name #910

Closed toodemhard closed 1 month ago

toodemhard commented 1 month ago

Zone scopes used to show up as "class::function" but now it only shows up as "function" since I haven't profiled in a while and upgraded to v0.11.1

I tried to setup a minimal program to reproduce the old behavior with v0.11.1 and v0.9 but still couldn't get it to work. I also disabled "zone name shortening" in the options but it didn't change anything. Is there something I'm missing to get the class/namespace to show up in the zone name again?

image image

wolfpld commented 1 month ago

The behavior difference you see is caused by how different compilers expand __FUNCTION__ macro.

toodemhard commented 1 month ago

Oh yeah __FUNCTION__ just expands to function name on Clang and MSVC for me, not sure if it was always like that. I sort of managed to get the old behavior by replacing __FUNCTION__ with __PRETTY_FUNCTION__ for Clang.

#define __FUNCTION__ __PRETTY_FUNCTION__

Thanks for the help.