Skip to content

Feature request: Expand on probe_lazy to support shared processing for multiple arguments #25

@VorpalBlade

Description

@VorpalBlade

Currently, probe_lazy!(provider, name, expensive().a, expensive().b) doesn't let me share the computation of expensive() (you are at the whim of the optimiser here).

It would be good to be able to share this computation.

usdt is a crate for dtrace probes which allows this syntax:

probe_macro!(|| { let tmp = expensive(); (tmp.a, tmp.b) });
// Or any other lambda that returns a tuple of the expected length.
// They define tracepoints separately from using them, so each tracepoint generates a unique macro.

I don't know that this would work with the current design of probe but having something which lets me only invoke expensive() once would be good.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions