aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/init/common.cpp8
-rw-r--r--src/test/util/random.h5
-rw-r--r--src/test/util_threadnames_tests.cpp7
-rw-r--r--src/util/threadnames.cpp11
4 files changed, 3 insertions, 28 deletions
diff --git a/src/init/common.cpp b/src/init/common.cpp
index 3a6df3e8bd..f473ee6d66 100644
--- a/src/init/common.cpp
+++ b/src/init/common.cpp
@@ -31,11 +31,7 @@ void AddLoggingArgs(ArgsManager& argsman)
argsman.AddArg("-logips", strprintf("Include IP addresses in debug output (default: %u)", DEFAULT_LOGIPS), ArgsManager::ALLOW_ANY, OptionsCategory::DEBUG_TEST);
argsman.AddArg("-loglevel=<level>|<category>:<level>", strprintf("Set the global or per-category severity level for logging categories enabled with the -debug configuration option or the logging RPC. Possible values are %s (default=%s). The following levels are always logged: error, warning, info. If <category>:<level> is supplied, the setting will override the global one and may be specified multiple times to set multiple category-specific levels. <category> can be: %s.", LogInstance().LogLevelsString(), LogInstance().LogLevelToStr(BCLog::DEFAULT_LOG_LEVEL), LogInstance().LogCategoriesString()), ArgsManager::DISALLOW_NEGATION | ArgsManager::DISALLOW_ELISION | ArgsManager::DEBUG_ONLY, OptionsCategory::DEBUG_TEST);
argsman.AddArg("-logtimestamps", strprintf("Prepend debug output with timestamp (default: %u)", DEFAULT_LOGTIMESTAMPS), ArgsManager::ALLOW_ANY, OptionsCategory::DEBUG_TEST);
-#ifdef HAVE_THREAD_LOCAL
- argsman.AddArg("-logthreadnames", strprintf("Prepend debug output with name of the originating thread (only available on platforms supporting thread_local) (default: %u)", DEFAULT_LOGTHREADNAMES), ArgsManager::ALLOW_ANY, OptionsCategory::DEBUG_TEST);
-#else
- argsman.AddHiddenArgs({"-logthreadnames"});
-#endif
+ argsman.AddArg("-logthreadnames", strprintf("Prepend debug output with name of the originating thread (default: %u)", DEFAULT_LOGTHREADNAMES), ArgsManager::ALLOW_ANY, OptionsCategory::DEBUG_TEST);
argsman.AddArg("-logsourcelocations", strprintf("Prepend debug output with name of the originating source location (source file, line number and function name) (default: %u)", DEFAULT_LOGSOURCELOCATIONS), ArgsManager::ALLOW_ANY, OptionsCategory::DEBUG_TEST);
argsman.AddArg("-logtimemicros", strprintf("Add microsecond precision to debug timestamps (default: %u)", DEFAULT_LOGTIMEMICROS), ArgsManager::ALLOW_ANY | ArgsManager::DEBUG_ONLY, OptionsCategory::DEBUG_TEST);
argsman.AddArg("-loglevelalways", strprintf("Always prepend a category and level (default: %u)", DEFAULT_LOGLEVELALWAYS), ArgsManager::ALLOW_ANY, OptionsCategory::DEBUG_TEST);
@@ -50,9 +46,7 @@ void SetLoggingOptions(const ArgsManager& args)
LogInstance().m_print_to_console = args.GetBoolArg("-printtoconsole", !args.GetBoolArg("-daemon", false));
LogInstance().m_log_timestamps = args.GetBoolArg("-logtimestamps", DEFAULT_LOGTIMESTAMPS);
LogInstance().m_log_time_micros = args.GetBoolArg("-logtimemicros", DEFAULT_LOGTIMEMICROS);
-#ifdef HAVE_THREAD_LOCAL
LogInstance().m_log_threadnames = args.GetBoolArg("-logthreadnames", DEFAULT_LOGTHREADNAMES);
-#endif
LogInstance().m_log_sourcelocations = args.GetBoolArg("-logsourcelocations", DEFAULT_LOGSOURCELOCATIONS);
LogInstance().m_always_print_category_level = args.GetBoolArg("-loglevelalways", DEFAULT_LOGLEVELALWAYS);
diff --git a/src/test/util/random.h b/src/test/util/random.h
index c910bd6a3a..18ab425e48 100644
--- a/src/test/util/random.h
+++ b/src/test/util/random.h
@@ -14,9 +14,8 @@
/**
* This global and the helpers that use it are not thread-safe.
*
- * If thread-safety is needed, the global could be made thread_local (given
- * that thread_local is supported on all architectures we support) or a
- * per-thread instance could be used in the multi-threaded test.
+ * If thread-safety is needed, a per-thread instance could be
+ * used in the multi-threaded test.
*/
extern FastRandomContext g_insecure_rand_ctx;
diff --git a/src/test/util_threadnames_tests.cpp b/src/test/util_threadnames_tests.cpp
index df5b1a4461..174052d5fa 100644
--- a/src/test/util_threadnames_tests.cpp
+++ b/src/test/util_threadnames_tests.cpp
@@ -11,8 +11,6 @@
#include <thread>
#include <vector>
-#include <config/bitcoin-config.h> // IWYU pragma: keep
-
#include <boost/test/unit_test.hpp>
BOOST_AUTO_TEST_SUITE(util_threadnames_tests)
@@ -52,11 +50,6 @@ std::set<std::string> RenameEnMasse(int num_threads)
*/
BOOST_AUTO_TEST_CASE(util_threadnames_test_rename_threaded)
{
-#if !defined(HAVE_THREAD_LOCAL)
- // This test doesn't apply to platforms where we don't have thread_local.
- return;
-#endif
-
std::set<std::string> names = RenameEnMasse(100);
BOOST_CHECK_EQUAL(names.size(), 100U);
diff --git a/src/util/threadnames.cpp b/src/util/threadnames.cpp
index ba074e30e0..0249de37e3 100644
--- a/src/util/threadnames.cpp
+++ b/src/util/threadnames.cpp
@@ -37,10 +37,6 @@ static void SetThreadName(const char* name)
#endif
}
-// If we have thread_local, just keep thread ID and name in a thread_local
-// global.
-#if defined(HAVE_THREAD_LOCAL)
-
/**
* The name of the thread. We use char array instead of std::string to avoid
* complications with running a destructor when the thread exits. Avoid adding
@@ -58,13 +54,6 @@ static void SetInternalName(const std::string& name)
g_thread_name[copy_bytes] = '\0';
}
-// Without thread_local available, don't handle internal name at all.
-#else
-
-std::string util::ThreadGetInternalName() { return ""; }
-static void SetInternalName(const std::string& name) { }
-#endif
-
void util::ThreadRename(const std::string& name)
{
SetThreadName(("b-" + name).c_str());