Skip to content

Commit 38d6e68

Browse files
committed
Fix workflow
1 parent 1e788cd commit 38d6e68

3 files changed

Lines changed: 17 additions & 10 deletions

File tree

src/CorProfiler.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,14 +68,14 @@ HRESULT STDMETHODCALLTYPE CorProfiler::Initialize(IUnknown *pICorProfilerInfoUnk
6868
auto hr = this->corProfilerInfo->SetEventMask(eventMask);
6969
if (hr != S_OK)
7070
{
71-
LOG("ERROR: Profiler SetEventMask failed (HRESULT: {})", hr);
71+
LOG("ERROR: Profiler SetEventMask failed (HRESULT: 0x%08X)", (unsigned)hr);
7272
}
7373

7474
hr = this->corProfilerInfo->SetEnterLeaveFunctionHooks3WithInfo(EnterNaked, LeaveNaked, TailcallNaked);
7575

7676
if (hr != S_OK)
7777
{
78-
LOG("ERROR: Profiler SetEnterLeaveFunctionHooks3WithInfo failed (HRESULT: %d)", hr);
78+
LOG("ERROR: Profiler SetEnterLeaveFunctionHooks3WithInfo failed (HRESULT: 0x%08X)", (unsigned)hr);
7979
}
8080

8181
return S_OK;

src/Logger.h

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,17 @@
11
#pragma once
22

3-
#include <print>
4-
#include <format>
3+
#include <cstdarg>
4+
#include <cstdio>
55

6-
template <class... Args>
7-
constexpr void LOG(std::format_string<Args...> fmt, Args &&...args)
6+
inline void LOG(const char *fmt, ...)
87
{
9-
std::println("[SW2 TRACER] {}", std::format(fmt, std::forward<Args>(args)...));
10-
};
8+
std::fputs("[SW2 TRACER] ", stdout);
9+
10+
va_list args;
11+
va_start(args, fmt);
12+
std::vfprintf(stdout, fmt, args);
13+
va_end(args);
14+
15+
std::fputc('\n', stdout);
16+
std::fflush(stdout);
17+
}

src/StackManager.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,7 @@ void StackManager::FunctionLeave(FunctionIDOrClientID id, COR_PRF_ELT_INFO eltIn
382382
frames.resize(i);
383383
if ((state.desyncFoundNotTop & 0x3FFu) == 0)
384384
{
385-
LOG("WARNING: Leave desync repaired (count={})", state.desyncFoundNotTop);
385+
LOG("WARNING: Leave desync repaired (count=%u)", state.desyncFoundNotTop);
386386
}
387387
return;
388388
}
@@ -391,7 +391,7 @@ void StackManager::FunctionLeave(FunctionIDOrClientID id, COR_PRF_ELT_INFO eltIn
391391
state.desyncNotFound++;
392392
if ((state.desyncNotFound & 0x3FFu) == 0) // every 1024 times
393393
{
394-
LOG("WARNING: Leave desync not found (count={})", state.desyncNotFound);
394+
LOG("WARNING: Leave desync not found (count=%u)", state.desyncNotFound);
395395
}
396396
}
397397

0 commit comments

Comments
 (0)