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.
Currently,
probe_lazy!(provider, name, expensive().a, expensive().b)doesn't let me share the computation ofexpensive()(you are at the whim of the optimiser here).It would be good to be able to share this computation.
usdtis a crate for dtrace probes which allows this syntax:I don't know that this would work with the current design of
probebut having something which lets me only invoke expensive() once would be good.