mirror of
https://github.com/KytyPS5/KytyPS5.git
synced 2026-10-28 00:12:40 +00:00
Fix Linux fiber stack overflow with Clang 18 (#813)
Keep function-name formatting off small fiber stacks
This commit is contained in:
1 parent
a20fb7f9f8
commit
e73324c2e0
1 file changed
+14
-9
+14
-9
@@ -51,15 +51,7 @@
|
|||||||
// NOLINTNEXTLINE(cppcoreguidelines-macro-usage)
|
// NOLINTNEXTLINE(cppcoreguidelines-macro-usage)
|
||||||
#define PRINT_NAME() \
|
#define PRINT_NAME() \
|
||||||
if (PRINT_NAME_ENABLED) { \
|
if (PRINT_NAME_ENABLED) { \
|
||||||
if (Log::GetDirection() != Log::Direction::Silent) { \
|
Libs::PrintName(g_library, g_module, __func__); \
|
||||||
const auto elapsed_ms = static_cast<uint64_t>(Loader::Timer::GetTimeMs()); \
|
|
||||||
const auto print_name_time = fmt::format( \
|
|
||||||
"{:02}:{:02}:{:02}.{:03}", elapsed_ms / 3600000, (elapsed_ms / 60000) % 60, \
|
|
||||||
(elapsed_ms / 1000) % 60, elapsed_ms % 1000); \
|
|
||||||
LOGF_COLOR(Log::Color::Cyan, "[%d][%s] %s::%s::%s()\n", \
|
|
||||||
Common::Thread::GetThreadIdUnique(), print_name_time.c_str(), g_library, \
|
|
||||||
g_module, __func__); \
|
|
||||||
} \
|
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace Loader {
|
namespace Loader {
|
||||||
@@ -68,6 +60,19 @@ class SymbolDatabase;
|
|||||||
|
|
||||||
namespace Libs {
|
namespace Libs {
|
||||||
|
|
||||||
|
// Keep the formatting path from inflating fiber functions' stack frames under LTO.
|
||||||
|
[[gnu::noinline]] inline void PrintName(const char* library, const char* module, const char* function) {
|
||||||
|
if (Log::GetDirection() != Log::Direction::Silent) {
|
||||||
|
const auto elapsed_ms = static_cast<uint64_t>(Loader::Timer::GetTimeMs());
|
||||||
|
const auto print_name_time = fmt::format(
|
||||||
|
"{:02}:{:02}:{:02}.{:03}", elapsed_ms / 3600000, (elapsed_ms / 60000) % 60,
|
||||||
|
(elapsed_ms / 1000) % 60, elapsed_ms % 1000);
|
||||||
|
LOGF_COLOR(Log::Color::Cyan, "[%d][%s] %s::%s::%s()\n",
|
||||||
|
Common::Thread::GetThreadIdUnique(), print_name_time.c_str(), library, module,
|
||||||
|
function);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void InitAll(Loader::SymbolDatabase* s);
|
void InitAll(Loader::SymbolDatabase* s);
|
||||||
|
|
||||||
} // namespace Libs
|
} // namespace Libs
|
||||||
|
|||||||
Reference in new issue
Block a user