Skip to content
Snippets Groups Projects

Add algorithm to programmatically enable/disable perf

Merged Rosen Matev requested to merge rmatev/Gaudi:add-PerfProfile into master
Files
3
@@ -13,8 +13,6 @@
#include <string_view>
#include <sys/stat.h>
namespace {}
/** Algorithm to enable/disable profiling with Linux perf at given events.
*
* Needs at least perf 5.9. To control perf record, start it as
@@ -22,7 +20,7 @@ namespace {}
* perf record -D -1 --control fifo:GaudiPerfProfile.fifo ... gaudirun.py ...
*
* The path to the control fifo (GaudiPerfProfile.fifo) is configurable
* with the FIFOPath property. The fifo must be created before running the perf.
* with the FIFOPath property. The fifo must be created before running perf.
*
*/
struct PerfProfile final : Gaudi::Functional::Consumer<void()> {
@@ -40,7 +38,7 @@ struct PerfProfile final : Gaudi::Functional::Consumer<void()> {
}
StatusCode finalize() override {
::close( m_fifo );
if ( m_fifo != -1 ) { ::close( m_fifo ); }
return Consumer::finalize();
}
Loading