Skip to content

Commit d3eeb19

Browse files
committed
Revert "Put lock logging behind DEBUG_LOCKCONTENTION preprocessor directive"
This reverts commit 2b7faf0.
1 parent f1174cc commit d3eeb19

6 files changed

Lines changed: 6 additions & 18 deletions

File tree

src/logging.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,9 +160,7 @@ const CLogCategoryDesc LogCategories[] =
160160
{BCLog::VALIDATION, "validation"},
161161
{BCLog::I2P, "i2p"},
162162
{BCLog::IPC, "ipc"},
163-
#ifdef DEBUG_LOCKCONTENTION
164163
{BCLog::LOCK, "lock"},
165-
#endif
166164
{BCLog::UTIL, "util"},
167165
{BCLog::BLOCKSTORE, "blockstorage"},
168166
{BCLog::ALL, "1"},

src/logging.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,7 @@ namespace BCLog {
6060
VALIDATION = (1 << 21),
6161
I2P = (1 << 22),
6262
IPC = (1 << 23),
63-
#ifdef DEBUG_LOCKCONTENTION
6463
LOCK = (1 << 24),
65-
#endif
6664
UTIL = (1 << 25),
6765
BLOCKSTORE = (1 << 26),
6866
ALL = ~(uint32_t)0,

src/net.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
#include <crypto/siphash.h>
1414
#include <hash.h>
1515
#include <i2p.h>
16-
#include <logging.h>
1716
#include <net_permissions.h>
1817
#include <netaddress.h>
1918
#include <netbase.h>
@@ -33,7 +32,6 @@
3332
#include <cstdint>
3433
#include <deque>
3534
#include <functional>
36-
#include <list>
3735
#include <map>
3836
#include <memory>
3937
#include <optional>

src/sync.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,8 @@
66
#ifndef BITCOIN_SYNC_H
77
#define BITCOIN_SYNC_H
88

9-
#ifdef DEBUG_LOCKCONTENTION
109
#include <logging.h>
1110
#include <logging/timer.h>
12-
#endif
13-
1411
#include <threadsafety.h>
1512
#include <util/macros.h>
1613

@@ -139,10 +136,8 @@ class SCOPED_LOCKABLE UniqueLock : public Base
139136
void Enter(const char* pszName, const char* pszFile, int nLine)
140137
{
141138
EnterCritical(pszName, pszFile, nLine, Base::mutex());
142-
#ifdef DEBUG_LOCKCONTENTION
143139
if (Base::try_lock()) return;
144140
LOG_TIME_MICROS_WITH_CATEGORY(strprintf("lock contention %s, %s:%d", pszName, pszFile, nLine), BCLog::LOCK);
145-
#endif
146141
Base::lock();
147142
}
148143

src/test/checkqueue_tests.cpp

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,13 @@
1919
#include <vector>
2020

2121
/**
22-
* Identical to TestingSetup but excludes lock contention logging if
23-
* `DEBUG_LOCKCONTENTION` is defined, as some of these tests are designed to be
24-
* heavily contested to trigger race conditions or other issues.
22+
* Identical to TestingSetup but excludes lock contention logging, as some of
23+
* these tests are designed to be heavily contested to trigger race conditions
24+
* or other issues.
2525
*/
2626
struct NoLockLoggingTestingSetup : public TestingSetup {
2727
NoLockLoggingTestingSetup()
28-
#ifdef DEBUG_LOCKCONTENTION
2928
: TestingSetup{CBaseChainParams::MAIN, /*extra_args=*/{"-debugexclude=lock"}} {}
30-
#else
31-
: TestingSetup{CBaseChainParams::MAIN} {}
32-
#endif
3329
};
3430

3531
BOOST_FIXTURE_TEST_SUITE(checkqueue_tests, NoLockLoggingTestingSetup)

test/functional/rpc_misc.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,9 @@ def run_test(self):
5656

5757
self.log.info("test logging rpc and help")
5858

59+
# Test logging RPC returns the expected number of logging categories.
60+
assert_equal(len(node.logging()), 27)
61+
5962
# Test toggling a logging category on/off/on with the logging RPC.
6063
assert_equal(node.logging()['qt'], True)
6164
node.logging(exclude=['qt'])

0 commit comments

Comments
 (0)