diff --git a/app/src/main/cpp/skyline/gpu/presentation_engine.cpp b/app/src/main/cpp/skyline/gpu/presentation_engine.cpp index b6d8858d..87643ecb 100644 --- a/app/src/main/cpp/skyline/gpu/presentation_engine.cpp +++ b/app/src/main/cpp/skyline/gpu/presentation_engine.cpp @@ -65,7 +65,9 @@ namespace skyline::gpu { } void PresentationEngine::ChoreographerThread() { - pthread_setname_np(pthread_self(), "Skyline-Choreographer"); + if (int result{pthread_setname_np(pthread_self(), "Sky-Choreo")}) + Logger::Warn("Failed to set the thread name: {}", strerror(result)); + try { signal::SetSignalHandler({SIGINT, SIGILL, SIGTRAP, SIGBUS, SIGFPE, SIGSEGV}, signal::ExceptionalSignalHandler); choreographerLooper = ALooper_prepare(0); diff --git a/app/src/main/cpp/skyline/kernel/types/KThread.cpp b/app/src/main/cpp/skyline/kernel/types/KThread.cpp index 8cb39ade..1ecc5e65 100644 --- a/app/src/main/cpp/skyline/kernel/types/KThread.cpp +++ b/app/src/main/cpp/skyline/kernel/types/KThread.cpp @@ -35,9 +35,12 @@ namespace skyline::kernel::type { } void KThread::StartThread() { - std::array threadName; - pthread_getname_np(pthread, threadName.data(), threadName.size()); - pthread_setname_np(pthread, fmt::format("HOS-{}", id).c_str()); + std::array threadName{}; + if (int result{pthread_getname_np(pthread, threadName.data(), threadName.size())}) + Logger::Warn("Failed to get the thread name: {}", strerror(result)); + + if (int result{pthread_setname_np(pthread, fmt::format("HOS-{}", id).c_str())}) + Logger::Warn("Failed to set the thread name: {}", strerror(result)); Logger::UpdateTag(); if (!ctx.tpidrroEl0) @@ -60,7 +63,8 @@ namespace skyline::kernel::type { Signal(); if (threadName[0] != 'H' || threadName[1] != 'O' || threadName[2] != 'S' || threadName[3] != '-') { - pthread_setname_np(pthread, threadName.data()); + if (int result{pthread_setname_np(pthread, threadName.data())}) + Logger::Warn("Failed to set the thread name: {}", strerror(result)); Logger::UpdateTag(); } diff --git a/app/src/main/cpp/skyline/soc/gm20b/gpfifo.cpp b/app/src/main/cpp/skyline/soc/gm20b/gpfifo.cpp index c9d5b996..189d04e2 100644 --- a/app/src/main/cpp/skyline/soc/gm20b/gpfifo.cpp +++ b/app/src/main/cpp/skyline/soc/gm20b/gpfifo.cpp @@ -340,7 +340,9 @@ namespace skyline::soc::gm20b { } void ChannelGpfifo::Run() { - pthread_setname_np(pthread_self(), "GPFIFO"); + if (int result{pthread_setname_np(pthread_self(), "GPFIFO")}) + Logger::Warn("Failed to set the thread name: {}", strerror(result)); + try { signal::SetSignalHandler({SIGINT, SIGILL, SIGTRAP, SIGBUS, SIGFPE}, signal::ExceptionalSignalHandler); signal::SetSignalHandler({SIGSEGV}, nce::NCE::HostSignalHandler); // We may access NCE trapped memory diff --git a/app/src/main/cpp/skyline/soc/host1x/command_fifo.cpp b/app/src/main/cpp/skyline/soc/host1x/command_fifo.cpp index 6c9b132a..ff67e7a6 100644 --- a/app/src/main/cpp/skyline/soc/host1x/command_fifo.cpp +++ b/app/src/main/cpp/skyline/soc/host1x/command_fifo.cpp @@ -114,8 +114,8 @@ namespace skyline::soc::host1x { } void ChannelCommandFifo::Run() { - pthread_setname_np(pthread_self(), "ChannelCommandFifo"); - Logger::UpdateTag(); + if (int result{pthread_setname_np(pthread_self(), "ChannelCmdFifo")}) + Logger::Warn("Failed to set the thread name: {}", strerror(result)); try { signal::SetSignalHandler({SIGINT, SIGILL, SIGTRAP, SIGBUS, SIGFPE}, signal::ExceptionalSignalHandler);