From da9e5d9ff3092f17c7d32cda2a1dc60c3a87d20c Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Thu, 30 Nov 2023 21:08:34 +0900 Subject: [PATCH] [build] Make scoped zones a little easier to use And report checking for tracy. --- config.d/tracy.m4 | 4 ++++ include/qftracy.h | 7 +++++-- nq/source/host.c | 2 +- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/config.d/tracy.m4 b/config.d/tracy.m4 index 06a442ecd..503079bfe 100644 --- a/config.d/tracy.m4 +++ b/config.d/tracy.m4 @@ -6,10 +6,14 @@ AC_ARG_ENABLE(tracy, ) HAVE_TRACY=no if test "x$enable_tracy" = "xyes"; then + AC_MSG_CHECKING([for tracy/public]) tracy_dir=${srcdir}/tracy/public if test -d ${tracy_dir}; then TRACY_CFLAGS="-I ${tracy_dir} -DHAVE_TRACY" HAVE_TRACY=yes + AC_MSG_RESULT(yes) + else + AC_MSG_RESULT(no) fi fi AC_SUBST(TRACY_CFLAGS) diff --git a/include/qftracy.h b/include/qftracy.h index 3ea8b9b6b..80626838d 100644 --- a/include/qftracy.h +++ b/include/qftracy.h @@ -9,7 +9,7 @@ #define TRACY_ENABLE #include "tracy/TracyC.h" -inline void __qfZoneEnd (TracyCZoneCtx **ctxptr) +static inline void __qfZoneEnd (TracyCZoneCtx **ctxptr) { TracyCZoneEnd (**ctxptr); } @@ -21,7 +21,9 @@ inline void __qfZoneEnd (TracyCZoneCtx **ctxptr) #define qfZoneNamed(varname, active) \ TracyCZone (varname, active) \ __attribute__((cleanup(__qfZoneEnd))) \ - TracyCZoneCtx *qfConcat(__qfZone, __COUNTER__) = &varname + TracyCZoneCtx *qfConcat(__qfScoped##varname, __COUNTER__) = &varname +#define qfZoneScoped(active) \ + qfZoneNamed (__qfZone, active) #define qfZoneEnd(varname) TracyCZoneEnd (varname) @@ -40,6 +42,7 @@ inline void __qfZoneEnd (TracyCZoneCtx **ctxptr) #define qfFrameMark #define qfZoneNamed(varname, active) +#define qfZoneScoped(active) #define qfZoneEnd(varname) #define qfZoneName(ctx, name, size) #define qfZoneColor(ctx, color) diff --git a/nq/source/host.c b/nq/source/host.c index d6715abda..f6308408c 100644 --- a/nq/source/host.c +++ b/nq/source/host.c @@ -678,7 +678,7 @@ Host_FilterTime (float time) static void _Host_Frame (float time) { - qfZoneNamedN (hfzone, "_Host_Frame", true); + qfZoneScoped (true); static int first = 1; float sleeptime;