Commit Graph

32 Commits

Author SHA1 Message Date
Bayley Foster c66eb50bae Mention bevy/debug in tracy quickstart (#22217)
# Objective

Fixes #21956

## Solution

Add brief line on enabling `bevy/debug` feature if the user wants to
track Bevy's own systems.
2025-12-22 19:43:05 +00:00
laund c5c7598c38 Remove mention of tracy version from profiling docs (#21881)
# Objective

In
- #21565 
i added a note to the profiling docs that the correct tracy version for
bevy 0.17 is tracy 0.12.2
But in a recent patch release, the version of the tracy libraries was
bumped and now requires tracy 0.13. While this is a breaking change i
dont think should happen on path releases, it shows that my mentioning
of the version was way too optimistic, and its [already caused some
frustration](https://discord.com/channels/691052431525675048/691052431974465548/1440429953232535623)

## Solution

- remove the mention of any specific version from the docs

Co-authored-by: François Mockers <francois.mockers@vleue.com>
2025-11-22 12:30:14 +00:00
laund 318b987319 Improve Tracy profiling docs (quickstart, split into sections) (#21565)
# Objective

The Tracy profiling docs were confusing and overwhelming to some for a
number of reasons:
- only mentioning that you can capture through the UI in a single
sentence quite a bit down
- interspersed installation, version-matching and usage instructions
- lack of clear steps
- lack of separation between topics

## Solution

I've added a Quickstart which guides people through using the Tracy UI
to capture, including some more installation instructions for various
platforms (unofficial macos/linux binary builds, link to repology
packages list).

Additionally, I've created the following sub-titles (sub-headers?)
- `Finding the correct tracy version`
- `Commandline capture (less overhead)`, which is where most of the
previous instructions ended up
- `Using the Tracy UI`, for the basic usage guide with screenshots

Rendered version:
https://github.com/laundmo/bevy/blob/improve-tracy-profiling-docs/docs/profiling.md#tracy-profiler
2025-10-16 21:44:46 +00:00
Weihnachtsbaum 16ffdaea0d Improve tracing level docs in profiling.md (#20692)
# Objective

- If you have `tracing`'s `max_level(_release)_[warn/error]` features
enabled, it can be confusing that profiling doesn't work properly (or at
least it confused me for a bit...)
- The `LogSettings` resource [doesn't exist
anymore](https://bevy.org/learn/migration-guides/0-8-to-0-9/#use-plugin-setup-for-resource-only-used-at-setup-time),
but is still mentioned in the docs

## Solution

- Update profiling.md to be as clear as possible

---------

Co-authored-by: Alice Cecile <alice.i.cecile@gmail.com>
Co-authored-by: Stanislas Signoud <signez@stanisoft.net>
2025-08-26 20:51:34 +00:00
Weihnachtsbaum 83c0c3206b Fix CI in profiling.md (#20761)
# Objective

- Fixes #20757

## Solution

- ~~Rephrase profiling.md~~ Remove the text that causes the failure, as
there are better instructions just above

---------

Co-authored-by: François Mockers <francois.mockers@vleue.com>
2025-08-26 19:41:51 +00:00
liamaharon 0294fa89db Mitigate Tracy dep version woes (#20109)
# Objective

Turns out, Tracy dep (in)compatibilities can be a headache. Here was my
experience following the [Profiling Tracy
documentation](https://github.com/bevyengine/bevy/blob/1525dff7ada14714b35c8908381d534a7833faa3/docs/profiling.md#tracy-profiler):

I ran into this error when I attempted to connect to my bevy client:

<img width="473" height="154" alt="Screenshot 2025-07-13 at 14 39 27"
src="https://github.com/user-attachments/assets/97634b37-253c-40ab-86ca-6eba02985638"
/>

Attempting to find where the version incompatibility stemmed, I found
these tracy dep versions and a link to the compatibility table in the
source:

https://github.com/bevyengine/bevy/blob/1525dff7ada14714b35c8908381d534a7833faa3/crates/bevy_log/Cargo.toml#L32-L35

This led me to believe I needed Tracy `0.11.1`, to match the
`tracy-client` version `0.18.0`.

This was confusing because `0.11.1` is the version I already had
installed (by running `brew install tracy`), and latest Tracy version
currently available on `brew`.

It turned out that Cargo was eagerly pulling `tracy-client` `0.18.2`
instead of `0.18.0`, making the Tracy version I needed actually
`0.12.2`. At the time of writing, `0.12.2` is not published on `brew`.

## Solution

I've pinned the Tracy deps, and mentioned in the comment which Tracy
version Bevy is compatible with.

I've also added some notes to [Profiling Tracy
documentation](https://github.com/bevyengine/bevy/blob/1525dff7ada14714b35c8908381d534a7833faa3/docs/profiling.md#tracy-profiler)
to explain
- How to determine which Tracy version to install
- That MacOS users may need to compile from source if the required Tracy
version is not available on `brew`.

## Testing

- Did you test these changes? If so, how?
I ran Tracy locally.

- Are there any parts that need more testing?
I don't think so.

- How can other people (reviewers) test your changes? Is there anything
specific they need to know?
Follow instructions to run Tracy

- If relevant, what platforms did you test these changes on, and are
there any important ones you can't test?
Tested MacOS. I think change should be OS agnostic.
2025-07-14 20:58:30 +00:00
jf908 c8cdb1197e Add instructions for GPU debugging in Xcode (#19915)
# Objective

- Using Xcode can be confusing to setup for rust projects.

# Solution

- Add instructions to docs/profiling.md for how to use start debugging a
bevy project with Xcode's GPU debugging/profiling tools.
2025-07-02 14:55:25 +00:00
JMS55 f4a5e8bc51 Tracy GPU support (#18490)
# Objective

- Add tracy GPU support

## Solution

- Build on top of the existing render diagnostics recording to also
upload gpu timestamps to tracy
- Copy code from https://github.com/Wumpf/wgpu-profiler

## Showcase

![image](https://github.com/user-attachments/assets/4dd7a7cd-bc0b-43c3-8390-6783dfda6473)
2025-03-28 04:57:01 +00:00
François Mockers 70514229da Build performance advice (#18339)
# Objective

- Fixes #18331 

## Solution

- Add some info on other tools that `cargo timings`
2025-03-16 11:37:41 +00:00
JMS55 83c729162f Improve profiling instructions (#16299)
# Objective

- Make it easier to understand how to profile things.
- Talk about CPU vs GPU work for graphics.

## Solution

- Add a section on GPU profiling and CPU vs GPU work.
- Rearrange some sections so Tracy is the first backend mentioned.

## Issues
I did this as a very quick fix to clear some things up, but the overall
guide still flows poorly and has too much extraneous info distracting
from the use case of "I just want to figure out why my app is slow",
where the advice should be "use tracy, and if GPU bottlenecked, do
this". Someone should do a full rewrite at some point.

I chose to omit talking about RenderDiagnosticsPlugin, but it's
definitely worth a mention as a way to easily check GPU + GPU time for
graphics work, although it's not hooked up in a lot of the engine, iirc
only shadows and the main passes. Again someone else should write about
it in the future.

Similarly it might've been useful to have a section describing how to
use NSight/RGP/IGA/Xcode for GPU profiling, as they're far from
intuitive tools.
2024-12-05 18:41:58 +00:00
Matty b30b0a731c Add Mac OS tracy info to profiling docs (#13826)
## Explanation

I got kind of lost on this earlier (the Tracy docs are not very helpful)
and required some assistance, so I thought it might be helpful to add
this somewhere in the profiling docs. The way it's presently inserted is
kind of awkward, but I don't know enough about the other operating
systems to make similar sections for them, which I think would be
helpful, since it's going to be different on each one.

---------

Co-authored-by: Jerome Humbert <djeedai@gmail.com>
Co-authored-by: Alice Cecile <alice.i.cecile@gmail.com>
Co-authored-by: Jan Hohenheim <jan@hohenheim.ch>
2024-07-08 01:21:52 +00:00
theotherphil 54f1c4e21f Document trace_tracy_memory in profiling.md (#13755)
# Objective

Document how to use Tracy memory profiling.

Fixes https://github.com/bevyengine/bevy/issues/8417.

## Solution

Expand Tracy documentation in profiling.md.

## Testing

New documentation tested manually; no code changes made.
2024-06-25 12:57:19 +00:00
Ame 56c3079586 fix link to tracy (#11521)
# Objective

#11331 move the tracy dependency, this remove the line number to avoid
keeping the link in sync

---------

Co-authored-by: Alice Cecile <alice.i.cecile@gmail.com>
2024-01-27 19:23:37 +00:00
Ame 8c0ce5280b Standardize toml format with taplo (#10594)
# Objective

- Standardize fmt for toml files

## Solution

- Add [taplo](https://taplo.tamasfe.dev/) to CI (check for fmt and diff
for toml files), for context taplo is used by the most popular extension
in VScode [Even Better
TOML](https://marketplace.visualstudio.com/items?itemName=tamasfe.even-better-toml
- Add contribution section to explain toml fmt with taplo.
 
Now to pass CI you need to run `taplo fmt --option indent_string=" "` or
if you use vscode have the `Even Better TOML` extension with 4 spaces
for indent

---------

Co-authored-by: Alice Cecile <alice.i.cecile@gmail.com>
2023-11-21 01:04:14 +00:00
Lixou 449dd863dd Fix Line for tracy version (#10663)
# Objective

Linenumber in link was wrong

## Solution

Fix it
2023-11-20 17:05:25 +00:00
Rob Parrett e076657d12 Better link for prepare_windows docs (#10142)
# Objective

While pointing someone to the profiling doc, I saw a source link and
thought "hm, I wonder if that link is up-to-date?"

After clicking on it, I realized that it wasn't even attempting to point
to the right line -- probably a good idea since that would be super
prone to breakage.

However, the system being referenced is pub and the docs are on docs.rs,
so we can just link there. This gets the content straight onto the
user's screen.

## Solution

Change source link to docs link

## Note

This is slightly awkward in that the profiling docs themselves aren't
rendered anywhere and just live in the repo. It does feel more correct
to link to in-repo code on the same branch.
2023-10-16 17:08:46 +00:00
Trent ebdf5063df Include note of common profiling issue (#9484)
- Includes a note about a common issue seen when profiling with span
based tracing tools
- Adds a table of contents to profile.md


[Rendered](https://github.com/tbillington/bevy/blob/profiling-doc-update/docs/profiling.md).


[Suggested](https://discord.com/channels/691052431525675048/866787577687310356/1141612079460139108)
by Jasmine on discord.

---------

Co-authored-by: JMS55 <47158642+JMS55@users.noreply.github.com>
2023-08-22 14:45:54 +00:00
Alice Cecile ee0e6f4855 Process 1 in Chrome tracing starts expanded (#8024) 2023-03-11 03:04:41 +00:00
Mike e4d54739e7 add link to tracy compatibility table (#7144)
# Objective

- Fixes https://github.com/bevyengine/bevy/issues/5200
2023-01-10 17:07:27 +00:00
James Liu 10898d1dc9 Docs: Show how to compare two different traces in Tracy (#6869)
# Objective
Fixes #5199.

## Solution
Mention how to compare two different saved tracy traces in the profiling section.
2022-12-07 22:57:27 +00:00
Olivia Crain 176d7df5db docs: Use correct cargo-flamegraph upstream repo URL (#6873)
# Objective

Links to `cargo-flamegraph`'s repo point to a [fork](https://github.com/killercup/cargo-flamegraph), not the actual upstream repo. We should point to the source of truth instead of a fork that hasn't been updated since 2019.

## Solution

Change links to point to the upstream repo at  [flamegraph-rs/flamegraph](https://github.com/flamegraph-rs/flamegraph).
2022-12-07 21:23:20 +00:00
ira 92e78a4bc5 Fix some grammatical errors in the docs (#6109)
Co-authored-by: devil-ira <justthecooldude@gmail.com>
2022-09-26 21:47:31 +00:00
Robert Swain dfe9690052 docs: Add section about using Tracy for profiling (#4534)
# Objective

- Document how to do profiling with Tracy

# Solution

- The documentation of setting `RUST_LOG=info` in order to capture `wgpu` spans depends on https://github.com/bevyengine/bevy/pull/5182
2022-07-04 17:31:47 +00:00
ira ef032040dd Cargo --timings option has been stabilized. Update profiling.md. (#4850)
As of https://github.com/rust-lang/cargo/pull/10245 `--timings` has been stabilized.
Update profiling.md to reflect this.

Co-authored-by: devil-ira <justthecooldude@gmail.com>
2022-05-30 21:16:48 +00:00
Carter Anderson de677dbfc9 Use more ergonomic span syntax (#4246)
Tracing added support for "inline span entering", which cuts down on a lot of complexity:

```rust
let span = info_span!("my_span").entered();
```

This adapts our code to use this pattern where possible, and updates our docs to recommend it.

This produces equivalent tracing behavior. Here is a side by side profile of "before" and "after" these changes.
![image](https://user-images.githubusercontent.com/2694663/158912137-b0aa6dc8-c603-425f-880f-6ccf5ad1b7ef.png)
2022-03-18 04:19:21 +00:00
Thomas Versteeg c4f132afbf Fix call with features in docs/profiling.md (#3967)
Features must be called with the crate, otherwise the following error is thrown:

> error: none of the selected packages contains these features: trace_chrome
2022-02-17 18:51:43 +00:00
François 3974e02fd1 Enable trace feature for subfeatures using it (#3337)
# Objective

- It isn't very useful to be able to enable feature `trace_chrome` on its own

## Solution

- Enable `trace` feature when enabling `trace_chrome` or `trace_tracy`


Co-authored-by: François <8672791+mockersf@users.noreply.github.com>
2021-12-18 00:09:22 +00:00
Carter Anderson 71f4ff46f1 fix markdownlint (#3128)
I just updated profiling.md (and accidentally skipped the pr process by not checking "create new branch" in the github ui). The markdown wasn't properly formatted, which broke the build.
2021-11-13 20:35:30 +00:00
Carter Anderson 2615ec5647 Improve profiling.md 2021-11-13 12:25:01 -08:00
CGMossa 58eb7e7e05 Documenting small things here and there.. (#706)
Documenting small things here and there..
2020-10-21 15:57:03 -07:00
Carter Anderson f4b07ec9c7 update profiling doc 2020-06-10 00:24:28 -07:00
Carter Anderson 7a1036fa0b add quick profiling doc 2020-02-10 22:13:05 -08:00