Skip to content

Commit 6d8708a

Browse files
committed
fix(cli): Remove __ prefix
1 parent caf4c30 commit 6d8708a

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

src/bin/cargo/main.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,9 @@ fn setup_logger() -> Option<tracing_chrome::FlushGuard> {
5454
.with_filter(env);
5555

5656
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()) {
5858
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());
6060
let (layer, guard) = tracing_chrome::ChromeLayerBuilder::new()
6161
.include_args(capture_args)
6262
.build();

src/doc/contrib/src/tests/profiling.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,20 @@ Cargo leverages [tracing](https://crates.io/crates/tracing)
66
as a basic, hierarchical built-in profiler.
77

88
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
1111

1212
At process exit, your trace will be in a file like `trace-1668480819035032.json`.
1313
Open that file with [ui.perfetto.dev](https://ui.perfetto.dev) (or chrome://tracing) to browse your trace.
1414

1515
Example:
1616
```console
1717
$ # Output first three levels of profiling info
18-
$ __CARGO_LOG_PROFILE=true cargo generate-lockfile
18+
$ CARGO_LOG_PROFILE=true cargo generate-lockfile
1919
```
2020

21+
**Note:** This is intended for the development of cargo and there are no compatibility guarantees on this functionality.
22+
2123
## Benchmarking
2224

2325
### Benchsuite

0 commit comments

Comments
 (0)