aboutsummaryrefslogtreecommitdiff
path: root/src/zenhttp
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/zenhttp
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/zenhttp')
-rw-r--r--src/zenhttp/auth/authmgr.cpp14
-rw-r--r--src/zenhttp/servers/httpasio.cpp2
-rw-r--r--src/zenhttp/servers/httpmulti.cpp3
-rw-r--r--src/zenhttp/servers/httpplugin.cpp2
-rw-r--r--src/zenhttp/servers/httpsys.cpp3
5 files changed, 24 insertions, 0 deletions
diff --git a/src/zenhttp/auth/authmgr.cpp b/src/zenhttp/auth/authmgr.cpp
index 8f7befc80..6c1a66a99 100644
--- a/src/zenhttp/auth/authmgr.cpp
+++ b/src/zenhttp/auth/authmgr.cpp
@@ -9,6 +9,7 @@
#include <zencore/crypto.h>
#include <zencore/filesystem.h>
#include <zencore/logging.h>
+#include <zencore/trace.h>
#include <zenhttp/auth/oidc.h>
#include <condition_variable>
@@ -29,6 +30,8 @@ namespace details {
const AesIV128Bit& IV,
std::optional<std::string>& Reason)
{
+ ZEN_TRACE_CPU("AuthMgr::ReadEncryptedFile");
+
FileContents Result = ReadFile(Path);
if (Result.ErrorCode)
@@ -62,6 +65,8 @@ namespace details {
const AesIV128Bit& IV,
std::optional<std::string>& Reason)
{
+ ZEN_TRACE_CPU("AuthMgr::WriteEncryptedFile");
+
if (FileData.GetSize() == 0)
{
return;
@@ -100,6 +105,8 @@ public:
virtual void AddOpenIdProvider(const AddOpenIdProviderParams& Params) final
{
+ ZEN_TRACE_CPU("AuthMgr::AddOpenIdProvider");
+
if (Params.Name.empty())
{
ZEN_WARN("add OpenID provider FAILED, reason 'invalid name'");
@@ -159,6 +166,8 @@ public:
virtual bool AddOpenIdToken(const AddOpenIdTokenParams& Params) final
{
+ ZEN_TRACE_CPU("AuthMgr::AddOpenIdToken");
+
if (Params.ProviderName.empty())
{
ZEN_WARN("trying add OpenID token with invalid provider name");
@@ -251,6 +260,8 @@ private:
OidcClient::RefreshTokenResult RefreshOpenIdToken(std::string_view ProviderName, std::string_view RefreshToken)
{
+ ZEN_TRACE_CPU("AuthMgr::RefreshOpenIdToken");
+
RefPtr<OidcClient> Client = GetOpenIdProvider(ProviderName).HttpClient;
if (!Client)
{
@@ -268,6 +279,7 @@ private:
void LoadState()
{
+ ZEN_TRACE_CPU("AuthMgrImpl::LoadState");
try
{
std::optional<std::string> Reason;
@@ -340,6 +352,8 @@ private:
void SaveState()
{
+ ZEN_TRACE_CPU("AuthMgr::SaveState");
+
try
{
CbObjectWriter AuthState;
diff --git a/src/zenhttp/servers/httpasio.cpp b/src/zenhttp/servers/httpasio.cpp
index c1b7294c9..5392140d1 100644
--- a/src/zenhttp/servers/httpasio.cpp
+++ b/src/zenhttp/servers/httpasio.cpp
@@ -1159,6 +1159,7 @@ HttpAsioServer::RegisterService(HttpService& Service)
int
HttpAsioServer::Initialize(int BasePort, std::filesystem::path DataDir)
{
+ ZEN_TRACE_CPU("HttpAsioServer::Initialize");
m_Impl->Initialize(DataDir);
m_BasePort = m_Impl->Start(gsl::narrow<uint16_t>(BasePort), m_ForceLoopback, m_ThreadCount);
@@ -1219,6 +1220,7 @@ HttpAsioServer::RequestExit()
Ref<HttpServer>
CreateHttpAsioServer(bool ForceLoopback, unsigned int ThreadCount)
{
+ ZEN_TRACE_CPU("CreateHttpAsioServer");
ZEN_MEMSCOPE(GetHttpasioTag());
return Ref<HttpServer>{new HttpAsioServer(ForceLoopback, ThreadCount)};
diff --git a/src/zenhttp/servers/httpmulti.cpp b/src/zenhttp/servers/httpmulti.cpp
index f4dc1e15b..b8b7931a9 100644
--- a/src/zenhttp/servers/httpmulti.cpp
+++ b/src/zenhttp/servers/httpmulti.cpp
@@ -3,6 +3,7 @@
#include "httpmulti.h"
#include <zencore/logging.h>
+#include <zencore/trace.h>
#if ZEN_PLATFORM_WINDOWS
# include <conio.h>
@@ -30,6 +31,8 @@ HttpMultiServer::RegisterService(HttpService& Service)
int
HttpMultiServer::Initialize(int BasePort, std::filesystem::path DataDir)
{
+ ZEN_TRACE_CPU("HttpMultiServer::Initialize");
+
ZEN_UNUSED(DataDir);
ZEN_ASSERT(!m_IsInitialized);
diff --git a/src/zenhttp/servers/httpplugin.cpp b/src/zenhttp/servers/httpplugin.cpp
index ec12b3755..155f3fa02 100644
--- a/src/zenhttp/servers/httpplugin.cpp
+++ b/src/zenhttp/servers/httpplugin.cpp
@@ -700,6 +700,8 @@ HttpPluginServerImpl::CreateConnectionHandler(TransportConnection* Connection)
int
HttpPluginServerImpl::Initialize(int BasePort, std::filesystem::path DataDir)
{
+ ZEN_TRACE_CPU("HttpPluginServerImpl::Initialize");
+
ZEN_MEMSCOPE(GetHttppluginTag());
m_RequestTracer.Initialize(DataDir);
diff --git a/src/zenhttp/servers/httpsys.cpp b/src/zenhttp/servers/httpsys.cpp
index 62dab02c4..e57fa8a30 100644
--- a/src/zenhttp/servers/httpsys.cpp
+++ b/src/zenhttp/servers/httpsys.cpp
@@ -2078,6 +2078,8 @@ InitialRequestHandler::HandleCompletion(ULONG IoResult, ULONG_PTR NumberOfBytesT
int
HttpSysServer::Initialize(int BasePort, std::filesystem::path DataDir)
{
+ ZEN_TRACE_CPU("HttpSysServer::Initialize");
+
ZEN_UNUSED(DataDir);
if (int EffectivePort = InitializeServer(BasePort))
{
@@ -2106,6 +2108,7 @@ HttpSysServer::RegisterService(HttpService& Service)
Ref<HttpServer>
CreateHttpSysServer(HttpSysConfig Config)
{
+ ZEN_TRACE_CPU("CreateHttpSysServer");
ZEN_MEMSCOPE(GetHttpsysTag());
return Ref<HttpServer>(new HttpSysServer(Config));