aboutsummaryrefslogtreecommitdiff
path: root/src/zenserver/main.cpp
diff options
context:
space:
mode:
authorDan Engelbrecht <[email protected]>2025-08-22 18:16:09 +0200
committerGitHub Enterprise <[email protected]>2025-08-22 18:16:09 +0200
commitfb6426127354415505dbedacd63b3a16116dac2f (patch)
treebbc39a085433b1e837fb07ea4e4399ba932dbdca /src/zenserver/main.cpp
parentavoid new in static IoBuffer (#472) (diff)
downloadzen-fb6426127354415505dbedacd63b3a16116dac2f.tar.xz
zen-fb6426127354415505dbedacd63b3a16116dac2f.zip
clean up trace options parsing (#473)
* clean up trace command line options explicitly shut down worker pools * some additional startup trace scopes
Diffstat (limited to 'src/zenserver/main.cpp')
-rw-r--r--src/zenserver/main.cpp36
1 files changed, 12 insertions, 24 deletions
diff --git a/src/zenserver/main.cpp b/src/zenserver/main.cpp
index 6d9a478be..553562473 100644
--- a/src/zenserver/main.cpp
+++ b/src/zenserver/main.cpp
@@ -393,6 +393,18 @@ main(int argc, char* argv[])
try
{
ZenServerOptions ServerOptions;
+
+ {
+#if ZEN_WITH_TRACE
+ TraceInit("zenserver");
+ ServerOptions.HasTraceCommandlineOptions = GetTraceOptionsFromCommandline(ServerOptions.TraceOptions);
+ if (ServerOptions.HasTraceCommandlineOptions)
+ {
+ TraceConfigure(ServerOptions.TraceOptions);
+ }
+#endif // ZEN_WITH_TRACE
+ }
+
ParseCliOptions(argc, argv, ServerOptions);
if (ServerOptions.Detach)
@@ -435,30 +447,6 @@ main(int argc, char* argv[])
CopyTree(ServerOptions.BaseSnapshotDir, ServerOptions.DataDir, {.EnableClone = true});
}
-#if ZEN_WITH_TRACE
- if (ServerOptions.TraceHost.size())
- {
- TraceStart("zenserver", ServerOptions.TraceHost.c_str(), TraceType::Network);
- }
- else if (ServerOptions.TraceFile.size())
- {
- TraceStart("zenserver", ServerOptions.TraceFile.c_str(), TraceType::File);
- }
- else
- {
- TraceInit("zenserver");
- }
-#endif // ZEN_WITH_TRACE
-
-#if ZEN_WITH_MEMTRACK
- FMalloc* TraceMalloc = MemoryTrace_Create(GMalloc);
- if (TraceMalloc != GMalloc)
- {
- GMalloc = TraceMalloc;
- MemoryTrace_Initialize();
- }
-#endif
-
ZEN_MEMSCOPE(GetZenserverTag());
#if ZEN_PLATFORM_WINDOWS