From 1ed9564ffd2145ab290903d73a8cc774147c5432 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Fri, 4 Aug 2017 16:26:26 +0200 Subject: Graph profiling: allow to override max DSP thread count & calc avg. --- libs/ardour/ardour/dsp_load_calculator.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'libs/ardour/ardour/dsp_load_calculator.h') diff --git a/libs/ardour/ardour/dsp_load_calculator.h b/libs/ardour/ardour/dsp_load_calculator.h index c7c0c0b83e..88b327bb30 100644 --- a/libs/ardour/ardour/dsp_load_calculator.h +++ b/libs/ardour/ardour/dsp_load_calculator.h @@ -19,6 +19,7 @@ #ifndef ARDOUR_DSP_LOAD_CALCULATOR_H #define ARDOUR_DSP_LOAD_CALCULATOR_H +#include #include #include #include @@ -68,8 +69,14 @@ public: return; } +#ifndef NDEBUG + const bool calc_avg_load = NULL != getenv("AVGLOAD"); +#else + const bool calc_avg_load = false; +#endif + const float load = (float) elapsed_time_us() / (float)m_max_time_us; - if (load > m_dsp_load || load > 1.0) { + if ((calc_avg_load && load > .95f) || (!calc_avg_load && (load > m_dsp_load || load > 1.f))) { m_dsp_load = load; } else { const float alpha = 0.2f * (m_max_time_us * 1e-6f); -- cgit v1.2.3