Skip to content

RFC: how to integrate Tracy (and other custom tracing) for tracing marl #127

@benvanik

Description

@benvanik

Tracy is an absolutely fantastic tracing tool that we've recently fallen in love with. To be able to fully understand how marl is behaving with the rest of our application we need to integrate it with marl's trace.h.

Ideally instead of embedding Tracy events directly into marl we could make trace.h able to be extended by the integrator of marl itself. In header-only libraries this is generally done by allowing overrides (such as with the Vulkan Memory Allocator: https://github.com/google/iree/blob/master/iree/hal/vulkan/internal_vk_mem_alloc.cc#L28-L66), however overriding MARL_SCOPED_EVENT/etc is difficult without making direct changes as the macros are required during marl compilation.

The approach dear imgui takes is compatible in that it allows either include-path based overriding or completely custom path overriding by way of defines:
https://github.com/ocornut/imgui/blob/master/imgui.h#L40-L46

This would allow an integrator, for example, to have their own trace.h or trace-impl.h that defines the MARL_* tracing macros that will be used when building marl, overriding the current chrome tracing-based implementation.

Thoughts? Would you be open to a PR adding an optional MARL_USER_TRACE_H check?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions