File tree 2 files changed +7
-5
lines changed
2 files changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -54,9 +54,9 @@ fn setup_logger() -> Option<tracing_chrome::FlushGuard> {
54
54
. with_filter ( env) ;
55
55
56
56
let ( profile_layer, profile_guard) =
57
- if env_to_bool ( std:: env:: var_os ( "__CARGO_LOG_PROFILE " ) . as_deref ( ) ) {
57
+ if env_to_bool ( std:: env:: var_os ( "CARGO_LOG_PROFILE " ) . as_deref ( ) ) {
58
58
let capture_args =
59
- env_to_bool ( std:: env:: var_os ( "__CARGO_LOG_PROFILE_CAPTURE_ARGS " ) . as_deref ( ) ) ;
59
+ env_to_bool ( std:: env:: var_os ( "CARGO_LOG_PROFILE_CAPTURE_ARGS " ) . as_deref ( ) ) ;
60
60
let ( layer, guard) = tracing_chrome:: ChromeLayerBuilder :: new ( )
61
61
. include_args ( capture_args)
62
62
. build ( ) ;
Original file line number Diff line number Diff line change @@ -6,18 +6,20 @@ Cargo leverages [tracing](https://crates.io/crates/tracing)
6
6
as a basic, hierarchical built-in profiler.
7
7
8
8
Environment variables:
9
- - ` __CARGO_LOG_PROFILE =<true|1>` : log tracing events to a file in the current working directory
10
- - ` __CARGO_LOG_PROFILE_CAPTURE_ARGS =<true|1>` : include arguments in the events
9
+ - ` CARGO_LOG_PROFILE =<true|1>` : log tracing events to a file in the current working directory
10
+ - ` CARGO_LOG_PROFILE_CAPTURE_ARGS =<true|1>` : include arguments in the events
11
11
12
12
At process exit, your trace will be in a file like ` trace-1668480819035032.json ` .
13
13
Open that file with [ ui.perfetto.dev] ( https://ui.perfetto.dev ) (or chrome://tracing) to browse your trace.
14
14
15
15
Example:
16
16
``` console
17
17
$ # Output first three levels of profiling info
18
- $ __CARGO_LOG_PROFILE =true cargo generate-lockfile
18
+ $ CARGO_LOG_PROFILE =true cargo generate-lockfile
19
19
```
20
20
21
+ ** Note:** This is intended for the development of cargo and there are no compatibility guarantees on this functionality.
22
+
21
23
## Benchmarking
22
24
23
25
### Benchsuite
You can’t perform that action at this time.
0 commit comments