From 7451d3ab8aa7be6405b6bbbe5e17dcb3ea29e766 Mon Sep 17 00:00:00 2001 From: Stefan Boberg Date: Tue, 19 Dec 2023 10:55:11 +0100 Subject: ensure we can build without trace (#619) `xmake config -zentrace=n` would previously not build cleanly --- src/zencore/include/zencore/trace.h | 1 + src/zencore/workthreadpool.cpp | 4 ++++ 2 files changed, 5 insertions(+) (limited to 'src/zencore') diff --git a/src/zencore/include/zencore/trace.h b/src/zencore/include/zencore/trace.h index 2d4c1e610..89e4b76bf 100644 --- a/src/zencore/include/zencore/trace.h +++ b/src/zencore/include/zencore/trace.h @@ -35,6 +35,7 @@ bool TraceStop(); #else #define ZEN_TRACE_CPU(x) +#define ZEN_TRACE_CPU_FLUSH(x) #endif // ZEN_WITH_TRACE diff --git a/src/zencore/workthreadpool.cpp b/src/zencore/workthreadpool.cpp index 6ff6463dd..16b2310ff 100644 --- a/src/zencore/workthreadpool.cpp +++ b/src/zencore/workthreadpool.cpp @@ -132,7 +132,9 @@ struct WorkerThreadPool::Impl Impl(int InThreadCount, std::string_view WorkerThreadBaseName) : m_WorkerThreadBaseName(WorkerThreadBaseName) { +# if ZEN_WITH_TRACE trace::ThreadGroupBegin(m_WorkerThreadBaseName.c_str()); +# endif zen::Latch WorkerLatch{InThreadCount}; @@ -143,7 +145,9 @@ struct WorkerThreadPool::Impl WorkerLatch.Wait(); +# if ZEN_WITH_TRACE trace::ThreadGroupEnd(); +# endif } ~Impl() -- cgit v1.2.3