diff options
author | Jon Atack <jon@atack.com> | 2021-08-18 12:29:36 +0200 |
---|---|---|
committer | Jon Atack <jon@atack.com> | 2021-08-18 19:57:15 +0200 |
commit | b7a17444e0746c562ae97b26eba431577947b06a (patch) | |
tree | b2995987513a07c104ebf9944da9a5ee91892dd4 /src | |
parent | bb9f76a7194a665effab169d228bb8cbc66ccf86 (diff) | |
download | bitcoin-b7a17444e0746c562ae97b26eba431577947b06a.tar.xz |
log, sync: add LOCK logging category, apply it to lock contention
Diffstat (limited to 'src')
-rw-r--r-- | src/logging.cpp | 1 | ||||
-rw-r--r-- | src/logging.h | 1 | ||||
-rw-r--r-- | src/sync.cpp | 4 |
3 files changed, 4 insertions, 2 deletions
diff --git a/src/logging.cpp b/src/logging.cpp index b456108b61..eb2c750296 100644 --- a/src/logging.cpp +++ b/src/logging.cpp @@ -159,6 +159,7 @@ const CLogCategoryDesc LogCategories[] = {BCLog::VALIDATION, "validation"}, {BCLog::I2P, "i2p"}, {BCLog::IPC, "ipc"}, + {BCLog::LOCK, "lock"}, {BCLog::ALL, "1"}, {BCLog::ALL, "all"}, }; diff --git a/src/logging.h b/src/logging.h index 38d73863e7..53a89d28bd 100644 --- a/src/logging.h +++ b/src/logging.h @@ -59,6 +59,7 @@ namespace BCLog { VALIDATION = (1 << 21), I2P = (1 << 22), IPC = (1 << 23), + LOCK = (1 << 24), ALL = ~(uint32_t)0, }; diff --git a/src/sync.cpp b/src/sync.cpp index a2b62c2286..9351417d43 100644 --- a/src/sync.cpp +++ b/src/sync.cpp @@ -29,8 +29,8 @@ static_assert(false, "thread_local is not supported"); #endif void PrintLockContention(const char* pszName, const char* pszFile, int nLine) { - LogPrintf("LOCKCONTENTION: %s\n", pszName); - LogPrintf("Locker: %s:%d\n", pszFile, nLine); + LogPrint(BCLog::LOCK, "LOCKCONTENTION: %s\n", pszName); + LogPrint(BCLog::LOCK, "Locker: %s:%d\n", pszFile, nLine); } #endif /* DEBUG_LOCKCONTENTION */ |