aclysma / profiling

Provides a very thin abstraction over instrumented profiling crates like puffin, optick, tracy, and superluminal-perf.
Apache License 2.0
319 stars 39 forks source link

Update `tracy-client` dependency to support Tracy 0.8.2 #41

Closed Latias94 closed 1 year ago

Latias94 commented 1 year ago

Update the tracy-client dependency since https://github.com/nagisa/rust_tracy_client/issues/51 has been resolved.

Test success with profiling = { git = "https://github.com/Latias94/profiling", branch = "tracy-0.14.1" }

❯ cd profiling
❯ cargo update
    Updating crates.io index
    Updating tracy-client-sys v0.17.1 -> v0.18.0
❯ cargo tree --features="profile-with-tracy"
profiling v1.0.6 (D:\Github-Projects\profiling)
├── profiling-procmacros v1.0.6 (proc-macro) (D:\Github-Projects\profiling\profiling-procmacros)
│   ├── quote v1.0.21
│   │   └── proc-macro2 v1.0.46
│   │       └── unicode-ident v1.0.4
│   └── syn v1.0.101
│       ├── proc-macro2 v1.0.46 (*)
│       ├── quote v1.0.21 (*)
│       └── unicode-ident v1.0.4
└── tracy-client v0.14.1
    ├── once_cell v1.15.0
    └── tracy-client-sys v0.18.0
        [build-dependencies]
        └── cc v1.0.73
            └── jobserver v0.1.25
aclysma commented 1 year ago

I'll publish a bump to 0.14.1 soon, probably within the next day. (staging the change here.. https://github.com/aclysma/profiling/tree/candidate-1.0.7)

aclysma commented 1 year ago

I published 1.0.7 which uses newer tracy bindings.

I noticed in one of my projects when enabling tracy, I needed to change this:

        #[cfg(feature = "profile-with-tracy")]
        profiling::tracy_client::set_thread_name("Main Thread");

to

        #[cfg(feature = "profile-with-tracy")]
        profiling::tracy_client::Client::start();
        #[cfg(feature = "profile-with-tracy")]
        profiling::tracy_client::set_thread_name!("Main Thread");

(add call to Client::start() and make set_thread_name() a macro.)

FYI this is a breaking change if tracy profiling is enabled. Semver for this crate is only promised when all features are off. (profiling is only meant to be enabled locally, so published crates should never have enabled profiling features.) Bumping crate versions would result in fragmentation, somewhat self-defeating for the intent of this crate to let users instrumented-profile all the things.

Latias94 commented 1 year ago

I think this breaking change is introduced from profiling = "=1.0.6", see https://github.com/aclysma/profiling/pull/36.