diff options
author | Matt Mastracci <matthew@mastracci.com> | 2023-11-10 10:41:24 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-10 10:41:24 -0700 |
commit | 68607b593fc91df2844540d97c8aa807ccf01464 (patch) | |
tree | 9a3503ac6b5f1a3649c906de58f53d9fe1cb6414 /cli/worker.rs | |
parent | 05704fbf7803ecdcfb26a8445e120a8e559e4e95 (diff) |
perf(cli): strace mode for ops (undocumented) (#21131)
Example usage:
```
# Trace every op except op_*tick*
cargo run -- run --unstable -A --strace-ops=-tick '/Users/matt/Documents/github/deno/deno/ext/websocket/autobahn/autobahn_server.js
# Trace any op matching op_*http*
cargo run -- run --unstable -A --strace-ops=http ...
```
Example output:
```
[ 11.478] op_ws_get_buffer : Dispatched Slow
[ 11.478] op_ws_get_buffer : Completed Slow
[ 11.478] op_ws_send_binary : Dispatched Fast
[ 11.478] op_ws_send_binary : Completed Fast
[ 11.478] op_ws_next_event : Dispatched Async
[ 11.478] op_try_close : Dispatched Fast
[ 11.478] op_try_close : Completed Fast
[ 11.478] op_timer_handle : Dispatched Fast
[ 11.478] op_timer_handle : Completed Fast
[ 11.478] op_sleep : Dispatched Asyn
```
Diffstat (limited to 'cli/worker.rs')
-rw-r--r-- | cli/worker.rs | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/cli/worker.rs b/cli/worker.rs index 173d944c0..19fa40034 100644 --- a/cli/worker.rs +++ b/cli/worker.rs @@ -92,6 +92,7 @@ pub struct CliMainWorkerOptions { pub hmr: bool, pub inspect_brk: bool, pub inspect_wait: bool, + pub strace_ops: Option<Vec<String>>, pub is_inspecting: bool, pub is_npm_main: bool, pub location: Option<Url>, @@ -580,6 +581,7 @@ impl CliMainWorkerFactory { maybe_inspector_server, should_break_on_first_statement: shared.options.inspect_brk, should_wait_for_inspector_session: shared.options.inspect_wait, + strace_ops: shared.options.strace_ops.clone(), module_loader, fs: shared.fs.clone(), npm_resolver: Some(shared.npm_resolver.clone().into_npm_resolver()), |