$ perf record -g binary $ perf script | stackcollapse-perf.pl | rust-unmangle | flamegraph.pl > flame.svg
NOTE: See @GabrielMajeri's comments below about the
There's subtlety involved in doing this so I've just dumped this out from another document in case I ever need to remember what they were in the future.
Visit trait can be treated like a lightweight subset of
serde::Serialize that can interoperate with
serde, without necessarily depending on it. It can't be implemented manually:
/// A type that can be converted into a borrowed value.
|This example demonstrates a potential macro for capturing log properties.|
|The macro uses a syntax that's _similar_ to struct literals. The idea is to support|
|extensions to the way properties are captured using attributes.|
|There's a bit of a misalignment between how formatting is communicated in the log|
|message and the contextual properties, but they are a bit different. Args are slurped|
|up into the message using the formatting API whereas properties are exposed as data.|