Cpp Perfetto Trace

The Library

This is a tiny C++ library that allows you to create stack traces and view them as demonstrated in this image. More can be found at https://www.github.com/SebastianTroy/CppPerfettoTrace
There are more sophistacted ways to create stack traces, especially ones without runtime performance issues, and code compilation impacts, however these tools are frequently very fussy about platform, toolchain, presence of symbols e.t.c.

The Library

This free analysis tool is incredibly powerful, can analyse MASSIVE files and provides a very intuitive way to visualise, pan/zoom, and select events for further analysis of runtime, frequency e.t.c.
This image shows a demo trace provided by the website itself containing millions of events, all with snappy realtime cross-platform web-based viewing. https://www.ui.perfetto.dev/


Unless there is some external interest in this tool I am just going to update it as and when I want a new feature, however there are quite a few more interesting features that could be added beyond simple stack traces. For example it could be very useful to trace the value of a variable and see a graph of the value displayed on the timeline aligned with the stack trace.