bitcoin/src/test/fuzz
Wladimir J. van der Laan b805dbb0b9
Merge #19809: log: Prefix log messages with function name and source code location if -logsourcelocations is set
b4511e2e2e log: Prefix log messages with function name if -logsourcelocations is set (practicalswift)

Pull request description:

  Prefix log messages with function name if `-logfunctionnames` is set.

  Yes, exactly like `-logthreadnames` but for function names instead of thread names :)

  This is a small developer ergonomics improvement: I've found this to be a cheap/simple way to correlate log output and originating function.

  For me it beats the ordinary cycle of 1.) try to figure out a regexp matching the static part of the dynamic log message, 2.) `git grep -E 'Using .* MiB out of .* requested for signature cache'`, 3.) `mcedit filename.cpp` (`openemacs filename.cpp` works too!) and 4.) search for log message and scroll up to find the function name :)

  Without any logging parameters:

  ```
  $ src/bitcoind -regtest
  2020-08-25T03:29:04Z Using RdRand as an additional entropy source
  2020-08-25T03:29:04Z Using 16 MiB out of 32/2 requested for signature cache, able to store 524288 elements
  2020-08-25T03:29:04Z Using 16 MiB out of 32/2 requested for script execution cache, able to store 524288 elements
  2020-08-25T03:29:04Z Loaded best chain: hashBestChain=0fff88f13cb7b2c71f2a335e3a4fc328bf5beb436012afca590b1a11466e22ff height=0 date=2011-02-02T23:16:42Z progress=1.000000
  2020-08-25T03:29:04Z block tree size = 1
  2020-08-25T03:29:04Z nBestHeight = 0
  2020-08-25T03:29:04Z Imported mempool transactions from disk: 0 succeeded, 0 failed, 0 expired, 0 already there, 0 waiting for initial broadcast
  2020-08-25T03:29:04Z 0 addresses found from DNS seeds
  ```

  With `-logthreadnames` and `-logfunctionnames`:

  ```
  $ src/bitcoind -regtest -logthreadnames -logfunctionnames
  2020-08-25T03:29:04Z [init] [ReportHardwareRand] Using RdRand as an additional entropy source
  2020-08-25T03:29:04Z [init] [InitSignatureCache] Using 16 MiB out of 32/2 requested for signature cache, able to store 524288 elements
  2020-08-25T03:29:04Z [init] [InitScriptExecutionCache] Using 16 MiB out of 32/2 requested for script execution cache, able to store 524288 elements
  2020-08-25T03:29:04Z [init] [LoadChainTip] Loaded best chain: hashBestChain=0fff88f13cb7b2c71f2a335e3a4fc328bf5beb436012afca590b1a11466e22ff height=0 date=2011-02-02T23:16:42Z progress=1.000000
  2020-08-25T03:29:04Z [init] [AppInitMain] block tree size = 1
  2020-08-25T03:29:04Z [init] [AppInitMain] nBestHeight = 0
  2020-08-25T03:29:04Z [loadblk] [LoadMempool] Imported mempool transactions from disk: 0 succeeded, 0 failed, 0 expired, 0 already there, 0 waiting for initial broadcast
  2020-08-25T03:29:04Z [dnsseed] [ThreadDNSAddressSeed] 0 addresses found from DNS seeds
  ```

ACKs for top commit:
  laanwj:
    Code review ACK b4511e2e2e
  MarcoFalke:
    review ACK b4511e2e2e 🌃

