Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: use external crate for displaying tracing spans #4781

Merged
merged 3 commits into from
Sep 8, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions runtime/near-vm-runner-standalone/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ clap = "=3.0.0-beta.2"
base64 = "0.13"
strum = "0.20"
num-rational = "0.3"
tracing = "0.1"
tracing-subscriber = "0.2"
tracing-span-tree = "0.1"

near-vm-logic = { path = "../near-vm-logic", version = "3.0.0", features = ["costs_counting"]}
near-vm-runner = { path = "../near-vm-runner", version = "3.0.0", features = ["wasmtime_vm", "wasmer1_vm"] }
Expand Down
3 changes: 1 addition & 2 deletions runtime/near-vm-runner-standalone/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
//! Optional `--context-file=/tmp/context.json --config-file=/tmp/config.json` could be added
//! to provide custom context and VM config.
mod script;
mod tracing_timings;

use crate::script::Script;
use clap::Clap;
Expand Down Expand Up @@ -121,7 +120,7 @@ fn main() {
let cli_args = CliArgs::parse();

if cli_args.timings {
tracing_timings::enable();
tracing_span_tree::span_tree().enable();
}

let mut script = Script::default();
Expand Down
4 changes: 2 additions & 2 deletions runtime/near-vm-runner-standalone/src/script.rs
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ fn default_vm_context() -> VMContext {
fn vm_script_smoke_test() {
use near_vm_logic::ReturnData;

crate::tracing_timings::enable();
tracing_span_tree::span_tree().enable();

let mut script = Script::default();
script.contract_cache(true);
Expand Down Expand Up @@ -242,7 +242,7 @@ fn profile_data_is_per_outcome() {
fn test_evm_slow_deserialize_repro() {
fn evm_slow_deserialize_repro(vm_kind: VMKind) {
println!("evm_slow_deserialize_repro of {:?}", &vm_kind);
crate::tracing_timings::enable();
tracing_span_tree::span_tree().enable();

let mut script = Script::default();
script.vm_kind(vm_kind);
Expand Down
78 changes: 0 additions & 78 deletions runtime/near-vm-runner-standalone/src/tracing_timings.rs

This file was deleted.

4 changes: 2 additions & 2 deletions runtime/near-vm-runner/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,10 @@ tracing_subscriber::fmt::Subscriber::builder()
code_to_profile_here();
```

Alternatively, in the `standalone` crate we have a more compact hierarchical subscriber
Alternatively, there's an alternative hierarchical profiler

```rust
crate::tracing_timings::enable();
tracing_span_tree::span_tree().enable();;

code_to_profile_here();
```
Expand Down