This repository was archived by the owner on Nov 15, 2023. It is now read-only.

Runtime upgrade to make use of wasm tracing - #6401

Closed
mattrutherford wants to merge 95 commits into
masterfrom
wasm-tracing-runtime
Closed

Runtime upgrade to make use of wasm tracing#6401
mattrutherford wants to merge 95 commits into
masterfrom
wasm-tracing-runtime

Conversation

@mattrutherford

@mattrutherfordmattrutherford commented Jun 18, 2020

Copy link
Copy Markdown
Contributor

This PR brings the runtime changes that make use of the new host functions added in #6381 which provide the ability to profile/trace wasm execution. It is the second part of the split of #5826.

We should allow sufficient time for clients in the network to upgrade to a version incorporating #6381 before merging this PR.

  • Add --wasm-tracing CLI flag to enable tracing from wasm (disabled by default).
  • Used in conjunction with --tracing-targets (and optionally --tracing-receiver).
  • Add automatic tracing to decl_module functions in the runtime.

mattrutherfordand others added 30 commits April 27, 2020 07:51
Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
@mattrutherford

Copy link
Copy Markdown
ContributorAuthor
target/release/substrate --dev --validator --alice --tracing-targets pallet=trace --execution wasm --wasm-execution compiled --tracing-enable-wasm
2020-06-18 12:17:47.021 main WARN sc_cli::commands::run_cmd Running in --dev mode, RPC CORS has been disabled.
2020-06-18 12:17:47.021 main INFO sc_cli::runner Substrate Node
2020-06-18 12:17:47.021 main INFO sc_cli::runner ✌️ version 2.0.0-rc3-unknown-commit-x86_64-linux-gnu
2020-06-18 12:17:47.021 main INFO sc_cli::runner ❤️ by Parity Technologies <admin@parity.io>, 2017-2020
2020-06-18 12:17:47.021 main INFO sc_cli::runner 📋 Chain specification: Development
2020-06-18 12:17:47.021 main INFO sc_cli::runner 🏷 Node name: Alice
2020-06-18 12:17:47.021 main INFO sc_cli::runner 👤 Role: AUTHORITY
2020-06-18 12:17:47.021 main INFO sc_cli::runner 💾 Database: RocksDb at /mnt/ramdisk/1/chains/dev/db
2020-06-18 12:17:47.021 main INFO sc_cli::runner ⛓ Native runtime: node-253 (substrate-node-0.tx1.au10)
2020-06-18 12:17:47.069 main INFO staking 💸 new validator set of size 1 has been elected via ElectionCompute::OnChain for era 0
2020-06-18 12:17:47.074 main INFO sc_service::client::client 🔨 Initializing Genesis block/state (state: 0x2144…37fd, header-hash: 0xf043…d8a4)
2020-06-18 12:17:47.076 main INFO afg 👴 Loading GRANDPA authority set from genesis on what appears to be first startup.
2020-06-18 12:17:47.320 main INFO sc_consensus_slots ⏱ Loaded block-time = BabeGenesisConfiguration { slot_duration: 3000, epoch_length: 200, c: (1, 4), genesis_authorities: [(Public(d43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d (5GrwvaEF...)), 1)], randomness: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], allowed_slots: AllowedSlots::PrimaryAndSecondaryPlainSlots } milliseconds from genesis on first-launch
2020-06-18 12:17:47.320 main INFO babe 👶 Creating empty BABE epoch changes on what appears to be first startup.
2020-06-18 12:17:47.338 main INFO sc_service::builder 📦 Highest known block at #0
2020-06-18 12:17:47.338 main WARN sc_service::builder Using default protocol ID "sup" because none is configured in the chain specs
2020-06-18 12:17:47.338 main INFO sub-libp2p 🏷 Local node identity is: 12D3KooWKE5Y9orm344cBaACCtfEauWqhWSkfH4EeJempHw8vyFk (legacy representation: Qmev3nhkAsHjtEDYnLzbAT6ccpEfSpobXRx811UCrenjsv)
2020-06-18 12:17:47.363 tokio-runtime-worker INFO substrate_prometheus_endpoint::known_os 〽️ Prometheus server started at 127.0.0.1:9615
2020-06-18 12:17:47.364 main INFO babe 👶 Starting BABE Authorship worker
2020-06-18 12:17:48.008 tokio-runtime-worker INFO sc_basic_authorship::basic_authorship 🙌 Starting consensus session on top of parent 0xf04317ea2da9f656f55d4d981b613bc0fbb269e7c6e2d7aabf43e1c27846d8a4
2020-06-18 12:17:48.014 tokio-blocking-driver INFO sc_tracing pallet_scheduler: on_initialize, time: 11860, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.014 tokio-blocking-driver INFO sc_tracing pallet_society: on_initialize, time: 740, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.015 tokio-blocking-driver INFO sc_tracing pallet_randomness_collective_flip: on_initialize, time: 15540, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.015 tokio-blocking-driver INFO sc_tracing pallet_offences: on_initialize, time: 18380, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.015 tokio-blocking-driver INFO sc_tracing pallet_treasury: on_initialize, time: 860, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.015 tokio-blocking-driver INFO sc_tracing pallet_elections_phragmen: on_initialize, time: 400, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.015 tokio-blocking-driver INFO sc_tracing pallet_democracy: on_initialize, time: 15050, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.016 tokio-blocking-driver INFO sc_tracing pallet_session: on_initialize, time: 1204891, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.016 tokio-blocking-driver INFO sc_tracing pallet_staking: on_initialize, time: 20070, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.016 tokio-blocking-driver INFO sc_tracing pallet_authorship: on_initialize, time: 61111, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.016 tokio-blocking-driver INFO sc_tracing pallet_timestamp: on_initialize, time: 300, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.016 tokio-blocking-driver INFO sc_tracing pallet_babe: on_initialize, time: 3320, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.023 tokio-blocking-driver INFO sc_tracing pallet_scheduler: on_initialize, time: 6980, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.023 tokio-blocking-driver INFO sc_tracing pallet_society: on_initialize, time: 390, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.023 tokio-blocking-driver INFO sc_tracing pallet_randomness_collective_flip: on_initialize, time: 10430, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.023 tokio-blocking-driver INFO sc_tracing pallet_offences: on_initialize, time: 13720, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.023 tokio-blocking-driver INFO sc_tracing pallet_treasury: on_initialize, time: 400, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.023 tokio-blocking-driver INFO sc_tracing pallet_elections_phragmen: on_initialize, time: 280, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.024 tokio-blocking-driver INFO sc_tracing pallet_democracy: on_initialize, time: 11630, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.024 tokio-blocking-driver INFO sc_tracing pallet_session: on_initialize, time: 10050, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.024 tokio-blocking-driver INFO sc_tracing pallet_staking: on_initialize, time: 15160, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.024 tokio-blocking-driver INFO sc_tracing pallet_authorship: on_initialize, time: 39610, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.024 tokio-blocking-driver INFO sc_tracing pallet_timestamp: on_initialize, time: 290, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.024 tokio-blocking-driver INFO sc_tracing pallet_babe: on_initialize, time: 2971, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.031 tokio-blocking-driver INFO sc_tracing pallet_timestamp: set, time: 16260, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.036 tokio-blocking-driver INFO sc_tracing pallet_grandpa: on_finalize, time: 11250, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.036 tokio-blocking-driver INFO sc_tracing pallet_finality_tracker: on_finalize, time: 29200, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.036 tokio-blocking-driver INFO sc_tracing pallet_staking: on_finalize, time: 12680, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.036 tokio-blocking-driver INFO sc_tracing pallet_transaction_payment: on_finalize, time: 17161, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.036 tokio-blocking-driver INFO sc_tracing pallet_authorship: on_finalize, time: 3310, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.036 tokio-blocking-driver INFO sc_tracing pallet_timestamp: on_finalize, time: 3660, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.036 tokio-blocking-driver INFO sc_tracing pallet_babe: on_finalize, time: 22540, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.037 tokio-blocking-driver INFO sc_basic_authorship::basic_authorship 🎁 Prepared block for proposing at 1 [hash: 0xe063a05a9ec4ec7e54910332b5b271e53ea3805e23eed885ab0be3c2ec6cda91; parent_hash: 0xf043…d8a4; extrinsics (1): [0x8599…4ba1]]
2020-06-18 12:17:48.039 tokio-runtime-worker INFO sc_consensus_slots 🔖 Pre-sealed block for proposal at 1. Hash now 0x79bc5f5e982336ba03b57c2f984ef3e77acabb5c7e4d07612a2719865141b5cb, previously 0xe063a05a9ec4ec7e54910332b5b271e53ea3805e23eed885ab0be3c2ec6cda91.
2020-06-18 12:17:48.039 tokio-runtime-worker INFO babe 👶 New epoch 0 launching at block 0x79bc…b5cb (block slot 530826356 >= start slot 530826356).
2020-06-18 12:17:48.039 tokio-runtime-worker INFO babe 👶 Next epoch starts at slot 530826556
2020-06-18 12:17:48.039 tokio-runtime-worker INFO substrate ✨ Imported #1 (0x79bc…b5cb)
2020-06-18 12:17:51.002 tokio-runtime-worker INFO sc_basic_authorship::basic_authorship 🙌 Starting consensus session on top of parent 0x79bc5f5e982336ba03b57c2f984ef3e77acabb5c7e4d07612a2719865141b5cb
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_scheduler: on_initialize, time: 9450, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_society: on_initialize, time: 520, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_randomness_collective_flip: on_initialize, time: 12520, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_offences: on_initialize, time: 10041, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_treasury: on_initialize, time: 430, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_elections_phragmen: on_initialize, time: 380, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_democracy: on_initialize, time: 6910, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_session: on_initialize, time: 26720, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_staking: on_initialize, time: 9170, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_authorship: on_initialize, time: 36771, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_timestamp: on_initialize, time: 350, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_babe: on_initialize, time: 3350, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_scheduler: on_initialize, time: 4880, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_society: on_initialize, time: 400, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_randomness_collective_flip: on_initialize, time: 11080, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_offences: on_initialize, time: 9450, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_treasury: on_initialize, time: 370, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_elections_phragmen: on_initialize, time: 360, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_democracy: on_initialize, time: 6440, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_session: on_initialize, time: 15380, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_staking: on_initialize, time: 8750, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_authorship: on_initialize, time: 27451, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_timestamp: on_initialize, time: 390, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_babe: on_initialize, time: 3300, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_timestamp: set, time: 10570, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_grandpa: on_finalize, time: 5110, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_finality_tracker: on_finalize, time: 20280, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_staking: on_finalize, time: 3580, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_transaction_payment: on_finalize, time: 15880, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_authorship: on_finalize, time: 3850, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_timestamp: on_finalize, time: 3870, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_babe: on_finalize, time: 5530, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.003 tokio-blocking-driver INFO sc_basic_authorship::basic_authorship 🎁 Prepared block for proposing at 2 [hash: 0xbe4b4a0376b5e1e6cb6e1cdca345e45b6c663c8203c31a6dace6c441c7026463; parent_hash: 0x79bc…b5cb; extrinsics (1): [0x92a3…f0fd]]
2020-06-18 12:17:51.005 tokio-runtime-worker INFO sc_consensus_slots 🔖 Pre-sealed block for proposal at 2. Hash now 0xae660cc0dbe066cefef8b40a048a287580d59394d119bd4582d82b9f826ae7a6, previously 0xbe4b4a0376b5e1e6cb6e1cdca345e45b6c663c8203c31a6dace6c441c7026463.
2020-06-18 12:17:51.005 tokio-runtime-worker INFO substrate ✨ Imported #2 (0xae66…e7a6)

@mattrutherfordmattrutherford changed the title [ONICE] Wasm tracing runtime[ONICE] Runtime upgrade to make use of wasm tracingJun 18, 2020
@mattrutherfordmattrutherford added C1-low PR touches the given topic and has a low impact on builders. and removed A0-please_review Pull request needs code review. labels Jun 18, 2020
@bkchrbkchr mentioned this pull request Jul 3, 2020
@bkchr

bkchr commented Jul 7, 2020

Copy link
Copy Markdown
Member

Can you merge master? I think we should now be safe to merge this.

@mattrutherfordmattrutherford changed the title [ONICE] Runtime upgrade to make use of wasm tracingRuntime upgrade to make use of wasm tracingJul 7, 2020
@gnunicorngnunicorn added A0-please_review Pull request needs code review. and removed A1-onice labels Jul 7, 2020
@gnunicorn
gnunicorn requested review from bkchr and gnunicorn and removed request for bkchrJuly 7, 2020 15:49
@gnunicorngnunicorn added A1-onice and removed A0-please_review Pull request needs code review. labels Sep 9, 2020
@mattrutherford

Copy link
Copy Markdown
ContributorAuthor

Closing this, as it is now superseded by #6916

Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

