HomePhabricator

Thread names in logs and deadlock debug tools

Description

Thread names in logs and deadlock debug tools

Summary:
Backport of core PR15849.

The first commit disables thread_local on some platforms and is not ported:

  • The Darwin exclusion is no longer needed since D5514.
  • The MinGw exclusion does not seem necessary, at least with our version. The tests run fine on Windows, both 32 and 64 bits.

Also see D2219 which removes the thread_local check.

This introduces a number of bugs:

  • This is breaking the build for some *BSD.
  • This makes some Unix tools inefficient, like ps or killall.
  • Some thread names are truncated and cannot be differentiated.

The fixes will be ported in their own diff for readability.

Test Plan:

ninja check
make check

Run the Gitian builds.

Run test_bitcoin.exe on Windows (32 bits) for sanity.
Builld and run the tests on OSX.

Start bitcoind with -logthreadnames=1 and check the debug log
contains the
thread names.

Reviewers: #bitcoin_abc, jasonbcox

Reviewed By: #bitcoin_abc, jasonbcox

Subscribers: jasonbcox

Differential Revision: https://reviews.bitcoinabc.org/D5540

Details

Provenance
James O'Beirne <james.obeirne@gmail.com>Authored on Jun 13 2018, 18:50
FabienCommitted on Mar 24 2020, 09:38
FabienPushed on Mar 24 2020, 12:52
Reviewer
Restricted Project
Differential Revision
D5540: Thread names in logs and deadlock debug tools
Parents
rSTAGING52d310b4a28b: utils: Add fstream wrapper to allow to pass unicode filename on Windows
Branches
Unknown
Tags
Unknown