rust_tracy_client icon indicating copy to clipboard operation
rust_tracy_client copied to clipboard

Proc macro attributes for instrumentation?

Open Boscop opened this issue 3 years ago • 2 comments

Thanks for making this crate. Is it possible to use proc macro attributes like this with this crate? :) https://kanejaku.org/posts/2020/10/tracy-profiler-zone-scoped-in-rust/

Boscop avatar Apr 30 '21 05:04 Boscop

There is an implementation of this in the profiling crate (which works with this crate): https://crates.io/crates/profiling

If there is interest in implementing this in this crate directly, feel free to "steal" this code :D It's pretty small and would allow more customization (like supporting custom scope colors.) The most annoying thing about it is that it requires a separate procmacro-specific crate. https://github.com/aclysma/profiling/blob/master/profiling-procmacros/src/lib.rs

aclysma avatar May 01 '21 18:05 aclysma

I'm happy to accept contributions, but overall this is handled through the more broadly applicable ecosystem tooling (tracing, profiling, etc.)

nagisa avatar May 01 '21 18:05 nagisa