Tree-SHA512: d100f5364630c323f31d275259864c597f7725e462d5f4bdedcc7033ea616d7fc0d16ef1b2af557e692f4deea73c6773ccfc681589e7bf6ba970b9ec169040c7
2021-02-18 14:37:51 +01:00
..
addition_overflow.cpp fuzz: Link all targets once 2020-12-10 07:15:42 +01:00
addrdb.cpp fuzz: Link all targets once 2020-12-10 07:15:42 +01:00
addrman.cpp fuzz: Introduce CallOneOf helper to replace switch-case 2021-01-11 10:37:16 +01:00
asmap.cpp fuzz: Link all targets once 2020-12-10 07:15:42 +01:00
asmap_direct.cpp fuzz: Link all targets once 2020-12-10 07:15:42 +01:00
autofile.cpp fuzz: Introduce CallOneOf helper to replace switch-case 2021-01-11 10:37:16 +01:00
banman.cpp fuzz: Consolidate fuzzing TestingSetup initialization 2021-01-21 09:29:42 -05:00
base_encode_decode.cpp fuzz: Link all targets once 2020-12-10 07:15:42 +01:00
bech32.cpp scripted-diff: Bump copyright headers 2020-12-31 09:45:41 +01:00
block.cpp fuzz: Link all targets once 2020-12-10 07:15:42 +01:00
block_header.cpp fuzz: Link all targets once 2020-12-10 07:15:42 +01:00
blockfilter.cpp fuzz: Link all targets once 2020-12-10 07:15:42 +01:00
bloom_filter.cpp fuzz: Introduce CallOneOf helper to replace switch-case 2021-01-11 10:37:16 +01:00
buffered_file.cpp fuzz: Introduce CallOneOf helper to replace switch-case 2021-01-11 10:37:16 +01:00
chain.cpp fuzz: Link all targets once 2020-12-10 07:15:42 +01:00
checkqueue.cpp fuzz: Link all targets once 2020-12-10 07:15:42 +01:00
coins_view.cpp fuzz: Initialize a full TestingSetup where appropriate 2021-01-21 09:29:42 -05:00
connman.cpp fuzz: Consolidate fuzzing TestingSetup initialization 2021-01-21 09:29:42 -05:00
crypto.cpp fuzz: Remove expensive and redundant muhash from crypto fuzz target 2021-02-15 14:39:08 +01:00
crypto_aes256.cpp fuzz: Link all targets once 2020-12-10 07:15:42 +01:00
crypto_aes256cbc.cpp fuzz: Link all targets once 2020-12-10 07:15:42 +01:00
crypto_chacha20.cpp fuzz: Introduce CallOneOf helper to replace switch-case 2021-01-11 10:37:16 +01:00
crypto_chacha20_poly1305_aead.cpp fuzz: Avoid -fsanitize=integer warnings in fuzzing harnesses 2021-01-25 20:55:36 +00:00
crypto_common.cpp fuzz: Link all targets once 2020-12-10 07:15:42 +01:00
crypto_hkdf_hmac_sha256_l32.cpp fuzz: Link all targets once 2020-12-10 07:15:42 +01:00
crypto_poly1305.cpp fuzz: Link all targets once 2020-12-10 07:15:42 +01:00
cuckoocache.cpp fuzz: Link all targets once 2020-12-10 07:15:42 +01:00
danger_link_all.sh build: Add option --enable-danger-fuzz-link-all 2020-12-14 16:55:56 +01:00
data_stream.cpp fuzz: Consolidate fuzzing TestingSetup initialization 2021-01-21 09:29:42 -05:00
decode_tx.cpp scripted-diff: Bump copyright headers 2020-12-31 09:45:41 +01:00
descriptor_parse.cpp fuzz: Link all targets once 2020-12-10 07:15:42 +01:00
deserialize.cpp fuzz: Avoid extraneous copy of input data, using Span<> 2021-02-03 19:30:14 +01:00
eval_script.cpp fuzz: Link all targets once 2020-12-10 07:15:42 +01:00
fee_rate.cpp fuzz: Link all targets once 2020-12-10 07:15:42 +01:00
fees.cpp fuzz: Link all targets once 2020-12-10 07:15:42 +01:00
flatfile.cpp fuzz: Link all targets once 2020-12-10 07:15:42 +01:00
float.cpp fuzz: Link all targets once 2020-12-10 07:15:42 +01:00
fuzz.cpp fuzz: Hide script_assets_test_minimizer 2021-02-08 10:11:59 +01:00
fuzz.h fuzz: Hide script_assets_test_minimizer 2021-02-08 10:11:59 +01:00
FuzzedDataProvider.h fuzz: Bump FuzzedDataProvider.h 2020-12-31 08:49:10 +01:00
golomb_rice.cpp fuzz: Link all targets once 2020-12-10 07:15:42 +01:00
hex.cpp fuzz: Link all targets once 2020-12-10 07:15:42 +01:00
http_request.cpp fuzz: Link all targets once 2020-12-10 07:15:42 +01:00
integer.cpp fuzz: Link all targets once 2020-12-10 07:15:42 +01:00
key.cpp fuzz: Link all targets once 2020-12-10 07:15:42 +01:00
key_io.cpp fuzz: Link all targets once 2020-12-10 07:15:42 +01:00
kitchen_sink.cpp refactor: Use C++17 std::array deduction for ALL_FEE_ESTIMATE_HORIZONS 2021-01-03 18:38:31 +01:00
load_external_block_file.cpp validation: Move LoadExternalBlockFile to CChainState 2021-01-28 14:15:26 -05:00
locale.cpp fuzz: Link all targets once 2020-12-10 07:15:42 +01:00
merkleblock.cpp fuzz: Introduce CallOneOf helper to replace switch-case 2021-01-11 10:37:16 +01:00
message.cpp fuzz: Link all targets once 2020-12-10 07:15:42 +01:00
muhash.cpp fuzz: Remove expensive and redundant muhash from crypto fuzz target 2021-02-15 14:39:08 +01:00
multiplication_overflow.cpp fuzz: Link all targets once 2020-12-10 07:15:42 +01:00
net.cpp fuzz: Consolidate fuzzing TestingSetup initialization 2021-01-21 09:29:42 -05:00
net_permissions.cpp fuzz: Add ConsumeWeakEnum helper, Extract ALL_NET_PERMISSION_FLAGS 2021-01-02 15:07:07 +01:00
netaddress.cpp test: Fix Windows cross build 2021-02-08 15:17:48 +02:00
node_eviction.cpp tests: Add fuzzing harness for node eviction logic 2020-12-16 13:00:47 +00:00
p2p_transport_deserializer.cpp scripted-diff: Bump copyright headers 2020-12-31 09:45:41 +01:00
parse_hd_keypath.cpp scripted-diff: Bump copyright headers 2020-12-31 09:45:41 +01:00
parse_iso8601.cpp scripted-diff: Bump copyright headers 2020-12-31 09:45:41 +01:00
parse_numbers.cpp scripted-diff: Bump copyright headers 2020-12-31 09:45:41 +01:00
parse_script.cpp scripted-diff: Bump copyright headers 2020-12-31 09:45:41 +01:00
parse_univalue.cpp fuzz: Link all targets once 2020-12-10 07:15:42 +01:00
policy_estimator.cpp fuzz: Consolidate fuzzing TestingSetup initialization 2021-01-21 09:29:42 -05:00
policy_estimator_io.cpp fuzz: Consolidate fuzzing TestingSetup initialization 2021-01-21 09:29:42 -05:00
pow.cpp fuzz: Avoid -fsanitize=integer warnings in fuzzing harnesses 2021-01-25 20:55:36 +00:00
prevector.cpp fuzz: Link all targets once 2020-12-10 07:15:42 +01:00
primitives_transaction.cpp fuzz: Link all targets once 2020-12-10 07:15:42 +01:00
process_message.cpp fuzz: version handshake 2021-02-11 12:45:57 +01:00
process_messages.cpp fuzz: version handshake 2021-02-11 12:45:57 +01:00
protocol.cpp fuzz: Link all targets once 2020-12-10 07:15:42 +01:00
psbt.cpp fuzz: Link all targets once 2020-12-10 07:15:42 +01:00
random.cpp fuzz: Link all targets once 2020-12-10 07:15:42 +01:00
rbf.cpp Merge #20560: fuzz: Link all targets once 2020-12-15 19:00:36 +01:00
rolling_bloom_filter.cpp fuzz: Introduce CallOneOf helper to replace switch-case 2021-01-11 10:37:16 +01:00
script.cpp fuzz: Avoid -fsanitize=integer warnings in fuzzing harnesses 2021-01-25 20:55:36 +00:00
script_assets_test_minimizer.cpp doc: Fixup docs in fuzz/script_assets_test_minimizer.cpp 2021-02-08 10:12:22 +01:00
script_bitcoin_consensus.cpp fuzz: Link all targets once 2020-12-10 07:15:42 +01:00
script_descriptor_cache.cpp fuzz: Link all targets once 2020-12-10 07:15:42 +01:00
script_flags.cpp fuzz: Link all targets once 2020-12-10 07:15:42 +01:00
script_interpreter.cpp fuzz: Link all targets once 2020-12-10 07:15:42 +01:00
script_ops.cpp fuzz: Introduce CallOneOf helper to replace switch-case 2021-01-11 10:37:16 +01:00
script_sigcache.cpp Merge #20560: fuzz: Link all targets once 2020-12-15 19:00:36 +01:00
script_sign.cpp fuzz: Link all targets once 2020-12-10 07:15:42 +01:00
scriptnum_ops.cpp fuzz: Introduce CallOneOf helper to replace switch-case 2021-01-11 10:37:16 +01:00
secp256k1_ec_seckey_import_export_der.cpp fuzz: Link all targets once 2020-12-10 07:15:42 +01:00
secp256k1_ecdsa_signature_parse_der_lax.cpp fuzz: Link all targets once 2020-12-10 07:15:42 +01:00
signature_checker.cpp fuzz: Link all targets once 2020-12-10 07:15:42 +01:00
signet.cpp fuzz: Consolidate fuzzing TestingSetup initialization 2021-01-21 09:29:42 -05:00
span.cpp fuzz: Link all targets once 2020-12-10 07:15:42 +01:00
spanparsing.cpp scripted-diff: Bump copyright headers 2020-12-31 09:45:41 +01:00
string.cpp Merge #19809: log: Prefix log messages with function name and source code location if -logsourcelocations is set 2021-02-18 14:37:51 +01:00
strprintf.cpp fuzz: Introduce CallOneOf helper to replace switch-case 2021-01-11 10:37:16 +01:00
system.cpp util: Add ArgsManager::GetCommand() and use it in bitcoin-wallet 2021-01-21 19:31:28 +01:00
timedata.cpp fuzz: Link all targets once 2020-12-10 07:15:42 +01:00
transaction.cpp Merge #20560: fuzz: Link all targets once 2020-12-15 19:00:36 +01:00
tx_in.cpp scripted-diff: Bump copyright headers 2020-12-31 09:45:41 +01:00
tx_out.cpp scripted-diff: Bump copyright headers 2020-12-31 09:45:41 +01:00
txrequest.cpp fuzz: Link all targets once 2020-12-10 07:15:42 +01:00
util.cpp fuzz: Avoid initializing version to less than MIN_PEER_PROTO_VERSION 2021-01-23 20:04:37 +01:00
util.h Merge #20464: refactor: Treat CDataStream bytes as uint8_t 2021-02-01 15:17:28 +01:00