Skip to content

Commit

Permalink
Update for --profile flag. (#6773)
Browse files Browse the repository at this point in the history
  • Loading branch information
anthonyshew authored Dec 12, 2023
1 parent fe6ddbd commit af15005
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 34 deletions.
87 changes: 53 additions & 34 deletions docs/pages/repo/docs/reference/command-line-reference/run.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,8 @@ turbo run dev --parallel --no-cache
Generates a trace of the run in Chrome Tracing format that you can use to analyze performance.
The profile can be viewed in [Perfetto](https://ui.perfetto.dev/).

You must provide a verbosity flag (`-v`, `-vv`, or `-vvv`) with the `--profile` to produce a trace.

```sh
turbo run build --profile=profile.json
```
Expand Down Expand Up @@ -406,35 +408,32 @@ turbo run build --preflight

The same behavior can also be set via the `TURBO_PREFLIGHT=true` environment variable.

### `--trace`

`type: string`
### `--verbosity`

To view CPU trace, outputs the trace to the given file, use `go tool trace [file]`.
To specify log level, use `--verbosity=<num>` or `-v, -vv, -vvv`.

<Callout>
**Important**: The trace viewer doesn't work under Windows Subsystem for
Linux.
</Callout>
- `Info `: `--verbosity=1`, or `-v`
- `Debug`: `--verbosity=2`, or `-vv`
- `Trace`: `--verbosity=3`, or `-vvv`

```sh
turbo run build --trace="<trace-file-name>"
turbo run build -v
turbo run build --verbosity=2
turbo run build -vvv
```

### `--heap`

`type: string`

To view heap trace, outputs the trace to the given file, use `go tool pprof [file]` and type `top`. You can also drop it into [speedscope](https://www.speedscope.app/) and use the `left heavy` or `sandwich` view modes.

```sh
turbo run build --heap="<heap-file-name>"
```
## Deprecated Options

### `--cpuprofile`

`type: string`

<Callout type="error">
`--cpuprofile` is deprecated in `1.11.x`. Please use
[`--profile`](#--profile)
instead.
</Callout>

To view CPU profile, outputs the profile to the given file, drop the file into [speedscope](https://www.speedscope.app/).

<Callout>
Expand All @@ -447,22 +446,6 @@ To view CPU profile, outputs the profile to the given file, drop the file into [
turbo run build --cpuprofile="<cpu-profile-file-name>"
```

### `--verbosity`

To specify log level, use `--verbosity=<num>` or `-v, -vv, -vvv`.

- `Info `: `--verbosity=1`, or `-v`
- `Debug`: `--verbosity=2`, or `-vv`
- `Trace`: `--verbosity=3`, or `-vvv`

```sh
turbo run build -v
turbo run build --verbosity=2
turbo run build -vvv
```

## Deprecated Options

### `--include-dependencies`

<Callout type="error">
Expand Down Expand Up @@ -502,6 +485,21 @@ cached. Then, you change a line of code in B. With the `--deps` flag on, running
because they are not impacted by the change. If you were to run
`turbo run build --no-deps` instead, turbo will only run `build` in B.

### `--heap`

<Callout type="error">
`--heap` is deprecated in `1.2.x`. Please use
[`--profile`](#--profile) instead.
</Callout>

`type: string`

To view heap trace, outputs the trace to the given file, use `go tool pprof [file]` and type `top`. You can also drop it into [speedscope](https://www.speedscope.app/) and use the `left heavy` or `sandwich` view modes.

```sh
turbo run build --heap="<heap-file-name>"
```

### `--scope`

<Callout type="error">
Expand Down Expand Up @@ -539,6 +537,27 @@ turbo run build --since=origin/main
input files for a workspace exist inside their respective workspace folders.
</Callout>

### `--trace`

<Callout type="error">
`--trace` is deprecated in `1.11.x`, use
[`--profile`](#--profile)
instead.
</Callout>

`type: string`

To view CPU trace, outputs the trace to the given file, use `go tool trace [file]`.

<Callout>
**Important**: The trace viewer doesn't work under Windows Subsystem for
Linux.
</Callout>

```sh
turbo run build --trace="<trace-file-name>"
```

[1]: /repo/docs/reference/configuration#passThroughEnv
[2]: /repo/docs/reference/configuration#globalPassThroughEnv
[3]: /repo/docs/core-concepts/monorepos/filtering
3 changes: 3 additions & 0 deletions profile.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[

]

1 comment on commit af15005

@vercel
Copy link

@vercel vercel bot commented on af15005 Dec 12, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.