google / benchmark

A microbenchmark support library
Apache License 2.0
8.93k stars 1.61k forks source link

[FR] Add support for adding custom profilers #1807

Open xdje42 opened 3 months ago

xdje42 commented 3 months ago

It is useful to get a trace of a benchmark, e.g., with DynamoRio (https://dynamorio.org/).

What's needed is a public API akin to the MemoryManager API that provides for wrapping the running of the benchmark. Suitable binaries can register the profiler (akin to how a memory manager is specified), and the framework can invoke the profiler during the run (again, akin to how memory manager is handled).