From eeb057effd3eaa1dd1010b8f60a76b4991ddfb9d Mon Sep 17 00:00:00 2001 From: Hayodea Hekol Date: Thu, 6 Nov 2025 15:09:15 -0400 Subject: [PATCH] Dbg:Threading: prefix thread names with "smo:" so they group --- main.cpp | 2 +- smocore/componentThread.cpp | 4 +++- smocore/marionette/main.cpp | 4 +++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/main.cpp b/main.cpp index 97da653..e88ded9 100644 --- a/main.cpp +++ b/main.cpp @@ -6,7 +6,7 @@ int main(int argc, char *argv[], char *envp[]) { - pthread_setname_np(pthread_self(), "CRT:main"); + pthread_setname_np(pthread_self(), "smo:CRT:main"); /* We don't do anything inside of main() * Main merely waits for the marionette thread to exit. */ diff --git a/smocore/componentThread.cpp b/smocore/componentThread.cpp index bd3d6b3..829f482 100644 --- a/smocore/componentThread.cpp +++ b/smocore/componentThread.cpp @@ -1,6 +1,7 @@ #include #include #include +#include #include #include #include @@ -45,7 +46,8 @@ const std::shared_ptr ComponentThread::getSelf(void) void MindThread::main(MindThread& self) { - pthread_setname_np(pthread_self(), self.name.c_str()); + std::string threadName = "smo:" + self.name; + pthread_setname_np(pthread_self(), threadName.c_str()); if (OptionParser::getOptions().verbose) { diff --git a/smocore/marionette/main.cpp b/smocore/marionette/main.cpp index ecaa1b4..9a024c0 100644 --- a/smocore/marionette/main.cpp +++ b/smocore/marionette/main.cpp @@ -2,6 +2,7 @@ #include #include #include +#include #include #include #include @@ -66,7 +67,8 @@ void marionetteInitializeReqCb(bool success) void MarionetteThread::main(MarionetteThread& self) { - pthread_setname_np(pthread_self(), self.name.c_str()); + std::string threadName = "smo:" + self.name; + pthread_setname_np(pthread_self(), threadName.c_str()); // Wait for CRT's main() to post us the command line args. std::cout << __func__ << ": Waiting for command line JOLT" << std::endl; self.getIoService().run();