-
Notifications
You must be signed in to change notification settings - Fork 37.7k
gui: Improve thread naming #18790
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
gui: Improve thread naming #18790
Conversation
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. ConflictsNo conflicts as of last run. |
Please keep to the convention of starting thread names with |
It is responsibility of the bitcoin/src/util/threadnames.cpp Lines 57 to 61 in 36c0abd
:) UPDATE: On the screenshot in OP you can see all of the touched threads with |
Thanks for clearing that up. |
da42cd4
to
64815f1
Compare
Updated da42cd4 -> 64815f1 (pr18790.01 -> pr18790.02, diff):
|
ACK 64815f1 |
ACK 64815f1 Built, run and tested on macOS Catalina 10.15.4 ./src/qt/bitcoin-qt -logthreadnames -debug -printtoconsole -regtest (7s 63ms)
2020-05-01T09:48:48Z Ignoring unknown configuration value regtest.natmap
2020-05-01T09:48:48Z [main] Bitcoin Core version pr18790.02 (release build)
2020-05-01T09:48:48Z [main] Qt 5.14.1 (dynamic), plugin=cocoa (dynamic)
2020-05-01T09:48:48Z [main] System: macOS 10.15, x86_64-little_endian-lp64
2020-05-01T09:48:48Z [main] Screen: Color LCD 1440x900, pixel ratio=1.0
2020-05-01T09:48:48Z [main] GUI: Populating font family aliases took 197 ms. Replace uses of missing font family ".AppleSystemUIFont,13,-1,5,50,0,0,0,0,0" with one that exists to avoid this cost.
2020-05-01T09:48:48Z [main] Validating signatures for all blocks.
2020-05-01T09:48:48Z [main] Setting nMinimumChainWork=0000000000000000000000000000000000000000000000000000000000000000
2020-05-01T09:48:48Z [main] Using the 'sse4(1way),sse41(4way),avx2(8way)' SHA256 implementation
2020-05-01T09:48:48Z [main] Using RdSeed as additional entropy source
2020-05-01T09:48:48Z [main] Using RdRand as an additional entropy source
2020-05-01T09:48:48Z [main] GUI: requestInitialize : Requesting initialize
2020-05-01T09:48:48Z [qt-init] GUI: initialize : Running initialization in thread
2020-05-01T09:48:48Z [qt-init] Default data directory /Users/brakmic/Library/Application Support/Bitcoin
2020-05-01T09:48:48Z [qt-init] Using data directory /Users/brakmic/Library/Application Support/Bitcoin/regtest
2020-05-01T09:48:48Z [qt-init] Config file: /Users/brakmic/Library/Application Support/Bitcoin/bitcoin.conf
2020-05-01T09:48:48Z [qt-init] Config file arg: regtest="0"
2020-05-01T09:48:48Z [qt-init] Config file arg: testnet="0"
2020-05-01T09:48:48Z [qt-init] Config file arg: [main] daemon="1"
2020-05-01T09:48:48Z [qt-init] Config file arg: [main] deprecatedrpc="signrawtransaction"
2020-05-01T09:48:48Z [qt-init] Config file arg: [main] listen="1"
2020-05-01T09:48:48Z [qt-init] Config file arg: [main] port="8444"
2020-05-01T09:48:48Z [qt-init] Config file arg: [main] prune="550"
2020-05-01T09:48:48Z [qt-init] Config file arg: [main] rest="1"
2020-05-01T09:48:48Z [qt-init] Config file arg: [main] rpcallowip="127.0.0.1"
2020-05-01T09:48:48Z [qt-init] Config file arg: [main] rpcbind=****
2020-05-01T09:48:48Z [qt-init] Config file arg: [main] rpcpassword=****
2020-05-01T09:48:48Z [qt-init] Config file arg: [main] rpcport="8445"
2020-05-01T09:48:48Z [qt-init] Config file arg: [main] rpcuser=****
2020-05-01T09:48:48Z [qt-init] Config file arg: [main] server="1"
2020-05-01T09:48:48Z [qt-init] Config file arg: [main] shrinkdebugfile="1"
2020-05-01T09:48:48Z [qt-init] Config file arg: [main] zmqpubhashblock="tcp://127.0.0.1:58335"
2020-05-01T09:48:48Z [qt-init] Config file arg: [main] zmqpubhashtx="tcp://127.0.0.1:58334"
2020-05-01T09:48:48Z [qt-init] Config file arg: [main] zmqpubrawblock="tcp://127.0.0.1:58332"
2020-05-01T09:48:48Z [qt-init] Config file arg: [main] zmqpubrawtx="tcp://127.0.0.1:58333" |
@brakmic |
Yes, sure. I was able to get |
It's because there is no logging in the |
Ok. I took a sample from the running process and here's the |
64815f1
to
6d8747d
Compare
Rebased 64815f1 -> 6d8747d (pr18790.02 -> pr18790.03) due to the conflict with #18699. |
6d8747d
to
f979110
Compare
Rebased 6d8747d -> f979110 (pr18790.03 -> pr18790.04) due to the conflict with #18152. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Concept ACK, build and dumped all thread list with lld, looks good.
From https://doc.qt.io/qt-5/qthread.html
To choose the name that your thread will be given (as identified by the command ps -L on Linux, for example), you can call setObjectName() before starting the thread. If you don't call setObjectName(), the name given to your thread will be the class name of the runtime type of your thread object (for example, "RenderThread" in the case of the Mandelbrot Example, as that is the name of the QThread subclass). Note that this is currently not available with release builds on Windows.
Is it because of the above windows issue that you don't use setObjectName
? Not sure if that even maters to us.
Using |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK f979110
Concept ACK |
f979110
to
ead771b
Compare
Rebased f979110 -> ead771b (pr18790.04 -> pr18790.05) due to the conflict with #19011. |
tACK ead771b |
ead771b qt: Rename qt-init thread before logging start (Hennadii Stepanov) ad5f614 qt: Name ClientModel timer QThread (Hennadii Stepanov) 2c7f5d8 qt: Name WalletController worker QThread (Hennadii Stepanov) 27dcc37 qt: Name RPCConsole executor QThread (Hennadii Stepanov) Pull request description: On **master** (eef90c1): - thread list from OS:  - log excerpt: ``` 2020-04-27T21:25:26Z [] GUI: initialize : Running initialization in thread ... 2020-04-27T21:26:04Z [] Using BerkeleyDB version Berkeley DB 4.8.30: (April 9, 2010) 2020-04-27T21:26:04Z [] Using wallet /home/hebasto/.bitcoin/testnet3/wallets/test2 2020-04-27T21:26:04Z [] BerkeleyEnvironment::Open: LogDir=/home/hebasto/.bitcoin/testnet3/wallets/test2/database ErrorFile=/home/hebasto/.bitcoin/testnet3/wallets/test2/db.log 2020-04-27T21:26:04Z [] init message: Loading wallet... 2020-04-27T21:26:04Z [] BerkeleyEnvironment::Open: LogDir=/home/hebasto/.bitcoin/testnet3/wallets/test2/database ErrorFile=/home/hebasto/.bitcoin/testnet3/wallets/test2/db.log 2020-04-27T21:26:04Z [] [test2] Wallet File Version = 169900 2020-04-27T21:26:04Z [] [test2] Keys: 2001 plaintext, 0 encrypted, 2001 w/ metadata, 2001 total. Unknown wallet records: 0 2020-04-27T21:26:04Z [] [test2] Wallet completed loading in 26ms 2020-04-27T21:26:04Z [] GUI: TransactionTablePriv::refreshWallet 2020-04-27T21:26:04Z [] [test2] setKeyPool.size() = 2000 2020-04-27T21:26:04Z [] [test2] mapWallet.size() = 0 2020-04-27T21:26:04Z [] [test2] m_address_book.size() = 0 ``` With **this PR**: - thread list from OS:  - log excerpt: ``` 2020-04-27T21:21:25Z [qt-init] GUI: initialize : Running initialization in thread ... 2020-04-27T21:23:08Z [qt-walletctrl] Using BerkeleyDB version Berkeley DB 4.8.30: (April 9, 2010) 2020-04-27T21:23:08Z [qt-walletctrl] Using wallet /home/hebasto/.bitcoin/testnet3/wallets/test2 2020-04-27T21:23:08Z [qt-walletctrl] BerkeleyEnvironment::Open: LogDir=/home/hebasto/.bitcoin/testnet3/wallets/test2/database ErrorFile=/home/hebasto/.bitcoin/testnet3/wallets/test2/db.log 2020-04-27T21:23:08Z [qt-walletctrl] init message: Loading wallet... 2020-04-27T21:23:08Z [qt-walletctrl] BerkeleyEnvironment::Open: LogDir=/home/hebasto/.bitcoin/testnet3/wallets/test2/database ErrorFile=/home/hebasto/.bitcoin/testnet3/wallets/test2/db.log 2020-04-27T21:23:08Z [qt-walletctrl] [test2] Wallet File Version = 169900 2020-04-27T21:23:08Z [qt-walletctrl] [test2] Keys: 2001 plaintext, 0 encrypted, 2001 w/ metadata, 2001 total. Unknown wallet records: 0 2020-04-27T21:23:08Z [qt-walletctrl] [test2] Wallet completed loading in 37ms 2020-04-27T21:23:08Z [qt-walletctrl] init message: Rescanning... 2020-04-27T21:23:08Z [qt-walletctrl] [test2] Rescanning last 112924 blocks (from block 1609206)... 2020-04-27T21:23:08Z [qt-walletctrl] [test2] Rescan started from block 000000000000003761c81f7efbd8cebf217f39d353ec1ac59c624ac2dddfc2a8... 2020-04-27T21:23:22Z [qt-walletctrl] [test2] Rescan completed in 14157ms 2020-04-27T21:23:22Z [qt-walletctrl] GUI: TransactionTablePriv::refreshWallet 2020-04-27T21:23:22Z [qt-walletctrl] [test2] setKeyPool.size() = 2000 2020-04-27T21:23:22Z [qt-walletctrl] [test2] mapWallet.size() = 0 2020-04-27T21:23:22Z [qt-walletctrl] [test2] m_address_book.size() = 0 ``` ACKs for top commit: Sjors: tACK ead771b Tree-SHA512: a3b2789990414ab23b69236ca36b656a3f026e11e88fb5940ef4fecfc2053df5ed886615afb37f98584f6e19b953209d3884baab057740b2e9eed68661880dd3
Summary: > qt: Name RPCConsole executor QThread > qt: Name WalletController worker QThread > qt: Name ClientModel timer QThread > qt: Rename qt-init thread before logging start This is a backport of [[bitcoin/bitcoin#18790 | core#18790]] Test Plan: ``` $ ninja && src/qt/bitcoin-qt $ ps -T -p $( ps -ef | grep bitcoin-qt | grep -v "grep" | awk '{print $2}') PID SPID TTY TIME CMD 31348 31348 pts/1 00:00:00 bitcoin-qt 31348 31349 pts/1 00:00:00 QXcbEventQueue 31348 31350 pts/1 00:00:00 gmain 31348 31351 pts/1 00:00:00 gdbus 31348 31352 pts/1 00:00:00 QDBusConnection 31348 31378 pts/1 00:00:01 b-qt-init 31348 31379 pts/1 00:00:00 b-scriptch.0 31348 31380 pts/1 00:00:00 b-scriptch.1 31348 31381 pts/1 00:00:00 b-scriptch.2 31348 31382 pts/1 00:00:00 b-scriptch.3 31348 31383 pts/1 00:00:00 b-scriptch.4 31348 31384 pts/1 00:00:00 b-scriptch.5 31348 31385 pts/1 00:00:00 b-scriptch.6 31348 31386 pts/1 00:00:00 b-scriptch.7 31348 31387 pts/1 00:00:00 b-scriptch.8 31348 31388 pts/1 00:00:00 b-scriptch.9 31348 31389 pts/1 00:00:00 b-scriptch.10 31348 31390 pts/1 00:00:00 b-scriptch.11 31348 31391 pts/1 00:00:00 b-scriptch.12 31348 31392 pts/1 00:00:00 b-scriptch.13 31348 31393 pts/1 00:00:00 b-scriptch.14 31348 31394 pts/1 00:00:00 b-scheduler 31348 31395 pts/1 00:00:00 b-qt-init 31348 31399 pts/1 00:00:00 b-torcontrol 31348 31400 pts/1 00:00:00 b-net 31348 31402 pts/1 00:00:00 b-addcon 31348 31403 pts/1 00:00:00 b-opencon 31348 31404 pts/1 00:00:00 b-msghand 31348 31405 pts/1 00:00:00 b-qt-clientmodl 31348 31406 pts/1 00:00:00 b-qt-rpcconsole 31348 31407 pts/1 00:00:00 b-qt-walletctrl 31348 31409 pts/1 00:00:00 Qt bearer threa ``` Reviewers: #bitcoin_abc, Fabien Reviewed By: #bitcoin_abc, Fabien Differential Revision: https://reviews.bitcoinabc.org/D10280
On master (eef90c1):
With this PR: