mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-08-04 16:32:39 +00:00
* libkernel: Cleanup some function places * kernel: Refactor thread functions * kernel: It builds * kernel: Fix a bunch of bugs, kernel thread heap * kernel: File cleanup pt1 * File cleanup pt2 * File cleanup pt3 * File cleanup pt4 * kernel: Add missing funcs * kernel: Add basic exceptions for linux * gnmdriver: Add workload functions * kernel: Fix new pthreads code on macOS. (#1441) * kernel: Downgrade edeadlk to log * gnmdriver: Add sceGnmSubmitCommandBuffersForWorkload * exception: Add context register population for macOS. (#1444) * kernel: Pthread rewrite touchups for Windows * kernel: Multiplatform thread implementation * mutex: Remove spamming log * pthread_spec: Make assert into a log * pthread_spec: Zero initialize array * Attempt to fix non-Windows builds * hotfix: change incorrect NID for scePthreadAttrSetaffinity * scePthreadAttrSetaffinity implementation * Attempt to fix Linux * windows: Address a bunch of address space problems * address_space: Fix unmap of region surrounded by placeholders * libs: Reduce logging * pthread: Implement condvar with waitable atomics and sleepqueue * sleepq: Separate and make faster * time: Remove delay execution * Causes high cpu usage in Tohou Luna Nights * kernel: Cleanup files again * pthread: Add missing include * semaphore: Use binary_semaphore instead of condvar * Seems more reliable * libraries/sysmodule: log module on `sceSysmoduleIsLoaded` * libraries/kernel: implement `scePthreadSetPrio` --------- Co-authored-by: squidbus <175574877+squidbus@users.noreply.github.com> Co-authored-by: Daniel R. <47796739+polybiusproxy@users.noreply.github.com>
60 lines
2.6 KiB
C++
60 lines
2.6 KiB
C++
// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
#pragma once
|
|
|
|
#ifdef _MSC_VER
|
|
#define BREAKPOINT __debugbreak
|
|
#elif defined(__GNUC__)
|
|
#define BREAKPOINT __builtin_trap
|
|
#else
|
|
#error What the fuck is this compiler
|
|
#endif
|
|
|
|
#include <tracy/Tracy.hpp>
|
|
|
|
static inline bool IsProfilerConnected() {
|
|
return tracy::GetProfiler().IsConnected();
|
|
}
|
|
|
|
#define CUSTOM_LOCK(type, varname) \
|
|
tracy::LockableCtx varname { \
|
|
[]() -> const tracy::SourceLocationData* { \
|
|
static constexpr tracy::SourceLocationData srcloc{nullptr, #type " " #varname, \
|
|
TracyFile, TracyLine, 0}; \
|
|
return &srcloc; \
|
|
}() \
|
|
}
|
|
|
|
#define TRACK_ALLOC(ptr, size, pool) TracyAllocN(std::bit_cast<void*>(ptr), (size), (pool))
|
|
#define TRACK_FREE(ptr, pool) TracyFreeN(std::bit_cast<void*>(ptr), (pool))
|
|
|
|
enum MarkersPalette : int {
|
|
EmulatorMarkerColor = 0x264653,
|
|
RendererMarkerColor = 0x2a9d8f,
|
|
HleMarkerColor = 0xe9c46a,
|
|
GpuMarkerColor = 0xf4a261,
|
|
Reserved1 = 0xe76f51,
|
|
};
|
|
|
|
#define EMULATOR_TRACE ZoneScopedC(EmulatorMarkerColor)
|
|
#define RENDERER_TRACE ZoneScopedC(RendererMarkerColor)
|
|
#define HLE_TRACE ZoneScopedC(HleMarkerColor)
|
|
|
|
#define TRACE_HINT(str) ZoneText(str.data(), str.size())
|
|
|
|
#define TRACE_WARN(msg) \
|
|
[](const auto& msg) { TracyMessageC(msg.c_str(), msg.size(), tracy::Color::DarkOrange); }(msg);
|
|
#define TRACE_ERROR(msg) \
|
|
[](const auto& msg) { TracyMessageC(msg.c_str(), msg.size(), tracy::Color::Red); }(msg)
|
|
#define TRACE_CRIT(msg) \
|
|
[](const auto& msg) { TracyMessageC(msg.c_str(), msg.size(), tracy::Color::HotPink); }(msg)
|
|
|
|
#define GPU_SCOPE_LOCATION(name, color) \
|
|
tracy::SourceLocationData{name, TracyFunction, TracyFile, (uint32_t)TracyLine, color};
|
|
|
|
#define MUTEX_LOCATION(name) \
|
|
tracy::SourceLocationData{nullptr, name, TracyFile, (uint32_t)TracyLine, 0};
|
|
|
|
#define FRAME_END FrameMark
|