C1-lowPR touches the given topic and has a low impact on builders.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@mattrutherford@bkchr@gnunicorn
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Add copy buttons to all
 blocks\n(function() {\n function addCopyButtons() {\n document.querySelectorAll('pre code').forEach(function(codeBlock) {\n if (codeBlock.parentElement.hasAttribute('data-copy-added')) return;\n codeBlock.parentElement.setAttribute('data-copy-added', 'true');\n \n var btn = document.createElement('button');\n btn.textContent = 'Copy';\n btn.style.cssText = 'position:absolute;top:4px;right:4px;padding:2px 8px;font-size:11px;background:#4ecdc4;border:none;border-radius:4px;color:#1a1a2e;cursor:pointer;opacity:0.7;transition:opacity 0.2s;';\n btn.onmouseover = function() { this.style.opacity = '1'; };\n btn.onmouseout = function() { this.style.opacity = '0.7'; };\n btn.onclick = function() {\n navigator.clipboard.writeText(codeBlock.textContent).then(function() {\n btn.textContent = 'Copied!';\n setTimeout(function() { btn.textContent = 'Copy'; }, 1500);\n });\n };\n codeBlock.parentElement.style.position = 'relative';\n codeBlock.parentElement.appendChild(btn);\n });\n }\n \n addCopyButtons();\n \n // Re-run on dynamic content\n var observer = new MutationObserver(addCopyButtons);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Add Copy Buttons to Code Blocks");
}
} catch(__e) { console.warn('[Userscript:Add Copy Buttons to Code Blocks]', __e); }
})();
(function(){
try {
var __m = "github.com";
var __re = new RegExp('^' + "github\\.com" + '
Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.

Runtime upgrade to make use of wasm tracing - #6401

Closed
mattrutherford wants to merge 95 commits into
masterfrom
wasm-tracing-runtime
Closed

Runtime upgrade to make use of wasm tracing#6401
mattrutherford wants to merge 95 commits into
masterfrom
wasm-tracing-runtime

Conversation

@mattrutherford

@mattrutherfordmattrutherford commented Jun 18, 2020

Copy link
Copy Markdown
Contributor

This PR brings the runtime changes that make use of the new host functions added in #6381 which provide the ability to profile/trace wasm execution. It is the second part of the split of #5826.

We should allow sufficient time for clients in the network to upgrade to a version incorporating #6381 before merging this PR.

  • Add --wasm-tracing CLI flag to enable tracing from wasm (disabled by default).
  • Used in conjunction with --tracing-targets (and optionally --tracing-receiver).
  • Add automatic tracing to decl_module functions in the runtime.

mattrutherfordand others added 30 commits April 27, 2020 07:51
Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
@mattrutherford

Copy link
Copy Markdown
ContributorAuthor
target/release/substrate --dev --validator --alice --tracing-targets pallet=trace --execution wasm --wasm-execution compiled --tracing-enable-wasm
2020-06-18 12:17:47.021 main WARN sc_cli::commands::run_cmd Running in --dev mode, RPC CORS has been disabled.
2020-06-18 12:17:47.021 main INFO sc_cli::runner Substrate Node
2020-06-18 12:17:47.021 main INFO sc_cli::runner ✌️ version 2.0.0-rc3-unknown-commit-x86_64-linux-gnu
2020-06-18 12:17:47.021 main INFO sc_cli::runner ❤️ by Parity Technologies <admin@parity.io>, 2017-2020
2020-06-18 12:17:47.021 main INFO sc_cli::runner 📋 Chain specification: Development
2020-06-18 12:17:47.021 main INFO sc_cli::runner 🏷 Node name: Alice
2020-06-18 12:17:47.021 main INFO sc_cli::runner 👤 Role: AUTHORITY
2020-06-18 12:17:47.021 main INFO sc_cli::runner 💾 Database: RocksDb at /mnt/ramdisk/1/chains/dev/db
2020-06-18 12:17:47.021 main INFO sc_cli::runner ⛓ Native runtime: node-253 (substrate-node-0.tx1.au10)
2020-06-18 12:17:47.069 main INFO staking 💸 new validator set of size 1 has been elected via ElectionCompute::OnChain for era 0
2020-06-18 12:17:47.074 main INFO sc_service::client::client 🔨 Initializing Genesis block/state (state: 0x2144…37fd, header-hash: 0xf043…d8a4)
2020-06-18 12:17:47.076 main INFO afg 👴 Loading GRANDPA authority set from genesis on what appears to be first startup.
2020-06-18 12:17:47.320 main INFO sc_consensus_slots ⏱ Loaded block-time = BabeGenesisConfiguration { slot_duration: 3000, epoch_length: 200, c: (1, 4), genesis_authorities: [(Public(d43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d (5GrwvaEF...)), 1)], randomness: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], allowed_slots: AllowedSlots::PrimaryAndSecondaryPlainSlots } milliseconds from genesis on first-launch
2020-06-18 12:17:47.320 main INFO babe 👶 Creating empty BABE epoch changes on what appears to be first startup.
2020-06-18 12:17:47.338 main INFO sc_service::builder 📦 Highest known block at #0
2020-06-18 12:17:47.338 main WARN sc_service::builder Using default protocol ID "sup" because none is configured in the chain specs
2020-06-18 12:17:47.338 main INFO sub-libp2p 🏷 Local node identity is: 12D3KooWKE5Y9orm344cBaACCtfEauWqhWSkfH4EeJempHw8vyFk (legacy representation: Qmev3nhkAsHjtEDYnLzbAT6ccpEfSpobXRx811UCrenjsv)
2020-06-18 12:17:47.363 tokio-runtime-worker INFO substrate_prometheus_endpoint::known_os 〽️ Prometheus server started at 127.0.0.1:9615
2020-06-18 12:17:47.364 main INFO babe 👶 Starting BABE Authorship worker
2020-06-18 12:17:48.008 tokio-runtime-worker INFO sc_basic_authorship::basic_authorship 🙌 Starting consensus session on top of parent 0xf04317ea2da9f656f55d4d981b613bc0fbb269e7c6e2d7aabf43e1c27846d8a4
2020-06-18 12:17:48.014 tokio-blocking-driver INFO sc_tracing pallet_scheduler: on_initialize, time: 11860, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.014 tokio-blocking-driver INFO sc_tracing pallet_society: on_initialize, time: 740, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.015 tokio-blocking-driver INFO sc_tracing pallet_randomness_collective_flip: on_initialize, time: 15540, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.015 tokio-blocking-driver INFO sc_tracing pallet_offences: on_initialize, time: 18380, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.015 tokio-blocking-driver INFO sc_tracing pallet_treasury: on_initialize, time: 860, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.015 tokio-blocking-driver INFO sc_tracing pallet_elections_phragmen: on_initialize, time: 400, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.015 tokio-blocking-driver INFO sc_tracing pallet_democracy: on_initialize, time: 15050, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.016 tokio-blocking-driver INFO sc_tracing pallet_session: on_initialize, time: 1204891, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.016 tokio-blocking-driver INFO sc_tracing pallet_staking: on_initialize, time: 20070, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.016 tokio-blocking-driver INFO sc_tracing pallet_authorship: on_initialize, time: 61111, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.016 tokio-blocking-driver INFO sc_tracing pallet_timestamp: on_initialize, time: 300, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.016 tokio-blocking-driver INFO sc_tracing pallet_babe: on_initialize, time: 3320, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.023 tokio-blocking-driver INFO sc_tracing pallet_scheduler: on_initialize, time: 6980, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.023 tokio-blocking-driver INFO sc_tracing pallet_society: on_initialize, time: 390, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.023 tokio-blocking-driver INFO sc_tracing pallet_randomness_collective_flip: on_initialize, time: 10430, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.023 tokio-blocking-driver INFO sc_tracing pallet_offences: on_initialize, time: 13720, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.023 tokio-blocking-driver INFO sc_tracing pallet_treasury: on_initialize, time: 400, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.023 tokio-blocking-driver INFO sc_tracing pallet_elections_phragmen: on_initialize, time: 280, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.024 tokio-blocking-driver INFO sc_tracing pallet_democracy: on_initialize, time: 11630, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.024 tokio-blocking-driver INFO sc_tracing pallet_session: on_initialize, time: 10050, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.024 tokio-blocking-driver INFO sc_tracing pallet_staking: on_initialize, time: 15160, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.024 tokio-blocking-driver INFO sc_tracing pallet_authorship: on_initialize, time: 39610, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.024 tokio-blocking-driver INFO sc_tracing pallet_timestamp: on_initialize, time: 290, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.024 tokio-blocking-driver INFO sc_tracing pallet_babe: on_initialize, time: 2971, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.031 tokio-blocking-driver INFO sc_tracing pallet_timestamp: set, time: 16260, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.036 tokio-blocking-driver INFO sc_tracing pallet_grandpa: on_finalize, time: 11250, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.036 tokio-blocking-driver INFO sc_tracing pallet_finality_tracker: on_finalize, time: 29200, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.036 tokio-blocking-driver INFO sc_tracing pallet_staking: on_finalize, time: 12680, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.036 tokio-blocking-driver INFO sc_tracing pallet_transaction_payment: on_finalize, time: 17161, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.036 tokio-blocking-driver INFO sc_tracing pallet_authorship: on_finalize, time: 3310, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.036 tokio-blocking-driver INFO sc_tracing pallet_timestamp: on_finalize, time: 3660, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.036 tokio-blocking-driver INFO sc_tracing pallet_babe: on_finalize, time: 22540, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.037 tokio-blocking-driver INFO sc_basic_authorship::basic_authorship 🎁 Prepared block for proposing at 1 [hash: 0xe063a05a9ec4ec7e54910332b5b271e53ea3805e23eed885ab0be3c2ec6cda91; parent_hash: 0xf043…d8a4; extrinsics (1): [0x8599…4ba1]]
2020-06-18 12:17:48.039 tokio-runtime-worker INFO sc_consensus_slots 🔖 Pre-sealed block for proposal at 1. Hash now 0x79bc5f5e982336ba03b57c2f984ef3e77acabb5c7e4d07612a2719865141b5cb, previously 0xe063a05a9ec4ec7e54910332b5b271e53ea3805e23eed885ab0be3c2ec6cda91.
2020-06-18 12:17:48.039 tokio-runtime-worker INFO babe 👶 New epoch 0 launching at block 0x79bc…b5cb (block slot 530826356 >= start slot 530826356).
2020-06-18 12:17:48.039 tokio-runtime-worker INFO babe 👶 Next epoch starts at slot 530826556
2020-06-18 12:17:48.039 tokio-runtime-worker INFO substrate ✨ Imported #1 (0x79bc…b5cb)
2020-06-18 12:17:51.002 tokio-runtime-worker INFO sc_basic_authorship::basic_authorship 🙌 Starting consensus session on top of parent 0x79bc5f5e982336ba03b57c2f984ef3e77acabb5c7e4d07612a2719865141b5cb
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_scheduler: on_initialize, time: 9450, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_society: on_initialize, time: 520, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_randomness_collective_flip: on_initialize, time: 12520, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_offences: on_initialize, time: 10041, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_treasury: on_initialize, time: 430, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_elections_phragmen: on_initialize, time: 380, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_democracy: on_initialize, time: 6910, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_session: on_initialize, time: 26720, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_staking: on_initialize, time: 9170, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_authorship: on_initialize, time: 36771, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_timestamp: on_initialize, time: 350, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_babe: on_initialize, time: 3350, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_scheduler: on_initialize, time: 4880, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_society: on_initialize, time: 400, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_randomness_collective_flip: on_initialize, time: 11080, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_offences: on_initialize, time: 9450, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_treasury: on_initialize, time: 370, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_elections_phragmen: on_initialize, time: 360, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_democracy: on_initialize, time: 6440, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_session: on_initialize, time: 15380, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_staking: on_initialize, time: 8750, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_authorship: on_initialize, time: 27451, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_timestamp: on_initialize, time: 390, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_babe: on_initialize, time: 3300, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_timestamp: set, time: 10570, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_grandpa: on_finalize, time: 5110, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_finality_tracker: on_finalize, time: 20280, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_staking: on_finalize, time: 3580, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_transaction_payment: on_finalize, time: 15880, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_authorship: on_finalize, time: 3850, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_timestamp: on_finalize, time: 3870, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_babe: on_finalize, time: 5530, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.003 tokio-blocking-driver INFO sc_basic_authorship::basic_authorship 🎁 Prepared block for proposing at 2 [hash: 0xbe4b4a0376b5e1e6cb6e1cdca345e45b6c663c8203c31a6dace6c441c7026463; parent_hash: 0x79bc…b5cb; extrinsics (1): [0x92a3…f0fd]]
2020-06-18 12:17:51.005 tokio-runtime-worker INFO sc_consensus_slots 🔖 Pre-sealed block for proposal at 2. Hash now 0xae660cc0dbe066cefef8b40a048a287580d59394d119bd4582d82b9f826ae7a6, previously 0xbe4b4a0376b5e1e6cb6e1cdca345e45b6c663c8203c31a6dace6c441c7026463.
2020-06-18 12:17:51.005 tokio-runtime-worker INFO substrate ✨ Imported #2 (0xae66…e7a6)

@mattrutherfordmattrutherford changed the title [ONICE] Wasm tracing runtime[ONICE] Runtime upgrade to make use of wasm tracingJun 18, 2020
@mattrutherfordmattrutherford added C1-low PR touches the given topic and has a low impact on builders. and removed A0-please_review Pull request needs code review. labels Jun 18, 2020
@bkchrbkchr mentioned this pull request Jul 3, 2020
@bkchr

bkchr commented Jul 7, 2020

Copy link
Copy Markdown
Member

Can you merge master? I think we should now be safe to merge this.

@mattrutherfordmattrutherford changed the title [ONICE] Runtime upgrade to make use of wasm tracingRuntime upgrade to make use of wasm tracingJul 7, 2020
@gnunicorngnunicorn added A0-please_review Pull request needs code review. and removed A1-onice labels Jul 7, 2020
@gnunicorn
gnunicorn requested review from bkchr and gnunicorn and removed request for bkchrJuly 7, 2020 15:49
@gnunicorngnunicorn added A1-onice and removed A0-please_review Pull request needs code review. labels Sep 9, 2020
@mattrutherford

Copy link
Copy Markdown
ContributorAuthor

Closing this, as it is now superseded by #6916

Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

C1-lowPR touches the given topic and has a low impact on builders.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@mattrutherford@bkchr@gnunicorn
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Force GitHub README to respect dark mode\n(function() {\n var style = document.createElement('style');\n style.textContent = '\n .markdown-body {\n color-scheme: dark light;\n }\n .markdown-body pre { background: #161b22 !important; }\n .markdown-body code { background: rgba(110, 118, 129, 0.4) !important; }\n .markdown-body table th, .markdown-body table td { border-color: #30363d !important; }\n .markdown-body img { background: #0d1117; }\n .markdown-body blockquote { border-left-color: #8b949e; }\n .markdown-body hr { border-color: #30363d; }\n ';\n document.head.appendChild(style);\n})();", "GitHub Dark Mode README Fix"); } } catch(__e) { console.warn('[Userscript:GitHub Dark Mode README Fix]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.

Runtime upgrade to make use of wasm tracing - #6401

Closed
mattrutherford wants to merge 95 commits into
masterfrom
wasm-tracing-runtime
Closed

Runtime upgrade to make use of wasm tracing#6401
mattrutherford wants to merge 95 commits into
masterfrom
wasm-tracing-runtime

Conversation

@mattrutherford

@mattrutherfordmattrutherford commented Jun 18, 2020

Copy link
Copy Markdown
Contributor

This PR brings the runtime changes that make use of the new host functions added in #6381 which provide the ability to profile/trace wasm execution. It is the second part of the split of #5826.

We should allow sufficient time for clients in the network to upgrade to a version incorporating #6381 before merging this PR.

  • Add --wasm-tracing CLI flag to enable tracing from wasm (disabled by default).
  • Used in conjunction with --tracing-targets (and optionally --tracing-receiver).
  • Add automatic tracing to decl_module functions in the runtime.

mattrutherfordand others added 30 commits April 27, 2020 07:51
Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
@mattrutherford

Copy link
Copy Markdown
ContributorAuthor
target/release/substrate --dev --validator --alice --tracing-targets pallet=trace --execution wasm --wasm-execution compiled --tracing-enable-wasm
2020-06-18 12:17:47.021 main WARN sc_cli::commands::run_cmd Running in --dev mode, RPC CORS has been disabled.
2020-06-18 12:17:47.021 main INFO sc_cli::runner Substrate Node
2020-06-18 12:17:47.021 main INFO sc_cli::runner ✌️ version 2.0.0-rc3-unknown-commit-x86_64-linux-gnu
2020-06-18 12:17:47.021 main INFO sc_cli::runner ❤️ by Parity Technologies <admin@parity.io>, 2017-2020
2020-06-18 12:17:47.021 main INFO sc_cli::runner 📋 Chain specification: Development
2020-06-18 12:17:47.021 main INFO sc_cli::runner 🏷 Node name: Alice
2020-06-18 12:17:47.021 main INFO sc_cli::runner 👤 Role: AUTHORITY
2020-06-18 12:17:47.021 main INFO sc_cli::runner 💾 Database: RocksDb at /mnt/ramdisk/1/chains/dev/db
2020-06-18 12:17:47.021 main INFO sc_cli::runner ⛓ Native runtime: node-253 (substrate-node-0.tx1.au10)
2020-06-18 12:17:47.069 main INFO staking 💸 new validator set of size 1 has been elected via ElectionCompute::OnChain for era 0
2020-06-18 12:17:47.074 main INFO sc_service::client::client 🔨 Initializing Genesis block/state (state: 0x2144…37fd, header-hash: 0xf043…d8a4)
2020-06-18 12:17:47.076 main INFO afg 👴 Loading GRANDPA authority set from genesis on what appears to be first startup.
2020-06-18 12:17:47.320 main INFO sc_consensus_slots ⏱ Loaded block-time = BabeGenesisConfiguration { slot_duration: 3000, epoch_length: 200, c: (1, 4), genesis_authorities: [(Public(d43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d (5GrwvaEF...)), 1)], randomness: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], allowed_slots: AllowedSlots::PrimaryAndSecondaryPlainSlots } milliseconds from genesis on first-launch
2020-06-18 12:17:47.320 main INFO babe 👶 Creating empty BABE epoch changes on what appears to be first startup.
2020-06-18 12:17:47.338 main INFO sc_service::builder 📦 Highest known block at #0
2020-06-18 12:17:47.338 main WARN sc_service::builder Using default protocol ID "sup" because none is configured in the chain specs
2020-06-18 12:17:47.338 main INFO sub-libp2p 🏷 Local node identity is: 12D3KooWKE5Y9orm344cBaACCtfEauWqhWSkfH4EeJempHw8vyFk (legacy representation: Qmev3nhkAsHjtEDYnLzbAT6ccpEfSpobXRx811UCrenjsv)
2020-06-18 12:17:47.363 tokio-runtime-worker INFO substrate_prometheus_endpoint::known_os 〽️ Prometheus server started at 127.0.0.1:9615
2020-06-18 12:17:47.364 main INFO babe 👶 Starting BABE Authorship worker
2020-06-18 12:17:48.008 tokio-runtime-worker INFO sc_basic_authorship::basic_authorship 🙌 Starting consensus session on top of parent 0xf04317ea2da9f656f55d4d981b613bc0fbb269e7c6e2d7aabf43e1c27846d8a4
2020-06-18 12:17:48.014 tokio-blocking-driver INFO sc_tracing pallet_scheduler: on_initialize, time: 11860, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.014 tokio-blocking-driver INFO sc_tracing pallet_society: on_initialize, time: 740, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.015 tokio-blocking-driver INFO sc_tracing pallet_randomness_collective_flip: on_initialize, time: 15540, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.015 tokio-blocking-driver INFO sc_tracing pallet_offences: on_initialize, time: 18380, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.015 tokio-blocking-driver INFO sc_tracing pallet_treasury: on_initialize, time: 860, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.015 tokio-blocking-driver INFO sc_tracing pallet_elections_phragmen: on_initialize, time: 400, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.015 tokio-blocking-driver INFO sc_tracing pallet_democracy: on_initialize, time: 15050, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.016 tokio-blocking-driver INFO sc_tracing pallet_session: on_initialize, time: 1204891, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.016 tokio-blocking-driver INFO sc_tracing pallet_staking: on_initialize, time: 20070, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.016 tokio-blocking-driver INFO sc_tracing pallet_authorship: on_initialize, time: 61111, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.016 tokio-blocking-driver INFO sc_tracing pallet_timestamp: on_initialize, time: 300, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.016 tokio-blocking-driver INFO sc_tracing pallet_babe: on_initialize, time: 3320, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.023 tokio-blocking-driver INFO sc_tracing pallet_scheduler: on_initialize, time: 6980, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.023 tokio-blocking-driver INFO sc_tracing pallet_society: on_initialize, time: 390, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.023 tokio-blocking-driver INFO sc_tracing pallet_randomness_collective_flip: on_initialize, time: 10430, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.023 tokio-blocking-driver INFO sc_tracing pallet_offences: on_initialize, time: 13720, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.023 tokio-blocking-driver INFO sc_tracing pallet_treasury: on_initialize, time: 400, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.023 tokio-blocking-driver INFO sc_tracing pallet_elections_phragmen: on_initialize, time: 280, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.024 tokio-blocking-driver INFO sc_tracing pallet_democracy: on_initialize, time: 11630, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.024 tokio-blocking-driver INFO sc_tracing pallet_session: on_initialize, time: 10050, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.024 tokio-blocking-driver INFO sc_tracing pallet_staking: on_initialize, time: 15160, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.024 tokio-blocking-driver INFO sc_tracing pallet_authorship: on_initialize, time: 39610, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.024 tokio-blocking-driver INFO sc_tracing pallet_timestamp: on_initialize, time: 290, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.024 tokio-blocking-driver INFO sc_tracing pallet_babe: on_initialize, time: 2971, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.031 tokio-blocking-driver INFO sc_tracing pallet_timestamp: set, time: 16260, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.036 tokio-blocking-driver INFO sc_tracing pallet_grandpa: on_finalize, time: 11250, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.036 tokio-blocking-driver INFO sc_tracing pallet_finality_tracker: on_finalize, time: 29200, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.036 tokio-blocking-driver INFO sc_tracing pallet_staking: on_finalize, time: 12680, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.036 tokio-blocking-driver INFO sc_tracing pallet_transaction_payment: on_finalize, time: 17161, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.036 tokio-blocking-driver INFO sc_tracing pallet_authorship: on_finalize, time: 3310, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.036 tokio-blocking-driver INFO sc_tracing pallet_timestamp: on_finalize, time: 3660, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.036 tokio-blocking-driver INFO sc_tracing pallet_babe: on_finalize, time: 22540, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.037 tokio-blocking-driver INFO sc_basic_authorship::basic_authorship 🎁 Prepared block for proposing at 1 [hash: 0xe063a05a9ec4ec7e54910332b5b271e53ea3805e23eed885ab0be3c2ec6cda91; parent_hash: 0xf043…d8a4; extrinsics (1): [0x8599…4ba1]]
2020-06-18 12:17:48.039 tokio-runtime-worker INFO sc_consensus_slots 🔖 Pre-sealed block for proposal at 1. Hash now 0x79bc5f5e982336ba03b57c2f984ef3e77acabb5c7e4d07612a2719865141b5cb, previously 0xe063a05a9ec4ec7e54910332b5b271e53ea3805e23eed885ab0be3c2ec6cda91.
2020-06-18 12:17:48.039 tokio-runtime-worker INFO babe 👶 New epoch 0 launching at block 0x79bc…b5cb (block slot 530826356 >= start slot 530826356).
2020-06-18 12:17:48.039 tokio-runtime-worker INFO babe 👶 Next epoch starts at slot 530826556
2020-06-18 12:17:48.039 tokio-runtime-worker INFO substrate ✨ Imported #1 (0x79bc…b5cb)
2020-06-18 12:17:51.002 tokio-runtime-worker INFO sc_basic_authorship::basic_authorship 🙌 Starting consensus session on top of parent 0x79bc5f5e982336ba03b57c2f984ef3e77acabb5c7e4d07612a2719865141b5cb
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_scheduler: on_initialize, time: 9450, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_society: on_initialize, time: 520, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_randomness_collective_flip: on_initialize, time: 12520, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_offences: on_initialize, time: 10041, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_treasury: on_initialize, time: 430, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_elections_phragmen: on_initialize, time: 380, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_democracy: on_initialize, time: 6910, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_session: on_initialize, time: 26720, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_staking: on_initialize, time: 9170, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_authorship: on_initialize, time: 36771, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_timestamp: on_initialize, time: 350, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_babe: on_initialize, time: 3350, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_scheduler: on_initialize, time: 4880, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_society: on_initialize, time: 400, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_randomness_collective_flip: on_initialize, time: 11080, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_offences: on_initialize, time: 9450, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_treasury: on_initialize, time: 370, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_elections_phragmen: on_initialize, time: 360, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_democracy: on_initialize, time: 6440, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_session: on_initialize, time: 15380, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_staking: on_initialize, time: 8750, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_authorship: on_initialize, time: 27451, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_timestamp: on_initialize, time: 390, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_babe: on_initialize, time: 3300, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_timestamp: set, time: 10570, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_grandpa: on_finalize, time: 5110, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_finality_tracker: on_finalize, time: 20280, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_staking: on_finalize, time: 3580, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_transaction_payment: on_finalize, time: 15880, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_authorship: on_finalize, time: 3850, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_timestamp: on_finalize, time: 3870, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_babe: on_finalize, time: 5530, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.003 tokio-blocking-driver INFO sc_basic_authorship::basic_authorship 🎁 Prepared block for proposing at 2 [hash: 0xbe4b4a0376b5e1e6cb6e1cdca345e45b6c663c8203c31a6dace6c441c7026463; parent_hash: 0x79bc…b5cb; extrinsics (1): [0x92a3…f0fd]]
2020-06-18 12:17:51.005 tokio-runtime-worker INFO sc_consensus_slots 🔖 Pre-sealed block for proposal at 2. Hash now 0xae660cc0dbe066cefef8b40a048a287580d59394d119bd4582d82b9f826ae7a6, previously 0xbe4b4a0376b5e1e6cb6e1cdca345e45b6c663c8203c31a6dace6c441c7026463.
2020-06-18 12:17:51.005 tokio-runtime-worker INFO substrate ✨ Imported #2 (0xae66…e7a6)

@mattrutherfordmattrutherford changed the title [ONICE] Wasm tracing runtime[ONICE] Runtime upgrade to make use of wasm tracingJun 18, 2020
@mattrutherfordmattrutherford added C1-low PR touches the given topic and has a low impact on builders. and removed A0-please_review Pull request needs code review. labels Jun 18, 2020
@bkchrbkchr mentioned this pull request Jul 3, 2020
@bkchr

bkchr commented Jul 7, 2020

Copy link
Copy Markdown
Member

Can you merge master? I think we should now be safe to merge this.

@mattrutherfordmattrutherford changed the title [ONICE] Runtime upgrade to make use of wasm tracingRuntime upgrade to make use of wasm tracingJul 7, 2020
@gnunicorngnunicorn added A0-please_review Pull request needs code review. and removed A1-onice labels Jul 7, 2020
@gnunicorn
gnunicorn requested review from bkchr and gnunicorn and removed request for bkchrJuly 7, 2020 15:49
@gnunicorngnunicorn added A1-onice and removed A0-please_review Pull request needs code review. labels Sep 9, 2020
@mattrutherford

Copy link
Copy Markdown
ContributorAuthor

Closing this, as it is now superseded by #6916

Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

C1-lowPR touches the given topic and has a low impact on builders.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@mattrutherford@bkchr@gnunicorn
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Highlight search terms from Google/DuckDuckGo/Bing referrer\n(function() {\n var ref = document.referrer;\n var terms = [];\n \n if (ref.includes('google.com') || ref.includes('duckduckgo.com') || ref.includes('bing.com')) {\n var url = new URL(ref);\n var q = url.searchParams.get('q') || url.searchParams.get('p');\n if (q) {\n terms = q.split(/\\s+/).filter(function(t) { return t.length > 2; });\n }\n }\n \n if (terms.length === 0) return;\n \n var style = document.createElement('style');\n style.textContent = '.userscript-highlight { background: #fbbf24; color: #1a1a2e; padding: 1px 3px; border-radius: 2px; }';\n document.head.appendChild(style);\n \n function highlight(node) {\n if (node.nodeType === 3) { // text node\n var text = node.textContent;\n var found = false;\n terms.forEach(function(term) {\n var regex = new RegExp('(' + term.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\') + ')', 'gi');\n if (regex.test(text)) {\n found = true;\n var frag = document.createDocumentFragment();\n var parts = text.split(regex);\n parts.forEach(function(part, i) {\n if (i % 2 === 0) {\n frag.appendChild(document.createTextNode(part));\n } else {\n var span = document.createElement('span');\n span.className = 'userscript-highlight';\n span.textContent = part;\n frag.appendChild(span);\n }\n });\n node.parentNode.replaceChild(frag, node);\n }\n });\n } else if (node.nodeType === 1 && node.childNodes) { // element\n var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT'];\n if (!skipTags.includes(node.tagName)) {\n Array.from(node.childNodes).forEach(highlight);\n }\n }\n }\n \n highlight(document.body);\n \n // Re-highlight on dynamic content\n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1 || node.nodeType === 3) highlight(node);\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Highlight Search Terms"); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.

Runtime upgrade to make use of wasm tracing - #6401

Closed
mattrutherford wants to merge 95 commits into
masterfrom
wasm-tracing-runtime
Closed

Runtime upgrade to make use of wasm tracing#6401
mattrutherford wants to merge 95 commits into
masterfrom
wasm-tracing-runtime

Conversation

@mattrutherford

@mattrutherfordmattrutherford commented Jun 18, 2020

Copy link
Copy Markdown
Contributor

This PR brings the runtime changes that make use of the new host functions added in #6381 which provide the ability to profile/trace wasm execution. It is the second part of the split of #5826.

We should allow sufficient time for clients in the network to upgrade to a version incorporating #6381 before merging this PR.

  • Add --wasm-tracing CLI flag to enable tracing from wasm (disabled by default).
  • Used in conjunction with --tracing-targets (and optionally --tracing-receiver).
  • Add automatic tracing to decl_module functions in the runtime.

mattrutherfordand others added 30 commits April 27, 2020 07:51
Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
@mattrutherford

Copy link
Copy Markdown
ContributorAuthor
target/release/substrate --dev --validator --alice --tracing-targets pallet=trace --execution wasm --wasm-execution compiled --tracing-enable-wasm
2020-06-18 12:17:47.021 main WARN sc_cli::commands::run_cmd Running in --dev mode, RPC CORS has been disabled.
2020-06-18 12:17:47.021 main INFO sc_cli::runner Substrate Node
2020-06-18 12:17:47.021 main INFO sc_cli::runner ✌️ version 2.0.0-rc3-unknown-commit-x86_64-linux-gnu
2020-06-18 12:17:47.021 main INFO sc_cli::runner ❤️ by Parity Technologies <admin@parity.io>, 2017-2020
2020-06-18 12:17:47.021 main INFO sc_cli::runner 📋 Chain specification: Development
2020-06-18 12:17:47.021 main INFO sc_cli::runner 🏷 Node name: Alice
2020-06-18 12:17:47.021 main INFO sc_cli::runner 👤 Role: AUTHORITY
2020-06-18 12:17:47.021 main INFO sc_cli::runner 💾 Database: RocksDb at /mnt/ramdisk/1/chains/dev/db
2020-06-18 12:17:47.021 main INFO sc_cli::runner ⛓ Native runtime: node-253 (substrate-node-0.tx1.au10)
2020-06-18 12:17:47.069 main INFO staking 💸 new validator set of size 1 has been elected via ElectionCompute::OnChain for era 0
2020-06-18 12:17:47.074 main INFO sc_service::client::client 🔨 Initializing Genesis block/state (state: 0x2144…37fd, header-hash: 0xf043…d8a4)
2020-06-18 12:17:47.076 main INFO afg 👴 Loading GRANDPA authority set from genesis on what appears to be first startup.
2020-06-18 12:17:47.320 main INFO sc_consensus_slots ⏱ Loaded block-time = BabeGenesisConfiguration { slot_duration: 3000, epoch_length: 200, c: (1, 4), genesis_authorities: [(Public(d43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d (5GrwvaEF...)), 1)], randomness: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], allowed_slots: AllowedSlots::PrimaryAndSecondaryPlainSlots } milliseconds from genesis on first-launch
2020-06-18 12:17:47.320 main INFO babe 👶 Creating empty BABE epoch changes on what appears to be first startup.
2020-06-18 12:17:47.338 main INFO sc_service::builder 📦 Highest known block at #0
2020-06-18 12:17:47.338 main WARN sc_service::builder Using default protocol ID "sup" because none is configured in the chain specs
2020-06-18 12:17:47.338 main INFO sub-libp2p 🏷 Local node identity is: 12D3KooWKE5Y9orm344cBaACCtfEauWqhWSkfH4EeJempHw8vyFk (legacy representation: Qmev3nhkAsHjtEDYnLzbAT6ccpEfSpobXRx811UCrenjsv)
2020-06-18 12:17:47.363 tokio-runtime-worker INFO substrate_prometheus_endpoint::known_os 〽️ Prometheus server started at 127.0.0.1:9615
2020-06-18 12:17:47.364 main INFO babe 👶 Starting BABE Authorship worker
2020-06-18 12:17:48.008 tokio-runtime-worker INFO sc_basic_authorship::basic_authorship 🙌 Starting consensus session on top of parent 0xf04317ea2da9f656f55d4d981b613bc0fbb269e7c6e2d7aabf43e1c27846d8a4
2020-06-18 12:17:48.014 tokio-blocking-driver INFO sc_tracing pallet_scheduler: on_initialize, time: 11860, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.014 tokio-blocking-driver INFO sc_tracing pallet_society: on_initialize, time: 740, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.015 tokio-blocking-driver INFO sc_tracing pallet_randomness_collective_flip: on_initialize, time: 15540, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.015 tokio-blocking-driver INFO sc_tracing pallet_offences: on_initialize, time: 18380, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.015 tokio-blocking-driver INFO sc_tracing pallet_treasury: on_initialize, time: 860, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.015 tokio-blocking-driver INFO sc_tracing pallet_elections_phragmen: on_initialize, time: 400, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.015 tokio-blocking-driver INFO sc_tracing pallet_democracy: on_initialize, time: 15050, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.016 tokio-blocking-driver INFO sc_tracing pallet_session: on_initialize, time: 1204891, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.016 tokio-blocking-driver INFO sc_tracing pallet_staking: on_initialize, time: 20070, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.016 tokio-blocking-driver INFO sc_tracing pallet_authorship: on_initialize, time: 61111, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.016 tokio-blocking-driver INFO sc_tracing pallet_timestamp: on_initialize, time: 300, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.016 tokio-blocking-driver INFO sc_tracing pallet_babe: on_initialize, time: 3320, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.023 tokio-blocking-driver INFO sc_tracing pallet_scheduler: on_initialize, time: 6980, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.023 tokio-blocking-driver INFO sc_tracing pallet_society: on_initialize, time: 390, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.023 tokio-blocking-driver INFO sc_tracing pallet_randomness_collective_flip: on_initialize, time: 10430, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.023 tokio-blocking-driver INFO sc_tracing pallet_offences: on_initialize, time: 13720, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.023 tokio-blocking-driver INFO sc_tracing pallet_treasury: on_initialize, time: 400, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.023 tokio-blocking-driver INFO sc_tracing pallet_elections_phragmen: on_initialize, time: 280, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.024 tokio-blocking-driver INFO sc_tracing pallet_democracy: on_initialize, time: 11630, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.024 tokio-blocking-driver INFO sc_tracing pallet_session: on_initialize, time: 10050, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.024 tokio-blocking-driver INFO sc_tracing pallet_staking: on_initialize, time: 15160, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.024 tokio-blocking-driver INFO sc_tracing pallet_authorship: on_initialize, time: 39610, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.024 tokio-blocking-driver INFO sc_tracing pallet_timestamp: on_initialize, time: 290, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.024 tokio-blocking-driver INFO sc_tracing pallet_babe: on_initialize, time: 2971, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.031 tokio-blocking-driver INFO sc_tracing pallet_timestamp: set, time: 16260, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.036 tokio-blocking-driver INFO sc_tracing pallet_grandpa: on_finalize, time: 11250, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.036 tokio-blocking-driver INFO sc_tracing pallet_finality_tracker: on_finalize, time: 29200, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.036 tokio-blocking-driver INFO sc_tracing pallet_staking: on_finalize, time: 12680, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.036 tokio-blocking-driver INFO sc_tracing pallet_transaction_payment: on_finalize, time: 17161, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.036 tokio-blocking-driver INFO sc_tracing pallet_authorship: on_finalize, time: 3310, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.036 tokio-blocking-driver INFO sc_tracing pallet_timestamp: on_finalize, time: 3660, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.036 tokio-blocking-driver INFO sc_tracing pallet_babe: on_finalize, time: 22540, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.037 tokio-blocking-driver INFO sc_basic_authorship::basic_authorship 🎁 Prepared block for proposing at 1 [hash: 0xe063a05a9ec4ec7e54910332b5b271e53ea3805e23eed885ab0be3c2ec6cda91; parent_hash: 0xf043…d8a4; extrinsics (1): [0x8599…4ba1]]
2020-06-18 12:17:48.039 tokio-runtime-worker INFO sc_consensus_slots 🔖 Pre-sealed block for proposal at 1. Hash now 0x79bc5f5e982336ba03b57c2f984ef3e77acabb5c7e4d07612a2719865141b5cb, previously 0xe063a05a9ec4ec7e54910332b5b271e53ea3805e23eed885ab0be3c2ec6cda91.
2020-06-18 12:17:48.039 tokio-runtime-worker INFO babe 👶 New epoch 0 launching at block 0x79bc…b5cb (block slot 530826356 >= start slot 530826356).
2020-06-18 12:17:48.039 tokio-runtime-worker INFO babe 👶 Next epoch starts at slot 530826556
2020-06-18 12:17:48.039 tokio-runtime-worker INFO substrate ✨ Imported #1 (0x79bc…b5cb)
2020-06-18 12:17:51.002 tokio-runtime-worker INFO sc_basic_authorship::basic_authorship 🙌 Starting consensus session on top of parent 0x79bc5f5e982336ba03b57c2f984ef3e77acabb5c7e4d07612a2719865141b5cb
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_scheduler: on_initialize, time: 9450, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_society: on_initialize, time: 520, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_randomness_collective_flip: on_initialize, time: 12520, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_offences: on_initialize, time: 10041, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_treasury: on_initialize, time: 430, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_elections_phragmen: on_initialize, time: 380, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_democracy: on_initialize, time: 6910, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_session: on_initialize, time: 26720, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_staking: on_initialize, time: 9170, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_authorship: on_initialize, time: 36771, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_timestamp: on_initialize, time: 350, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_babe: on_initialize, time: 3350, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_scheduler: on_initialize, time: 4880, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_society: on_initialize, time: 400, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_randomness_collective_flip: on_initialize, time: 11080, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_offences: on_initialize, time: 9450, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_treasury: on_initialize, time: 370, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_elections_phragmen: on_initialize, time: 360, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_democracy: on_initialize, time: 6440, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_session: on_initialize, time: 15380, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_staking: on_initialize, time: 8750, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_authorship: on_initialize, time: 27451, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_timestamp: on_initialize, time: 390, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_babe: on_initialize, time: 3300, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_timestamp: set, time: 10570, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_grandpa: on_finalize, time: 5110, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_finality_tracker: on_finalize, time: 20280, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_staking: on_finalize, time: 3580, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_transaction_payment: on_finalize, time: 15880, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_authorship: on_finalize, time: 3850, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_timestamp: on_finalize, time: 3870, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_babe: on_finalize, time: 5530, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.003 tokio-blocking-driver INFO sc_basic_authorship::basic_authorship 🎁 Prepared block for proposing at 2 [hash: 0xbe4b4a0376b5e1e6cb6e1cdca345e45b6c663c8203c31a6dace6c441c7026463; parent_hash: 0x79bc…b5cb; extrinsics (1): [0x92a3…f0fd]]
2020-06-18 12:17:51.005 tokio-runtime-worker INFO sc_consensus_slots 🔖 Pre-sealed block for proposal at 2. Hash now 0xae660cc0dbe066cefef8b40a048a287580d59394d119bd4582d82b9f826ae7a6, previously 0xbe4b4a0376b5e1e6cb6e1cdca345e45b6c663c8203c31a6dace6c441c7026463.
2020-06-18 12:17:51.005 tokio-runtime-worker INFO substrate ✨ Imported #2 (0xae66…e7a6)

@mattrutherfordmattrutherford changed the title [ONICE] Wasm tracing runtime[ONICE] Runtime upgrade to make use of wasm tracingJun 18, 2020
@mattrutherfordmattrutherford added C1-low PR touches the given topic and has a low impact on builders. and removed A0-please_review Pull request needs code review. labels Jun 18, 2020
@bkchrbkchr mentioned this pull request Jul 3, 2020
@bkchr

bkchr commented Jul 7, 2020

Copy link
Copy Markdown
Member

Can you merge master? I think we should now be safe to merge this.

@mattrutherfordmattrutherford changed the title [ONICE] Runtime upgrade to make use of wasm tracingRuntime upgrade to make use of wasm tracingJul 7, 2020
@gnunicorngnunicorn added A0-please_review Pull request needs code review. and removed A1-onice labels Jul 7, 2020
@gnunicorn
gnunicorn requested review from bkchr and gnunicorn and removed request for bkchrJuly 7, 2020 15:49
@gnunicorngnunicorn added A1-onice and removed A0-please_review Pull request needs code review. labels Sep 9, 2020
@mattrutherford

Copy link
Copy Markdown
ContributorAuthor

Closing this, as it is now superseded by #6916

Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

C1-lowPR touches the given topic and has a low impact on builders.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@mattrutherford@bkchr@gnunicorn
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Strip utm_, fbclid, gclid, etc. from all links on page\n(function() {\n var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content',\n 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid',\n 'ref', 'ref_src', 'source', 'medium', 'campaign'];\n \n function cleanUrl(url) {\n try {\n var u = new URL(url, window.location.origin);\n var changed = false;\n trackingParams.forEach(function(p) {\n if (u.searchParams.has(p)) {\n u.searchParams.delete(p);\n changed = true;\n }\n });\n return changed ? u.toString() : url;\n } catch (e) {\n return url;\n }\n }\n \n function cleanLinks() {\n document.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n \n cleanLinks();\n \n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1) {\n if (node.tagName === 'A') cleanLinks();\n node.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Remove Tracking Parameters from Links"); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + '
Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.

Runtime upgrade to make use of wasm tracing - #6401

Closed
mattrutherford wants to merge 95 commits into
masterfrom
wasm-tracing-runtime
Closed

Runtime upgrade to make use of wasm tracing#6401
mattrutherford wants to merge 95 commits into
masterfrom
wasm-tracing-runtime

Conversation

@mattrutherford

@mattrutherfordmattrutherford commented Jun 18, 2020

Copy link
Copy Markdown
Contributor

This PR brings the runtime changes that make use of the new host functions added in #6381 which provide the ability to profile/trace wasm execution. It is the second part of the split of #5826.

We should allow sufficient time for clients in the network to upgrade to a version incorporating #6381 before merging this PR.

  • Add --wasm-tracing CLI flag to enable tracing from wasm (disabled by default).
  • Used in conjunction with --tracing-targets (and optionally --tracing-receiver).
  • Add automatic tracing to decl_module functions in the runtime.

mattrutherfordand others added 30 commits April 27, 2020 07:51
Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
@mattrutherford

Copy link
Copy Markdown
ContributorAuthor
target/release/substrate --dev --validator --alice --tracing-targets pallet=trace --execution wasm --wasm-execution compiled --tracing-enable-wasm
2020-06-18 12:17:47.021 main WARN sc_cli::commands::run_cmd Running in --dev mode, RPC CORS has been disabled.
2020-06-18 12:17:47.021 main INFO sc_cli::runner Substrate Node
2020-06-18 12:17:47.021 main INFO sc_cli::runner ✌️ version 2.0.0-rc3-unknown-commit-x86_64-linux-gnu
2020-06-18 12:17:47.021 main INFO sc_cli::runner ❤️ by Parity Technologies <admin@parity.io>, 2017-2020
2020-06-18 12:17:47.021 main INFO sc_cli::runner 📋 Chain specification: Development
2020-06-18 12:17:47.021 main INFO sc_cli::runner 🏷 Node name: Alice
2020-06-18 12:17:47.021 main INFO sc_cli::runner 👤 Role: AUTHORITY
2020-06-18 12:17:47.021 main INFO sc_cli::runner 💾 Database: RocksDb at /mnt/ramdisk/1/chains/dev/db
2020-06-18 12:17:47.021 main INFO sc_cli::runner ⛓ Native runtime: node-253 (substrate-node-0.tx1.au10)
2020-06-18 12:17:47.069 main INFO staking 💸 new validator set of size 1 has been elected via ElectionCompute::OnChain for era 0
2020-06-18 12:17:47.074 main INFO sc_service::client::client 🔨 Initializing Genesis block/state (state: 0x2144…37fd, header-hash: 0xf043…d8a4)
2020-06-18 12:17:47.076 main INFO afg 👴 Loading GRANDPA authority set from genesis on what appears to be first startup.
2020-06-18 12:17:47.320 main INFO sc_consensus_slots ⏱ Loaded block-time = BabeGenesisConfiguration { slot_duration: 3000, epoch_length: 200, c: (1, 4), genesis_authorities: [(Public(d43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d (5GrwvaEF...)), 1)], randomness: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], allowed_slots: AllowedSlots::PrimaryAndSecondaryPlainSlots } milliseconds from genesis on first-launch
2020-06-18 12:17:47.320 main INFO babe 👶 Creating empty BABE epoch changes on what appears to be first startup.
2020-06-18 12:17:47.338 main INFO sc_service::builder 📦 Highest known block at #0
2020-06-18 12:17:47.338 main WARN sc_service::builder Using default protocol ID "sup" because none is configured in the chain specs
2020-06-18 12:17:47.338 main INFO sub-libp2p 🏷 Local node identity is: 12D3KooWKE5Y9orm344cBaACCtfEauWqhWSkfH4EeJempHw8vyFk (legacy representation: Qmev3nhkAsHjtEDYnLzbAT6ccpEfSpobXRx811UCrenjsv)
2020-06-18 12:17:47.363 tokio-runtime-worker INFO substrate_prometheus_endpoint::known_os 〽️ Prometheus server started at 127.0.0.1:9615
2020-06-18 12:17:47.364 main INFO babe 👶 Starting BABE Authorship worker
2020-06-18 12:17:48.008 tokio-runtime-worker INFO sc_basic_authorship::basic_authorship 🙌 Starting consensus session on top of parent 0xf04317ea2da9f656f55d4d981b613bc0fbb269e7c6e2d7aabf43e1c27846d8a4
2020-06-18 12:17:48.014 tokio-blocking-driver INFO sc_tracing pallet_scheduler: on_initialize, time: 11860, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.014 tokio-blocking-driver INFO sc_tracing pallet_society: on_initialize, time: 740, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.015 tokio-blocking-driver INFO sc_tracing pallet_randomness_collective_flip: on_initialize, time: 15540, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.015 tokio-blocking-driver INFO sc_tracing pallet_offences: on_initialize, time: 18380, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.015 tokio-blocking-driver INFO sc_tracing pallet_treasury: on_initialize, time: 860, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.015 tokio-blocking-driver INFO sc_tracing pallet_elections_phragmen: on_initialize, time: 400, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.015 tokio-blocking-driver INFO sc_tracing pallet_democracy: on_initialize, time: 15050, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.016 tokio-blocking-driver INFO sc_tracing pallet_session: on_initialize, time: 1204891, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.016 tokio-blocking-driver INFO sc_tracing pallet_staking: on_initialize, time: 20070, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.016 tokio-blocking-driver INFO sc_tracing pallet_authorship: on_initialize, time: 61111, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.016 tokio-blocking-driver INFO sc_tracing pallet_timestamp: on_initialize, time: 300, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.016 tokio-blocking-driver INFO sc_tracing pallet_babe: on_initialize, time: 3320, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.023 tokio-blocking-driver INFO sc_tracing pallet_scheduler: on_initialize, time: 6980, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.023 tokio-blocking-driver INFO sc_tracing pallet_society: on_initialize, time: 390, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.023 tokio-blocking-driver INFO sc_tracing pallet_randomness_collective_flip: on_initialize, time: 10430, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.023 tokio-blocking-driver INFO sc_tracing pallet_offences: on_initialize, time: 13720, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.023 tokio-blocking-driver INFO sc_tracing pallet_treasury: on_initialize, time: 400, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.023 tokio-blocking-driver INFO sc_tracing pallet_elections_phragmen: on_initialize, time: 280, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.024 tokio-blocking-driver INFO sc_tracing pallet_democracy: on_initialize, time: 11630, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.024 tokio-blocking-driver INFO sc_tracing pallet_session: on_initialize, time: 10050, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.024 tokio-blocking-driver INFO sc_tracing pallet_staking: on_initialize, time: 15160, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.024 tokio-blocking-driver INFO sc_tracing pallet_authorship: on_initialize, time: 39610, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.024 tokio-blocking-driver INFO sc_tracing pallet_timestamp: on_initialize, time: 290, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.024 tokio-blocking-driver INFO sc_tracing pallet_babe: on_initialize, time: 2971, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.031 tokio-blocking-driver INFO sc_tracing pallet_timestamp: set, time: 16260, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.036 tokio-blocking-driver INFO sc_tracing pallet_grandpa: on_finalize, time: 11250, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.036 tokio-blocking-driver INFO sc_tracing pallet_finality_tracker: on_finalize, time: 29200, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.036 tokio-blocking-driver INFO sc_tracing pallet_staking: on_finalize, time: 12680, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.036 tokio-blocking-driver INFO sc_tracing pallet_transaction_payment: on_finalize, time: 17161, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.036 tokio-blocking-driver INFO sc_tracing pallet_authorship: on_finalize, time: 3310, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.036 tokio-blocking-driver INFO sc_tracing pallet_timestamp: on_finalize, time: 3660, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.036 tokio-blocking-driver INFO sc_tracing pallet_babe: on_finalize, time: 22540, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.037 tokio-blocking-driver INFO sc_basic_authorship::basic_authorship 🎁 Prepared block for proposing at 1 [hash: 0xe063a05a9ec4ec7e54910332b5b271e53ea3805e23eed885ab0be3c2ec6cda91; parent_hash: 0xf043…d8a4; extrinsics (1): [0x8599…4ba1]]
2020-06-18 12:17:48.039 tokio-runtime-worker INFO sc_consensus_slots 🔖 Pre-sealed block for proposal at 1. Hash now 0x79bc5f5e982336ba03b57c2f984ef3e77acabb5c7e4d07612a2719865141b5cb, previously 0xe063a05a9ec4ec7e54910332b5b271e53ea3805e23eed885ab0be3c2ec6cda91.
2020-06-18 12:17:48.039 tokio-runtime-worker INFO babe 👶 New epoch 0 launching at block 0x79bc…b5cb (block slot 530826356 >= start slot 530826356).
2020-06-18 12:17:48.039 tokio-runtime-worker INFO babe 👶 Next epoch starts at slot 530826556
2020-06-18 12:17:48.039 tokio-runtime-worker INFO substrate ✨ Imported #1 (0x79bc…b5cb)
2020-06-18 12:17:51.002 tokio-runtime-worker INFO sc_basic_authorship::basic_authorship 🙌 Starting consensus session on top of parent 0x79bc5f5e982336ba03b57c2f984ef3e77acabb5c7e4d07612a2719865141b5cb
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_scheduler: on_initialize, time: 9450, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_society: on_initialize, time: 520, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_randomness_collective_flip: on_initialize, time: 12520, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_offences: on_initialize, time: 10041, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_treasury: on_initialize, time: 430, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_elections_phragmen: on_initialize, time: 380, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_democracy: on_initialize, time: 6910, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_session: on_initialize, time: 26720, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_staking: on_initialize, time: 9170, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_authorship: on_initialize, time: 36771, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_timestamp: on_initialize, time: 350, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_babe: on_initialize, time: 3350, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_scheduler: on_initialize, time: 4880, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_society: on_initialize, time: 400, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_randomness_collective_flip: on_initialize, time: 11080, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_offences: on_initialize, time: 9450, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_treasury: on_initialize, time: 370, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_elections_phragmen: on_initialize, time: 360, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_democracy: on_initialize, time: 6440, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_session: on_initialize, time: 15380, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_staking: on_initialize, time: 8750, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_authorship: on_initialize, time: 27451, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_timestamp: on_initialize, time: 390, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_babe: on_initialize, time: 3300, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_timestamp: set, time: 10570, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_grandpa: on_finalize, time: 5110, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_finality_tracker: on_finalize, time: 20280, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_staking: on_finalize, time: 3580, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_transaction_payment: on_finalize, time: 15880, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_authorship: on_finalize, time: 3850, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_timestamp: on_finalize, time: 3870, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_babe: on_finalize, time: 5530, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.003 tokio-blocking-driver INFO sc_basic_authorship::basic_authorship 🎁 Prepared block for proposing at 2 [hash: 0xbe4b4a0376b5e1e6cb6e1cdca345e45b6c663c8203c31a6dace6c441c7026463; parent_hash: 0x79bc…b5cb; extrinsics (1): [0x92a3…f0fd]]
2020-06-18 12:17:51.005 tokio-runtime-worker INFO sc_consensus_slots 🔖 Pre-sealed block for proposal at 2. Hash now 0xae660cc0dbe066cefef8b40a048a287580d59394d119bd4582d82b9f826ae7a6, previously 0xbe4b4a0376b5e1e6cb6e1cdca345e45b6c663c8203c31a6dace6c441c7026463.
2020-06-18 12:17:51.005 tokio-runtime-worker INFO substrate ✨ Imported #2 (0xae66…e7a6)

@mattrutherfordmattrutherford changed the title [ONICE] Wasm tracing runtime[ONICE] Runtime upgrade to make use of wasm tracingJun 18, 2020
@mattrutherfordmattrutherford added C1-low PR touches the given topic and has a low impact on builders. and removed A0-please_review Pull request needs code review. labels Jun 18, 2020
@bkchrbkchr mentioned this pull request Jul 3, 2020
@bkchr

bkchr commented Jul 7, 2020

Copy link
Copy Markdown
Member

Can you merge master? I think we should now be safe to merge this.

@mattrutherfordmattrutherford changed the title [ONICE] Runtime upgrade to make use of wasm tracingRuntime upgrade to make use of wasm tracingJul 7, 2020
@gnunicorngnunicorn added A0-please_review Pull request needs code review. and removed A1-onice labels Jul 7, 2020
@gnunicorn
gnunicorn requested review from bkchr and gnunicorn and removed request for bkchrJuly 7, 2020 15:49
@gnunicorngnunicorn added A1-onice and removed A0-please_review Pull request needs code review. labels Sep 9, 2020
@mattrutherford

Copy link
Copy Markdown
ContributorAuthor

Closing this, as it is now superseded by #6916

Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

C1-lowPR touches the given topic and has a low impact on builders.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@mattrutherford@bkchr@gnunicorn
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Auto-enable theater mode on YouTube\n(function() {\n function tryTheater() {\n var btn = document.querySelector('button[aria-label=\"Theater mode\"], ytd-player #player button[title=\"Theater mode\"]');\n if (btn && !btn.classList.contains('activated')) {\n btn.click();\n }\n }\n \n // Try immediately\n tryTheater();\n \n // Try after navigation (SPA)\n var lastUrl = location.href;\n setInterval(function() {\n if (location.href !== lastUrl) {\n lastUrl = location.href;\n setTimeout(tryTheater, 500);\n }\n }, 1000);\n \n // Also try on player load\n var observer = new MutationObserver(tryTheater);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "YouTube Theater Mode Default"); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.

Runtime upgrade to make use of wasm tracing - #6401

Closed
mattrutherford wants to merge 95 commits into
masterfrom
wasm-tracing-runtime
Closed

Runtime upgrade to make use of wasm tracing#6401
mattrutherford wants to merge 95 commits into
masterfrom
wasm-tracing-runtime

Conversation

@mattrutherford

@mattrutherfordmattrutherford commented Jun 18, 2020

Copy link
Copy Markdown
Contributor

This PR brings the runtime changes that make use of the new host functions added in #6381 which provide the ability to profile/trace wasm execution. It is the second part of the split of #5826.

We should allow sufficient time for clients in the network to upgrade to a version incorporating #6381 before merging this PR.

  • Add --wasm-tracing CLI flag to enable tracing from wasm (disabled by default).
  • Used in conjunction with --tracing-targets (and optionally --tracing-receiver).
  • Add automatic tracing to decl_module functions in the runtime.

mattrutherfordand others added 30 commits April 27, 2020 07:51
Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
@mattrutherford

Copy link
Copy Markdown
ContributorAuthor
target/release/substrate --dev --validator --alice --tracing-targets pallet=trace --execution wasm --wasm-execution compiled --tracing-enable-wasm
2020-06-18 12:17:47.021 main WARN sc_cli::commands::run_cmd Running in --dev mode, RPC CORS has been disabled.
2020-06-18 12:17:47.021 main INFO sc_cli::runner Substrate Node
2020-06-18 12:17:47.021 main INFO sc_cli::runner ✌️ version 2.0.0-rc3-unknown-commit-x86_64-linux-gnu
2020-06-18 12:17:47.021 main INFO sc_cli::runner ❤️ by Parity Technologies <admin@parity.io>, 2017-2020
2020-06-18 12:17:47.021 main INFO sc_cli::runner 📋 Chain specification: Development
2020-06-18 12:17:47.021 main INFO sc_cli::runner 🏷 Node name: Alice
2020-06-18 12:17:47.021 main INFO sc_cli::runner 👤 Role: AUTHORITY
2020-06-18 12:17:47.021 main INFO sc_cli::runner 💾 Database: RocksDb at /mnt/ramdisk/1/chains/dev/db
2020-06-18 12:17:47.021 main INFO sc_cli::runner ⛓ Native runtime: node-253 (substrate-node-0.tx1.au10)
2020-06-18 12:17:47.069 main INFO staking 💸 new validator set of size 1 has been elected via ElectionCompute::OnChain for era 0
2020-06-18 12:17:47.074 main INFO sc_service::client::client 🔨 Initializing Genesis block/state (state: 0x2144…37fd, header-hash: 0xf043…d8a4)
2020-06-18 12:17:47.076 main INFO afg 👴 Loading GRANDPA authority set from genesis on what appears to be first startup.
2020-06-18 12:17:47.320 main INFO sc_consensus_slots ⏱ Loaded block-time = BabeGenesisConfiguration { slot_duration: 3000, epoch_length: 200, c: (1, 4), genesis_authorities: [(Public(d43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d (5GrwvaEF...)), 1)], randomness: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], allowed_slots: AllowedSlots::PrimaryAndSecondaryPlainSlots } milliseconds from genesis on first-launch
2020-06-18 12:17:47.320 main INFO babe 👶 Creating empty BABE epoch changes on what appears to be first startup.
2020-06-18 12:17:47.338 main INFO sc_service::builder 📦 Highest known block at #0
2020-06-18 12:17:47.338 main WARN sc_service::builder Using default protocol ID "sup" because none is configured in the chain specs
2020-06-18 12:17:47.338 main INFO sub-libp2p 🏷 Local node identity is: 12D3KooWKE5Y9orm344cBaACCtfEauWqhWSkfH4EeJempHw8vyFk (legacy representation: Qmev3nhkAsHjtEDYnLzbAT6ccpEfSpobXRx811UCrenjsv)
2020-06-18 12:17:47.363 tokio-runtime-worker INFO substrate_prometheus_endpoint::known_os 〽️ Prometheus server started at 127.0.0.1:9615
2020-06-18 12:17:47.364 main INFO babe 👶 Starting BABE Authorship worker
2020-06-18 12:17:48.008 tokio-runtime-worker INFO sc_basic_authorship::basic_authorship 🙌 Starting consensus session on top of parent 0xf04317ea2da9f656f55d4d981b613bc0fbb269e7c6e2d7aabf43e1c27846d8a4
2020-06-18 12:17:48.014 tokio-blocking-driver INFO sc_tracing pallet_scheduler: on_initialize, time: 11860, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.014 tokio-blocking-driver INFO sc_tracing pallet_society: on_initialize, time: 740, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.015 tokio-blocking-driver INFO sc_tracing pallet_randomness_collective_flip: on_initialize, time: 15540, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.015 tokio-blocking-driver INFO sc_tracing pallet_offences: on_initialize, time: 18380, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.015 tokio-blocking-driver INFO sc_tracing pallet_treasury: on_initialize, time: 860, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.015 tokio-blocking-driver INFO sc_tracing pallet_elections_phragmen: on_initialize, time: 400, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.015 tokio-blocking-driver INFO sc_tracing pallet_democracy: on_initialize, time: 15050, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.016 tokio-blocking-driver INFO sc_tracing pallet_session: on_initialize, time: 1204891, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.016 tokio-blocking-driver INFO sc_tracing pallet_staking: on_initialize, time: 20070, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.016 tokio-blocking-driver INFO sc_tracing pallet_authorship: on_initialize, time: 61111, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.016 tokio-blocking-driver INFO sc_tracing pallet_timestamp: on_initialize, time: 300, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.016 tokio-blocking-driver INFO sc_tracing pallet_babe: on_initialize, time: 3320, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.023 tokio-blocking-driver INFO sc_tracing pallet_scheduler: on_initialize, time: 6980, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.023 tokio-blocking-driver INFO sc_tracing pallet_society: on_initialize, time: 390, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.023 tokio-blocking-driver INFO sc_tracing pallet_randomness_collective_flip: on_initialize, time: 10430, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.023 tokio-blocking-driver INFO sc_tracing pallet_offences: on_initialize, time: 13720, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.023 tokio-blocking-driver INFO sc_tracing pallet_treasury: on_initialize, time: 400, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.023 tokio-blocking-driver INFO sc_tracing pallet_elections_phragmen: on_initialize, time: 280, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.024 tokio-blocking-driver INFO sc_tracing pallet_democracy: on_initialize, time: 11630, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.024 tokio-blocking-driver INFO sc_tracing pallet_session: on_initialize, time: 10050, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.024 tokio-blocking-driver INFO sc_tracing pallet_staking: on_initialize, time: 15160, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.024 tokio-blocking-driver INFO sc_tracing pallet_authorship: on_initialize, time: 39610, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.024 tokio-blocking-driver INFO sc_tracing pallet_timestamp: on_initialize, time: 290, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.024 tokio-blocking-driver INFO sc_tracing pallet_babe: on_initialize, time: 2971, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.031 tokio-blocking-driver INFO sc_tracing pallet_timestamp: set, time: 16260, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.036 tokio-blocking-driver INFO sc_tracing pallet_grandpa: on_finalize, time: 11250, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.036 tokio-blocking-driver INFO sc_tracing pallet_finality_tracker: on_finalize, time: 29200, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.036 tokio-blocking-driver INFO sc_tracing pallet_staking: on_finalize, time: 12680, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.036 tokio-blocking-driver INFO sc_tracing pallet_transaction_payment: on_finalize, time: 17161, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.036 tokio-blocking-driver INFO sc_tracing pallet_authorship: on_finalize, time: 3310, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.036 tokio-blocking-driver INFO sc_tracing pallet_timestamp: on_finalize, time: 3660, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.036 tokio-blocking-driver INFO sc_tracing pallet_babe: on_finalize, time: 22540, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.037 tokio-blocking-driver INFO sc_basic_authorship::basic_authorship 🎁 Prepared block for proposing at 1 [hash: 0xe063a05a9ec4ec7e54910332b5b271e53ea3805e23eed885ab0be3c2ec6cda91; parent_hash: 0xf043…d8a4; extrinsics (1): [0x8599…4ba1]]
2020-06-18 12:17:48.039 tokio-runtime-worker INFO sc_consensus_slots 🔖 Pre-sealed block for proposal at 1. Hash now 0x79bc5f5e982336ba03b57c2f984ef3e77acabb5c7e4d07612a2719865141b5cb, previously 0xe063a05a9ec4ec7e54910332b5b271e53ea3805e23eed885ab0be3c2ec6cda91.
2020-06-18 12:17:48.039 tokio-runtime-worker INFO babe 👶 New epoch 0 launching at block 0x79bc…b5cb (block slot 530826356 >= start slot 530826356).
2020-06-18 12:17:48.039 tokio-runtime-worker INFO babe 👶 Next epoch starts at slot 530826556
2020-06-18 12:17:48.039 tokio-runtime-worker INFO substrate ✨ Imported #1 (0x79bc…b5cb)
2020-06-18 12:17:51.002 tokio-runtime-worker INFO sc_basic_authorship::basic_authorship 🙌 Starting consensus session on top of parent 0x79bc5f5e982336ba03b57c2f984ef3e77acabb5c7e4d07612a2719865141b5cb
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_scheduler: on_initialize, time: 9450, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_society: on_initialize, time: 520, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_randomness_collective_flip: on_initialize, time: 12520, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_offences: on_initialize, time: 10041, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_treasury: on_initialize, time: 430, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_elections_phragmen: on_initialize, time: 380, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_democracy: on_initialize, time: 6910, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_session: on_initialize, time: 26720, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_staking: on_initialize, time: 9170, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_authorship: on_initialize, time: 36771, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_timestamp: on_initialize, time: 350, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_babe: on_initialize, time: 3350, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_scheduler: on_initialize, time: 4880, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_society: on_initialize, time: 400, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_randomness_collective_flip: on_initialize, time: 11080, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_offences: on_initialize, time: 9450, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_treasury: on_initialize, time: 370, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_elections_phragmen: on_initialize, time: 360, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_democracy: on_initialize, time: 6440, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_session: on_initialize, time: 15380, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_staking: on_initialize, time: 8750, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_authorship: on_initialize, time: 27451, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_timestamp: on_initialize, time: 390, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_babe: on_initialize, time: 3300, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_timestamp: set, time: 10570, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_grandpa: on_finalize, time: 5110, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_finality_tracker: on_finalize, time: 20280, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_staking: on_finalize, time: 3580, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_transaction_payment: on_finalize, time: 15880, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_authorship: on_finalize, time: 3850, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_timestamp: on_finalize, time: 3870, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_babe: on_finalize, time: 5530, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.003 tokio-blocking-driver INFO sc_basic_authorship::basic_authorship 🎁 Prepared block for proposing at 2 [hash: 0xbe4b4a0376b5e1e6cb6e1cdca345e45b6c663c8203c31a6dace6c441c7026463; parent_hash: 0x79bc…b5cb; extrinsics (1): [0x92a3…f0fd]]
2020-06-18 12:17:51.005 tokio-runtime-worker INFO sc_consensus_slots 🔖 Pre-sealed block for proposal at 2. Hash now 0xae660cc0dbe066cefef8b40a048a287580d59394d119bd4582d82b9f826ae7a6, previously 0xbe4b4a0376b5e1e6cb6e1cdca345e45b6c663c8203c31a6dace6c441c7026463.
2020-06-18 12:17:51.005 tokio-runtime-worker INFO substrate ✨ Imported #2 (0xae66…e7a6)

@mattrutherfordmattrutherford changed the title [ONICE] Wasm tracing runtime[ONICE] Runtime upgrade to make use of wasm tracingJun 18, 2020
@mattrutherfordmattrutherford added C1-low PR touches the given topic and has a low impact on builders. and removed A0-please_review Pull request needs code review. labels Jun 18, 2020
@bkchrbkchr mentioned this pull request Jul 3, 2020
@bkchr

bkchr commented Jul 7, 2020

Copy link
Copy Markdown
Member

Can you merge master? I think we should now be safe to merge this.

@mattrutherfordmattrutherford changed the title [ONICE] Runtime upgrade to make use of wasm tracingRuntime upgrade to make use of wasm tracingJul 7, 2020
@gnunicorngnunicorn added A0-please_review Pull request needs code review. and removed A1-onice labels Jul 7, 2020
@gnunicorn
gnunicorn requested review from bkchr and gnunicorn and removed request for bkchrJuly 7, 2020 15:49
@gnunicorngnunicorn added A1-onice and removed A0-please_review Pull request needs code review. labels Sep 9, 2020
@mattrutherford

Copy link
Copy Markdown
ContributorAuthor

Closing this, as it is now superseded by #6916

Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

C1-lowPR touches the given topic and has a low impact on builders.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@mattrutherford@bkchr@gnunicorn
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Remove or un-stick sticky/fixed headers that block content\n(function() {\n function unstick() {\n document.querySelectorAll('header, nav, [role=\"banner\"], .header, .navbar, .sticky, .fixed-top, [style*=\"position: fixed\"], [style*=\"position:sticky\"]').forEach(function(el) {\n if (el.style.position === 'fixed' || el.style.position === 'sticky' || \n getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') {\n el.style.position = 'static';\n el.style.top = 'auto';\n el.style.zIndex = 'auto';\n }\n });\n }\n \n unstick();\n \n var observer = new MutationObserver(unstick);\n observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] });\n})();", "Kill Sticky Headers"); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.

Runtime upgrade to make use of wasm tracing - #6401

Closed
mattrutherford wants to merge 95 commits into
masterfrom
wasm-tracing-runtime
Closed

Runtime upgrade to make use of wasm tracing#6401
mattrutherford wants to merge 95 commits into
masterfrom
wasm-tracing-runtime

Conversation

@mattrutherford

@mattrutherfordmattrutherford commented Jun 18, 2020

Copy link
Copy Markdown
Contributor

This PR brings the runtime changes that make use of the new host functions added in #6381 which provide the ability to profile/trace wasm execution. It is the second part of the split of #5826.

We should allow sufficient time for clients in the network to upgrade to a version incorporating #6381 before merging this PR.

  • Add --wasm-tracing CLI flag to enable tracing from wasm (disabled by default).
  • Used in conjunction with --tracing-targets (and optionally --tracing-receiver).
  • Add automatic tracing to decl_module functions in the runtime.

mattrutherfordand others added 30 commits April 27, 2020 07:51
Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
@mattrutherford

Copy link
Copy Markdown
ContributorAuthor
target/release/substrate --dev --validator --alice --tracing-targets pallet=trace --execution wasm --wasm-execution compiled --tracing-enable-wasm
2020-06-18 12:17:47.021 main WARN sc_cli::commands::run_cmd Running in --dev mode, RPC CORS has been disabled.
2020-06-18 12:17:47.021 main INFO sc_cli::runner Substrate Node
2020-06-18 12:17:47.021 main INFO sc_cli::runner ✌️ version 2.0.0-rc3-unknown-commit-x86_64-linux-gnu
2020-06-18 12:17:47.021 main INFO sc_cli::runner ❤️ by Parity Technologies <admin@parity.io>, 2017-2020
2020-06-18 12:17:47.021 main INFO sc_cli::runner 📋 Chain specification: Development
2020-06-18 12:17:47.021 main INFO sc_cli::runner 🏷 Node name: Alice
2020-06-18 12:17:47.021 main INFO sc_cli::runner 👤 Role: AUTHORITY
2020-06-18 12:17:47.021 main INFO sc_cli::runner 💾 Database: RocksDb at /mnt/ramdisk/1/chains/dev/db
2020-06-18 12:17:47.021 main INFO sc_cli::runner ⛓ Native runtime: node-253 (substrate-node-0.tx1.au10)
2020-06-18 12:17:47.069 main INFO staking 💸 new validator set of size 1 has been elected via ElectionCompute::OnChain for era 0
2020-06-18 12:17:47.074 main INFO sc_service::client::client 🔨 Initializing Genesis block/state (state: 0x2144…37fd, header-hash: 0xf043…d8a4)
2020-06-18 12:17:47.076 main INFO afg 👴 Loading GRANDPA authority set from genesis on what appears to be first startup.
2020-06-18 12:17:47.320 main INFO sc_consensus_slots ⏱ Loaded block-time = BabeGenesisConfiguration { slot_duration: 3000, epoch_length: 200, c: (1, 4), genesis_authorities: [(Public(d43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d (5GrwvaEF...)), 1)], randomness: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], allowed_slots: AllowedSlots::PrimaryAndSecondaryPlainSlots } milliseconds from genesis on first-launch
2020-06-18 12:17:47.320 main INFO babe 👶 Creating empty BABE epoch changes on what appears to be first startup.
2020-06-18 12:17:47.338 main INFO sc_service::builder 📦 Highest known block at #0
2020-06-18 12:17:47.338 main WARN sc_service::builder Using default protocol ID "sup" because none is configured in the chain specs
2020-06-18 12:17:47.338 main INFO sub-libp2p 🏷 Local node identity is: 12D3KooWKE5Y9orm344cBaACCtfEauWqhWSkfH4EeJempHw8vyFk (legacy representation: Qmev3nhkAsHjtEDYnLzbAT6ccpEfSpobXRx811UCrenjsv)
2020-06-18 12:17:47.363 tokio-runtime-worker INFO substrate_prometheus_endpoint::known_os 〽️ Prometheus server started at 127.0.0.1:9615
2020-06-18 12:17:47.364 main INFO babe 👶 Starting BABE Authorship worker
2020-06-18 12:17:48.008 tokio-runtime-worker INFO sc_basic_authorship::basic_authorship 🙌 Starting consensus session on top of parent 0xf04317ea2da9f656f55d4d981b613bc0fbb269e7c6e2d7aabf43e1c27846d8a4
2020-06-18 12:17:48.014 tokio-blocking-driver INFO sc_tracing pallet_scheduler: on_initialize, time: 11860, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.014 tokio-blocking-driver INFO sc_tracing pallet_society: on_initialize, time: 740, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.015 tokio-blocking-driver INFO sc_tracing pallet_randomness_collective_flip: on_initialize, time: 15540, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.015 tokio-blocking-driver INFO sc_tracing pallet_offences: on_initialize, time: 18380, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.015 tokio-blocking-driver INFO sc_tracing pallet_treasury: on_initialize, time: 860, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.015 tokio-blocking-driver INFO sc_tracing pallet_elections_phragmen: on_initialize, time: 400, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.015 tokio-blocking-driver INFO sc_tracing pallet_democracy: on_initialize, time: 15050, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.016 tokio-blocking-driver INFO sc_tracing pallet_session: on_initialize, time: 1204891, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.016 tokio-blocking-driver INFO sc_tracing pallet_staking: on_initialize, time: 20070, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.016 tokio-blocking-driver INFO sc_tracing pallet_authorship: on_initialize, time: 61111, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.016 tokio-blocking-driver INFO sc_tracing pallet_timestamp: on_initialize, time: 300, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.016 tokio-blocking-driver INFO sc_tracing pallet_babe: on_initialize, time: 3320, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.023 tokio-blocking-driver INFO sc_tracing pallet_scheduler: on_initialize, time: 6980, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.023 tokio-blocking-driver INFO sc_tracing pallet_society: on_initialize, time: 390, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.023 tokio-blocking-driver INFO sc_tracing pallet_randomness_collective_flip: on_initialize, time: 10430, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.023 tokio-blocking-driver INFO sc_tracing pallet_offences: on_initialize, time: 13720, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.023 tokio-blocking-driver INFO sc_tracing pallet_treasury: on_initialize, time: 400, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.023 tokio-blocking-driver INFO sc_tracing pallet_elections_phragmen: on_initialize, time: 280, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.024 tokio-blocking-driver INFO sc_tracing pallet_democracy: on_initialize, time: 11630, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.024 tokio-blocking-driver INFO sc_tracing pallet_session: on_initialize, time: 10050, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.024 tokio-blocking-driver INFO sc_tracing pallet_staking: on_initialize, time: 15160, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.024 tokio-blocking-driver INFO sc_tracing pallet_authorship: on_initialize, time: 39610, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.024 tokio-blocking-driver INFO sc_tracing pallet_timestamp: on_initialize, time: 290, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.024 tokio-blocking-driver INFO sc_tracing pallet_babe: on_initialize, time: 2971, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.031 tokio-blocking-driver INFO sc_tracing pallet_timestamp: set, time: 16260, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.036 tokio-blocking-driver INFO sc_tracing pallet_grandpa: on_finalize, time: 11250, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.036 tokio-blocking-driver INFO sc_tracing pallet_finality_tracker: on_finalize, time: 29200, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.036 tokio-blocking-driver INFO sc_tracing pallet_staking: on_finalize, time: 12680, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.036 tokio-blocking-driver INFO sc_tracing pallet_transaction_payment: on_finalize, time: 17161, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.036 tokio-blocking-driver INFO sc_tracing pallet_authorship: on_finalize, time: 3310, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.036 tokio-blocking-driver INFO sc_tracing pallet_timestamp: on_finalize, time: 3660, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.036 tokio-blocking-driver INFO sc_tracing pallet_babe: on_finalize, time: 22540, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.037 tokio-blocking-driver INFO sc_basic_authorship::basic_authorship 🎁 Prepared block for proposing at 1 [hash: 0xe063a05a9ec4ec7e54910332b5b271e53ea3805e23eed885ab0be3c2ec6cda91; parent_hash: 0xf043…d8a4; extrinsics (1): [0x8599…4ba1]]
2020-06-18 12:17:48.039 tokio-runtime-worker INFO sc_consensus_slots 🔖 Pre-sealed block for proposal at 1. Hash now 0x79bc5f5e982336ba03b57c2f984ef3e77acabb5c7e4d07612a2719865141b5cb, previously 0xe063a05a9ec4ec7e54910332b5b271e53ea3805e23eed885ab0be3c2ec6cda91.
2020-06-18 12:17:48.039 tokio-runtime-worker INFO babe 👶 New epoch 0 launching at block 0x79bc…b5cb (block slot 530826356 >= start slot 530826356).
2020-06-18 12:17:48.039 tokio-runtime-worker INFO babe 👶 Next epoch starts at slot 530826556
2020-06-18 12:17:48.039 tokio-runtime-worker INFO substrate ✨ Imported #1 (0x79bc…b5cb)
2020-06-18 12:17:51.002 tokio-runtime-worker INFO sc_basic_authorship::basic_authorship 🙌 Starting consensus session on top of parent 0x79bc5f5e982336ba03b57c2f984ef3e77acabb5c7e4d07612a2719865141b5cb
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_scheduler: on_initialize, time: 9450, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_society: on_initialize, time: 520, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_randomness_collective_flip: on_initialize, time: 12520, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_offences: on_initialize, time: 10041, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_treasury: on_initialize, time: 430, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_elections_phragmen: on_initialize, time: 380, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_democracy: on_initialize, time: 6910, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_session: on_initialize, time: 26720, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_staking: on_initialize, time: 9170, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_authorship: on_initialize, time: 36771, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_timestamp: on_initialize, time: 350, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_babe: on_initialize, time: 3350, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_scheduler: on_initialize, time: 4880, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_society: on_initialize, time: 400, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_randomness_collective_flip: on_initialize, time: 11080, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_offences: on_initialize, time: 9450, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_treasury: on_initialize, time: 370, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_elections_phragmen: on_initialize, time: 360, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_democracy: on_initialize, time: 6440, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_session: on_initialize, time: 15380, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_staking: on_initialize, time: 8750, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_authorship: on_initialize, time: 27451, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_timestamp: on_initialize, time: 390, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_babe: on_initialize, time: 3300, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_timestamp: set, time: 10570, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_grandpa: on_finalize, time: 5110, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_finality_tracker: on_finalize, time: 20280, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_staking: on_finalize, time: 3580, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_transaction_payment: on_finalize, time: 15880, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_authorship: on_finalize, time: 3850, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_timestamp: on_finalize, time: 3870, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_babe: on_finalize, time: 5530, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.003 tokio-blocking-driver INFO sc_basic_authorship::basic_authorship 🎁 Prepared block for proposing at 2 [hash: 0xbe4b4a0376b5e1e6cb6e1cdca345e45b6c663c8203c31a6dace6c441c7026463; parent_hash: 0x79bc…b5cb; extrinsics (1): [0x92a3…f0fd]]
2020-06-18 12:17:51.005 tokio-runtime-worker INFO sc_consensus_slots 🔖 Pre-sealed block for proposal at 2. Hash now 0xae660cc0dbe066cefef8b40a048a287580d59394d119bd4582d82b9f826ae7a6, previously 0xbe4b4a0376b5e1e6cb6e1cdca345e45b6c663c8203c31a6dace6c441c7026463.
2020-06-18 12:17:51.005 tokio-runtime-worker INFO substrate ✨ Imported #2 (0xae66…e7a6)

@mattrutherfordmattrutherford changed the title [ONICE] Wasm tracing runtime[ONICE] Runtime upgrade to make use of wasm tracingJun 18, 2020
@mattrutherfordmattrutherford added C1-low PR touches the given topic and has a low impact on builders. and removed A0-please_review Pull request needs code review. labels Jun 18, 2020
@bkchrbkchr mentioned this pull request Jul 3, 2020
@bkchr

bkchr commented Jul 7, 2020

Copy link
Copy Markdown
Member

Can you merge master? I think we should now be safe to merge this.

@mattrutherfordmattrutherford changed the title [ONICE] Runtime upgrade to make use of wasm tracingRuntime upgrade to make use of wasm tracingJul 7, 2020
@gnunicorngnunicorn added A0-please_review Pull request needs code review. and removed A1-onice labels Jul 7, 2020
@gnunicorn
gnunicorn requested review from bkchr and gnunicorn and removed request for bkchrJuly 7, 2020 15:49
@gnunicorngnunicorn added A1-onice and removed A0-please_review Pull request needs code review. labels Sep 9, 2020
@mattrutherford

Copy link
Copy Markdown
ContributorAuthor

Closing this, as it is now superseded by #6916

Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

C1-lowPR touches the given topic and has a low impact on builders.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@mattrutherford@bkchr@gnunicorn
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Universal Dark Mode - works on any site\n(function() {\n var enabled = true;\n \n function applyDarkMode() {\n if (!enabled) return;\n \n // Create style element if it doesn't exist\n var style = document.getElementById('universal-dark-mode-style');\n if (!style) {\n style = document.createElement('style');\n style.id = 'universal-dark-mode-style';\n document.head.appendChild(style);\n }\n \n // Dark mode CSS - inverts colors but preserves images/video\n style.textContent = '\n /* Invert everything except media */\n html {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #1a1a2e !important;\n }\n \n /* Restore images, videos, iframes, canvas */\n img, video, iframe, canvas, svg, picture, [style*=\"background-image\"] {\n filter: invert(1) hue-rotate(180deg) !important;\n }\n \n /* Preserve specific elements that should not be inverted */\n .no-dark-mode, .no-dark-mode *,\n [data-theme=\"light\"], [data-theme=\"light\"],\n .ace_editor, .ace_editor *,\n .CodeMirror, .CodeMirror *,\n .monaco-editor, .monaco-editor *,\n .markdown-body pre, .markdown-body pre *,\n .highlight, .highlight *,\n pre code, pre code * {\n filter: none !important;\n }\n \n /* Fix common UI elements */\n .modal, .popup, .dropdown-menu, .tooltip, .popover {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #2d2d44 !important;\n border-color: #444 !important;\n }\n \n /* Scrollbars */\n ::-webkit-scrollbar { background: #1a1a2e !important; }\n ::-webkit-scrollbar-thumb { background: #444 !important; }\n ::-webkit-scrollbar-thumb:hover { background: #555 !important; }\n \n /* Selection */\n ::selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ::-moz-selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ';\n }\n \n function removeDarkMode() {\n var style = document.getElementById('universal-dark-mode-style');\n if (style) style.remove();\n }\n \n // Toggle with Alt+Shift+D\n document.addEventListener('keydown', function(e) {\n if (e.altKey && e.shiftKey && e.key === 'D') {\n e.preventDefault();\n enabled = !enabled;\n if (enabled) {\n applyDarkMode();\n console.log('[Universal Dark Mode] Enabled');\n } else {\n removeDarkMode();\n console.log('[Universal Dark Mode] Disabled');\n }\n }\n });\n \n // Apply on load\n applyDarkMode();\n \n // Re-apply on dynamic content\n var observer = new MutationObserver(function(mutations) {\n if (enabled && !document.getElementById('universal-dark-mode-style')) {\n applyDarkMode();\n }\n });\n observer.observe(document.head, { childList: true });\n \n console.log('[Universal Dark Mode] Loaded - Press Alt+Shift+D to toggle');\n})();", "Universal Dark Mode"); } } catch(__e) { console.warn('[Userscript:Universal Dark Mode]', __e); } })(); })();
Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.

Runtime upgrade to make use of wasm tracing - #6401

Closed
mattrutherford wants to merge 95 commits into
masterfrom
wasm-tracing-runtime
Closed

Runtime upgrade to make use of wasm tracing#6401
mattrutherford wants to merge 95 commits into
masterfrom
wasm-tracing-runtime

Conversation

@mattrutherford

@mattrutherfordmattrutherford commented Jun 18, 2020

Copy link
Copy Markdown
Contributor

This PR brings the runtime changes that make use of the new host functions added in #6381 which provide the ability to profile/trace wasm execution. It is the second part of the split of #5826.

We should allow sufficient time for clients in the network to upgrade to a version incorporating #6381 before merging this PR.

  • Add --wasm-tracing CLI flag to enable tracing from wasm (disabled by default).
  • Used in conjunction with --tracing-targets (and optionally --tracing-receiver).
  • Add automatic tracing to decl_module functions in the runtime.

mattrutherfordand others added 30 commits April 27, 2020 07:51
Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
@mattrutherford

Copy link
Copy Markdown
ContributorAuthor
target/release/substrate --dev --validator --alice --tracing-targets pallet=trace --execution wasm --wasm-execution compiled --tracing-enable-wasm
2020-06-18 12:17:47.021 main WARN sc_cli::commands::run_cmd Running in --dev mode, RPC CORS has been disabled.
2020-06-18 12:17:47.021 main INFO sc_cli::runner Substrate Node
2020-06-18 12:17:47.021 main INFO sc_cli::runner ✌️ version 2.0.0-rc3-unknown-commit-x86_64-linux-gnu
2020-06-18 12:17:47.021 main INFO sc_cli::runner ❤️ by Parity Technologies <admin@parity.io>, 2017-2020
2020-06-18 12:17:47.021 main INFO sc_cli::runner 📋 Chain specification: Development
2020-06-18 12:17:47.021 main INFO sc_cli::runner 🏷 Node name: Alice
2020-06-18 12:17:47.021 main INFO sc_cli::runner 👤 Role: AUTHORITY
2020-06-18 12:17:47.021 main INFO sc_cli::runner 💾 Database: RocksDb at /mnt/ramdisk/1/chains/dev/db
2020-06-18 12:17:47.021 main INFO sc_cli::runner ⛓ Native runtime: node-253 (substrate-node-0.tx1.au10)
2020-06-18 12:17:47.069 main INFO staking 💸 new validator set of size 1 has been elected via ElectionCompute::OnChain for era 0
2020-06-18 12:17:47.074 main INFO sc_service::client::client 🔨 Initializing Genesis block/state (state: 0x2144…37fd, header-hash: 0xf043…d8a4)
2020-06-18 12:17:47.076 main INFO afg 👴 Loading GRANDPA authority set from genesis on what appears to be first startup.
2020-06-18 12:17:47.320 main INFO sc_consensus_slots ⏱ Loaded block-time = BabeGenesisConfiguration { slot_duration: 3000, epoch_length: 200, c: (1, 4), genesis_authorities: [(Public(d43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d (5GrwvaEF...)), 1)], randomness: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], allowed_slots: AllowedSlots::PrimaryAndSecondaryPlainSlots } milliseconds from genesis on first-launch
2020-06-18 12:17:47.320 main INFO babe 👶 Creating empty BABE epoch changes on what appears to be first startup.
2020-06-18 12:17:47.338 main INFO sc_service::builder 📦 Highest known block at #0
2020-06-18 12:17:47.338 main WARN sc_service::builder Using default protocol ID "sup" because none is configured in the chain specs
2020-06-18 12:17:47.338 main INFO sub-libp2p 🏷 Local node identity is: 12D3KooWKE5Y9orm344cBaACCtfEauWqhWSkfH4EeJempHw8vyFk (legacy representation: Qmev3nhkAsHjtEDYnLzbAT6ccpEfSpobXRx811UCrenjsv)
2020-06-18 12:17:47.363 tokio-runtime-worker INFO substrate_prometheus_endpoint::known_os 〽️ Prometheus server started at 127.0.0.1:9615
2020-06-18 12:17:47.364 main INFO babe 👶 Starting BABE Authorship worker
2020-06-18 12:17:48.008 tokio-runtime-worker INFO sc_basic_authorship::basic_authorship 🙌 Starting consensus session on top of parent 0xf04317ea2da9f656f55d4d981b613bc0fbb269e7c6e2d7aabf43e1c27846d8a4
2020-06-18 12:17:48.014 tokio-blocking-driver INFO sc_tracing pallet_scheduler: on_initialize, time: 11860, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.014 tokio-blocking-driver INFO sc_tracing pallet_society: on_initialize, time: 740, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.015 tokio-blocking-driver INFO sc_tracing pallet_randomness_collective_flip: on_initialize, time: 15540, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.015 tokio-blocking-driver INFO sc_tracing pallet_offences: on_initialize, time: 18380, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.015 tokio-blocking-driver INFO sc_tracing pallet_treasury: on_initialize, time: 860, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.015 tokio-blocking-driver INFO sc_tracing pallet_elections_phragmen: on_initialize, time: 400, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.015 tokio-blocking-driver INFO sc_tracing pallet_democracy: on_initialize, time: 15050, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.016 tokio-blocking-driver INFO sc_tracing pallet_session: on_initialize, time: 1204891, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.016 tokio-blocking-driver INFO sc_tracing pallet_staking: on_initialize, time: 20070, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.016 tokio-blocking-driver INFO sc_tracing pallet_authorship: on_initialize, time: 61111, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.016 tokio-blocking-driver INFO sc_tracing pallet_timestamp: on_initialize, time: 300, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.016 tokio-blocking-driver INFO sc_tracing pallet_babe: on_initialize, time: 3320, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.023 tokio-blocking-driver INFO sc_tracing pallet_scheduler: on_initialize, time: 6980, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.023 tokio-blocking-driver INFO sc_tracing pallet_society: on_initialize, time: 390, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.023 tokio-blocking-driver INFO sc_tracing pallet_randomness_collective_flip: on_initialize, time: 10430, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.023 tokio-blocking-driver INFO sc_tracing pallet_offences: on_initialize, time: 13720, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.023 tokio-blocking-driver INFO sc_tracing pallet_treasury: on_initialize, time: 400, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.023 tokio-blocking-driver INFO sc_tracing pallet_elections_phragmen: on_initialize, time: 280, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.024 tokio-blocking-driver INFO sc_tracing pallet_democracy: on_initialize, time: 11630, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.024 tokio-blocking-driver INFO sc_tracing pallet_session: on_initialize, time: 10050, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.024 tokio-blocking-driver INFO sc_tracing pallet_staking: on_initialize, time: 15160, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.024 tokio-blocking-driver INFO sc_tracing pallet_authorship: on_initialize, time: 39610, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.024 tokio-blocking-driver INFO sc_tracing pallet_timestamp: on_initialize, time: 290, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.024 tokio-blocking-driver INFO sc_tracing pallet_babe: on_initialize, time: 2971, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.031 tokio-blocking-driver INFO sc_tracing pallet_timestamp: set, time: 16260, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.036 tokio-blocking-driver INFO sc_tracing pallet_grandpa: on_finalize, time: 11250, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.036 tokio-blocking-driver INFO sc_tracing pallet_finality_tracker: on_finalize, time: 29200, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.036 tokio-blocking-driver INFO sc_tracing pallet_staking: on_finalize, time: 12680, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.036 tokio-blocking-driver INFO sc_tracing pallet_transaction_payment: on_finalize, time: 17161, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.036 tokio-blocking-driver INFO sc_tracing pallet_authorship: on_finalize, time: 3310, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.036 tokio-blocking-driver INFO sc_tracing pallet_timestamp: on_finalize, time: 3660, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.036 tokio-blocking-driver INFO sc_tracing pallet_babe: on_finalize, time: 22540, is_valid_trace=true, wasm=true
2020-06-18 12:17:48.037 tokio-blocking-driver INFO sc_basic_authorship::basic_authorship 🎁 Prepared block for proposing at 1 [hash: 0xe063a05a9ec4ec7e54910332b5b271e53ea3805e23eed885ab0be3c2ec6cda91; parent_hash: 0xf043…d8a4; extrinsics (1): [0x8599…4ba1]]
2020-06-18 12:17:48.039 tokio-runtime-worker INFO sc_consensus_slots 🔖 Pre-sealed block for proposal at 1. Hash now 0x79bc5f5e982336ba03b57c2f984ef3e77acabb5c7e4d07612a2719865141b5cb, previously 0xe063a05a9ec4ec7e54910332b5b271e53ea3805e23eed885ab0be3c2ec6cda91.
2020-06-18 12:17:48.039 tokio-runtime-worker INFO babe 👶 New epoch 0 launching at block 0x79bc…b5cb (block slot 530826356 >= start slot 530826356).
2020-06-18 12:17:48.039 tokio-runtime-worker INFO babe 👶 Next epoch starts at slot 530826556
2020-06-18 12:17:48.039 tokio-runtime-worker INFO substrate ✨ Imported #1 (0x79bc…b5cb)
2020-06-18 12:17:51.002 tokio-runtime-worker INFO sc_basic_authorship::basic_authorship 🙌 Starting consensus session on top of parent 0x79bc5f5e982336ba03b57c2f984ef3e77acabb5c7e4d07612a2719865141b5cb
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_scheduler: on_initialize, time: 9450, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_society: on_initialize, time: 520, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_randomness_collective_flip: on_initialize, time: 12520, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_offences: on_initialize, time: 10041, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_treasury: on_initialize, time: 430, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_elections_phragmen: on_initialize, time: 380, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_democracy: on_initialize, time: 6910, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_session: on_initialize, time: 26720, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_staking: on_initialize, time: 9170, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_authorship: on_initialize, time: 36771, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_timestamp: on_initialize, time: 350, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_babe: on_initialize, time: 3350, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_scheduler: on_initialize, time: 4880, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_society: on_initialize, time: 400, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_randomness_collective_flip: on_initialize, time: 11080, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_offences: on_initialize, time: 9450, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_treasury: on_initialize, time: 370, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_elections_phragmen: on_initialize, time: 360, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_democracy: on_initialize, time: 6440, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_session: on_initialize, time: 15380, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_staking: on_initialize, time: 8750, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_authorship: on_initialize, time: 27451, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_timestamp: on_initialize, time: 390, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_babe: on_initialize, time: 3300, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_timestamp: set, time: 10570, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_grandpa: on_finalize, time: 5110, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_finality_tracker: on_finalize, time: 20280, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_staking: on_finalize, time: 3580, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_transaction_payment: on_finalize, time: 15880, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_authorship: on_finalize, time: 3850, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_timestamp: on_finalize, time: 3870, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.002 tokio-blocking-driver INFO sc_tracing pallet_babe: on_finalize, time: 5530, is_valid_trace=true, wasm=true
2020-06-18 12:17:51.003 tokio-blocking-driver INFO sc_basic_authorship::basic_authorship 🎁 Prepared block for proposing at 2 [hash: 0xbe4b4a0376b5e1e6cb6e1cdca345e45b6c663c8203c31a6dace6c441c7026463; parent_hash: 0x79bc…b5cb; extrinsics (1): [0x92a3…f0fd]]
2020-06-18 12:17:51.005 tokio-runtime-worker INFO sc_consensus_slots 🔖 Pre-sealed block for proposal at 2. Hash now 0xae660cc0dbe066cefef8b40a048a287580d59394d119bd4582d82b9f826ae7a6, previously 0xbe4b4a0376b5e1e6cb6e1cdca345e45b6c663c8203c31a6dace6c441c7026463.
2020-06-18 12:17:51.005 tokio-runtime-worker INFO substrate ✨ Imported #2 (0xae66…e7a6)

@mattrutherfordmattrutherford changed the title [ONICE] Wasm tracing runtime[ONICE] Runtime upgrade to make use of wasm tracingJun 18, 2020
@mattrutherfordmattrutherford added C1-low PR touches the given topic and has a low impact on builders. and removed A0-please_review Pull request needs code review. labels Jun 18, 2020
@bkchrbkchr mentioned this pull request Jul 3, 2020
@bkchr

bkchr commented Jul 7, 2020

Copy link
Copy Markdown
Member

Can you merge master? I think we should now be safe to merge this.

@mattrutherfordmattrutherford changed the title [ONICE] Runtime upgrade to make use of wasm tracingRuntime upgrade to make use of wasm tracingJul 7, 2020
@gnunicorngnunicorn added A0-please_review Pull request needs code review. and removed A1-onice labels Jul 7, 2020
@gnunicorn
gnunicorn requested review from bkchr and gnunicorn and removed request for bkchrJuly 7, 2020 15:49
@gnunicorngnunicorn added A1-onice and removed A0-please_review Pull request needs code review. labels Sep 9, 2020
@mattrutherford

Copy link
Copy Markdown
ContributorAuthor

Closing this, as it is now superseded by #6916

Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

C1-lowPR touches the given topic and has a low impact on builders.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@mattrutherford@bkchr@gnunicorn