rust_tracy_client icon indicating copy to clipboard operation
rust_tracy_client copied to clipboard

Define custom source location for spans

Open Dinnerbone opened this issue 6 months ago • 1 comments

We have a bunch of code that's generated by another language, and a build script creates the rust bindings for every method defined in the other language. It'd be really nice to be able to generate a span_location!() for each method, pointing to the true original source and line number, rather than it just assuming that file!()/line!() works.

The easiest would probably just be adding those as extra values to the macro, e.g. span_location!(name, function, file, loc), but anything that works at compile time works for us. It'd get generated and stored in a giant pub const FUNCTIONS = .....

Dinnerbone avatar Aug 13 '24 17:08 Dinnerbone