This repository was archived by the owner on Nov 15, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Facilitate tracing from WASM #5826
Closed
Closed
Changes from 12 commits
Commits
Show all changes
91 commits
Select commit
Hold shift + click to select a range
62f4df9
Add span recording to tracing implementation
mattrutherford e5aa529
Add tracing proxy
mattrutherford e71eb09
switch to rustc_hash::FxHashMap
mattrutherford db69268
Replace lazy_static and hashmap with thread_local and vec.
mattrutherford b43015f
fix marking valid span as invalid while removing invalid spans
mattrutherford dba7d55
refactor, add wasm_tracing module in `support`
mattrutherford 5e86ef6
update registered spans
mattrutherford 35706ca
tidy up
mattrutherford 1388002
typos
mattrutherford 41964e7
refactor
mattrutherford ad81d3b
update flag name to signal lost trace - `is_valid_trace`
mattrutherford 2cb66bf
update flag name to signal lost trace - `is_valid_trace`
mattrutherford 03b7b6e
update docs
mattrutherford 16b018c
update docs
mattrutherford d2af83d
Use tracing Field recording to store the actual `name` and `target`
mattrutherford 9f8baf2
fix debug log in subscriber + small refactor
mattrutherford 1199f36
add tests
mattrutherford 0c61f79
handle misuse in case trying to exit span not held
mattrutherford 8061da5
Implement filter for wasm traces, simplify field recording for primit…
mattrutherford 2097aca
remove superfluous warning
mattrutherford 1ef18e6
update docs
mattrutherford 60e0b60
Merge branch 'master' into mr-sp-tracing
mattrutherford cd8bed8
Merge branch 'master' into mr-sp-tracing
mattrutherford 460d24d
Update primitives/tracing/src/proxy.rs
mattrutherford 85bdbe0
Apply suggestions from code review
mattrutherford b9d1fdf
update docs, apply suggestions
mattrutherford b66bb33
move Proxy from thread_local to `Extension`, rename macro
mattrutherford afa511d
fix test
mattrutherford 93a03a8
unify native & wasm span macro calls
mattrutherford 2126d8e
implement wasm tracing control facility in primitives and frame
mattrutherford 0d48517
add cli flag `--wasm-tracing`
mattrutherford e01ae89
fix
mattrutherford 2db5f89
switch to `Option<u4>` (possible performance degradation), switch
mattrutherford c9c7e9c
performance improvement using u64 vs Option<u64>
mattrutherford e3bdb79
performance improvement moving concat to client
mattrutherford 10a07a6
update docs
mattrutherford 2b73ed7
Update client/cli/src/params/import_params.rs
mattrutherford cff0aa2
performance improvement
mattrutherford 27c8a8f
Merge remote-tracking branch 'origin/mr-sp-tracing' into mr-sp-tracing
mattrutherford 70e6315
Revert "performance improvement"
mattrutherford dc335e9
small refactor
mattrutherford 955fa15
formatting
mattrutherford cd563c3
bump impl_version
mattrutherford 1bc601f
Update client/cli/src/config.rs
mattrutherford 691129d
Merge branch 'master' into mr-sp-tracing
mattrutherford e78dd7e
Merge branch 'master' into mr-sp-tracing
mattrutherford 22bb40f
Merge branch 'master' into mr-sp-tracing
mattrutherford a63e6d5
update docs
mattrutherford 88d3da1
Merge branch 'master' into mr-sp-tracing
mattrutherford 7228358
small fixes, remove pub static
mattrutherford d735529
nit
mattrutherford de94f07
add integration tests and refactor Subscriber
mattrutherford 8901340
Merge branch 'master' into mr-sp-tracing
mattrutherford 179a515
tests
mattrutherford a2fbef3
revert formatting
mattrutherford 74ec338
try fix test that works locally but not in CI
mattrutherford 749657b
try fix test that works locally but not in CI
mattrutherford 248f767
debug test that works locally but not in CI
mattrutherford 19cf0f9
fix test that works locally but not in CI
mattrutherford ffe508a
remove pub visibility from bool in runtime
mattrutherford d5ba777
make TracingSpanGuard #[cfg(not(feature = "std"))], update docs, comm…
mattrutherford 25e24c4
make TracingProxy drop implementation conditional on !empty state
mattrutherford da72fbd
add docs for TraceHandler
mattrutherford f7adde5
remove blank line
mattrutherford bed5bcb
update expect message
mattrutherford 6f3602e
update tests
mattrutherford 31b4cc1
merge master
mattrutherford 1f016b9
rename cli option to tracing_enable_wasm
mattrutherford 2a48d0a
rename cli option to tracing_enable_wasm
mattrutherford 01693e0
fix
mattrutherford 19d832c
merge master
mattrutherford a17775c
ensure wasm-tracing features are wasm only
mattrutherford 2aa7c72
bump impl_version
mattrutherford 3b7044d
Merge branch 'master' into mr-sp-tracing
mattrutherford bc9ec21
bump impl_version
mattrutherford 32b8e36
add `"pallet-scheduler/std"` to `[features]` `std` in node/runtime
mattrutherford 9835a01
refactor service to remove sp_tracing dependency
mattrutherford 50e4c9c
Merge branch 'master' into mr-sp-tracing
mattrutherford 8b16881
refactor: line width, trait bounds
mattrutherford 068fd94
improve LogTraceHandler output
mattrutherford 14a90ae
fix test
mattrutherford 95b8832
Merge branch 'master' into mr-sp-tracing
mattrutherford b822794
improve tracing log output
mattrutherford 157a639
Apply suggestions from code review
bkchr 88c3d71
Apply suggestions from code review
mattrutherford 4150780
Merge branch 'master' into mr-sp-tracing
mattrutherford 07a0c56
Merge branch 'mr-sp-tracing' of github.com:paritytech/substrate into …
mattrutherford c36fc2a
swap wasm indication from trace name to a separate value
mattrutherford ca77a6a
Merge branch 'master' into mr-sp-tracing
mattrutherford d9ebb3b
Update client/tracing/src/lib.rs
bkchr 1811e05
add docs
mattrutherford File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| // Copyright 2020 Parity Technologies (UK) Ltd. | ||
| // This file is part of Substrate. | ||
|
|
||
| // Substrate is free software: you can redistribute it and/or modify | ||
| // it under the terms of the GNU General Public License as published by | ||
| // the Free Software Foundation, either version 3 of the License, or | ||
| // (at your option) any later version. | ||
|
|
||
| // Substrate is distributed in the hope that it will be useful, | ||
| // but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| // GNU General Public License for more details. | ||
|
|
||
| // You should have received a copy of the GNU General Public License | ||
| // along with Substrate. If not, see <http://www.gnu.org/licenses/>. | ||
|
|
||
| //! # To allow tracing in WASM execution environment | ||
| //! | ||
| //! Facilitated by `sp_io::wasm_tracing` | ||
|
|
||
| /// This holds a tracing span id and is to signal on drop that a tracing span has exited. | ||
| /// It must be bound to a named variable eg. `_span_guard`. | ||
| pub struct TracingSpanGuard(pub u64); | ||
mattrutherford marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| impl Drop for TracingSpanGuard { | ||
| fn drop(&mut self) { | ||
| crate::sp_io::wasm_tracing::exit_span(self.0); | ||
| } | ||
| } | ||
|
|
||
| /// Enters a tracing span, via [`sp_tracing::proxy`] measuring execution time | ||
| /// until exit from the current scope. | ||
| /// | ||
| /// # Example | ||
| /// | ||
| /// ``` | ||
| /// # use frame_support::wasm_tracing; | ||
| /// wasm_tracing_span!("target", "fn_name"); | ||
| /// ``` | ||
| #[macro_export] | ||
| macro_rules! wasm_tracing_span { | ||
| ( $target:expr, $name:expr ) => { | ||
| #[cfg(not(feature = "std"))] | ||
| let __span_id__ = $crate::wasm_tracing::TracingSpanGuard( | ||
mattrutherford marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| $crate::sp_io::wasm_tracing::enter_span($target, $name) | ||
| ); | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.