mirror of
https://github.com/KytyPS5/KytyPS5.git
synced 2026-10-20 10:56:58 +02:00
36 lines
864 B
C++
36 lines
864 B
C++
#include "common/profiler.h"
|
|
|
|
#include "common/emulatorConfig.h"
|
|
|
|
#include <common/TracyProtocol.hpp>
|
|
#include <common/TracyVersion.hpp>
|
|
#include <cstdio>
|
|
#include <tracy/Tracy.hpp>
|
|
|
|
namespace Profiler {
|
|
|
|
void SetThreadName(const char* name) {
|
|
if (tracy::ProfilerAvailable() && name != nullptr) {
|
|
tracy::SetThreadName(name);
|
|
}
|
|
}
|
|
|
|
void Initialize() {
|
|
if (Config::ProfilerEnabled() && !tracy::ProfilerAvailable()) {
|
|
tracy::StartupProfiler();
|
|
TracySetProgramName("KytyPS5");
|
|
::printf("Tracy profiler enabled: client %d.%d.%d, protocol %u, "
|
|
"broadcast %u, connect to 127.0.0.1:8086\n",
|
|
tracy::Version::Major, tracy::Version::Minor, tracy::Version::Patch,
|
|
tracy::ProtocolVersion, tracy::BroadcastVersion);
|
|
}
|
|
}
|
|
|
|
void Shutdown() {
|
|
if (tracy::ProfilerAvailable()) {
|
|
tracy::ShutdownProfiler();
|
|
}
|
|
}
|
|
|
|
} // namespace Profiler
|