tracy icon indicating copy to clipboard operation
tracy copied to clipboard

Tracy on by default

Open Christian-Prather opened this issue 2 years ago • 3 comments

Description:

While the documentation states that tracy is to be off by default unless the TRACY_ENABLE option is present this appears to not be the case as the CMakeLists.txt sets this value with a default ON.

It also seems that the docs are not correct when describing the value being irreverent as setting OFF does in fact disable tracy profiling.

Testing:

This was tested by compiling with TRACY_ENABLE=OFF and TRACY_ENABLE=ON as set with -D flag for cmake.

Purposed Solution:

If this is a known situation I am happy to update docs and/or defaulting tracy to be off so behavior matches

Christian-Prather avatar Oct 24 '23 17:10 Christian-Prather

The documentation is correct in that it describes the behavior of the flags that are passed to the compiler. If you feel this is something that needs clarification in the context of CMake, please file a PR.

wolfpld avatar Oct 24 '23 17:10 wolfpld

Okay thanks I will. Just to be clear though before I do, this documentation added below reads as if Tracy will not be active unless the user includes TRACY_ENABLE to their CMake which does not seem to be true as the Tracy CMakeLists sets the default.

In the default configuration, Tracy is disabled. This way, you don’t have to worry that the production builds will collect profiling data. To enable profiling, you will probably want to create a separate build configuration, with the TRACY_ENABLE define.

In addition from what I tested above this documentation seems to not hold true as setting to OFF did in fact disable Tracy profiling.

Tracy does not consider the value of the definition, only the fact if the macro is defined or not (unless specified otherwise). Be careful not to make the mistake of assigning numeric values to Tracy defines, which could lead you to be puzzled why constructs such as TRACY_ENABLE=0

Unless I missed something else up in my testing in which case I will reconfirm.

As always thank you!

Christian-Prather avatar Oct 24 '23 20:10 Christian-Prather

The quoted paragraphs are not about CMake.

wolfpld avatar Oct 24 '23 21:10 wolfpld