C++ class to instrument code using Linux Perf