utils: add additional guards for Tracing (#8810)

The addition JobSystem.cpp allows for defining
FILAMENT_TRACING_ENABLED across targets.

Addingin FILAMENT_TRACING_ENABLED to the #if in Tracing.h prevents
perfetto from being included.
This commit is contained in:
Powei Feng
2025-06-03 11:18:11 -07:00
committed by GitHub
parent 1b46ddd8b6
commit 56dc348cc8
2 changed files with 7 additions and 2 deletions

View File

@@ -30,9 +30,9 @@
# define FILAMENT_APPLE_SYSTRACE 0
#endif
#if defined(__ANDROID__)
#if defined(__ANDROID__) && FILAMENT_TRACING_ENABLED
# include <private/utils/android/Tracing.h>
#elif defined(__APPLE__) && FILAMENT_APPLE_SYSTRACE
#elif defined(__APPLE__) && FILAMENT_APPLE_SYSTRACE && FILAMENT_TRACING_ENABLED
# include <private/utils/darwin/Tracing.h>
#else

View File

@@ -14,8 +14,13 @@
* limitations under the License.
*/
// TODO: Clean-up. We shouldn't need this #ifndef here, but a client has requested that perfetto be
// disabled due to size increase. In their case, this flag would be defined across targets. Hence
// we guard below with an #ifndef.
#ifndef FILAMENT_TRACING_ENABLED
// Note: The overhead of TRACING is not negligible especially with parallel_for().
#define FILAMENT_TRACING_ENABLED false
#endif
// when FILAMENT_TRACING_ENABLED is true, enables even heavier tracing
#define HEAVY_TRACING 0