Skip to content

Util ports#197

Merged
dgenr8 merged 14 commits into
bitcoinxt:masterfrom
dagurval:util-ports
May 10, 2017
Merged

Util ports#197
dgenr8 merged 14 commits into
bitcoinxt:masterfrom
dagurval:util-ports

Conversation

@dagurval

Copy link
Copy Markdown
Member

Misc PRs from Core related to util.cpp/util.h

bitcoin/bitcoin#6164 - Allow user to use -debug=1 to enable all debugging
bitcoin/bitcoin#6361 - Use real number of cores for default -par, ignore virtual cores
bitcoin/bitcoin#6149 - Buffer log messages and explicitly open logs
bitcoin/bitcoin#6438 - openssl: avoid config file load/race
bitcoin/bitcoin#6284 - Fix argument parsing oddity with -noX
bitcoin/bitcoin#6742 - Changed logging to make -logtimestamps to work also for -printtoconsole
bitcoin/bitcoin#7114 - util: Don't set strMiscWarning on every exception
bitcoin/bitcoin#7667 - Move GetTempPath() to testutil
bitcoin/bitcoin#8000 - tinyformat: force USE_VARIADIC_TEMPLATES
bitcoin/bitcoin#8011 - don't run ThreadMessageHandler at lowered priority
bitcoin/bitcoin#8123 - Use std::atomic for fRequestShutdown and fReopenDebugLog

lpescher and others added 14 commits April 23, 2017 04:27
…r options

Most people expect a value of 1 to enable all for command line arguments.
However to do this for the -debug option you must type "-debug=".
This has been changed to allow "-debug=1" as well as "-debug=" to
enable all debug logging
To determine the default for `-par`, the number of script verification
threads, use [boost::thread::physical_concurrency()](http://www.boost.org/doc/libs/1_58_0/doc/html/thread/thread_management.html#thread.thread_management.thread.physical_concurrency)
which counts only physical cores, not virtual cores.

Virtual cores are roughly a set of cached registers to avoid context
switches while threading, they cannot actually perform work, so spawning
a verification thread for them could even reduce efficiency and will put
undue load on the system.

Should fix issue #6358, as well as some other reported system overload
issues, especially on Intel processors.

The function was only introduced in boost 1.56, so provide a utility
function `GetNumCores` to fall back for older Boost versions.

Conflicts:
	src/init.cpp
	src/miner.cpp
Prevents stomping on debug logs in datadirs that are locked by other
instances and lost parameter interaction messages that can get wiped by
ShrinkDebugFile().

The log is now opened explicitly and all emitted messages are buffered
until this open occurs.  The version message and log cut have also been
moved to the earliest possible sensible location.

Conflicts:
	src/init.cpp
`bitcoind -X -noX` ends up, unintuitively, with `X` set.
(for all boolean options X)

This result is due to the odd two-pass processing of arguments. This
patch fixes this oddity and simplifies the code at the same time.

Conflicts:
	src/util.cpp
Fixes #6809 - run-of-the-mill exceptions should not get into
strMiscWarning (which is reported by `getinfo`).
Conflicts:
	src/Makefile.test.include
	src/test/alert_tests.cpp
	src/test/test_bitcoin.cpp
	src/test/testutil.cpp
	src/test/testutil.h
	src/util.cpp
Now that we started using c++11, force use of variadic templates.

The autodetection may be wonky on some compilers, see discussion
[here](bitcoin/bitcoin#7982 (comment))
and is unnecessary for us anyhow.
There's no clear reason ThreadMessageHandler should be low priority.
Fixes #8010 (priority inversion).

Note from cherry-picker: This commit originally removed
SetThreadPriority from util.cpp. We're keeping this function for the
internal miner.

Conflicts:
	src/util.cpp
Conflicts:
	src/init.cpp
	src/util.cpp
	src/util.h
@dgenr8

dgenr8 commented May 10, 2017

Copy link
Copy Markdown
Member

utACK

@dgenr8 dgenr8 merged commit 4607089 into bitcoinxt:master May 10, 2017
@dagurval dagurval deleted the util-ports branch May 13, 2017 21:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

10 participants