diff --git a/libs/ardour/ardour/audioengine.h b/libs/ardour/ardour/audioengine.h index 935c008e3f..ec06eed4e5 100644 --- a/libs/ardour/ardour/audioengine.h +++ b/libs/ardour/ardour/audioengine.h @@ -250,6 +250,8 @@ class LIBARDOUR_API AudioEngine : public PortManager, public SessionHandlePtr void add_pending_port_deletion (Port*); void queue_latency_update (bool); + PBD::TimingStats dsp_stats; + private: AudioEngine (); diff --git a/libs/ardour/audioengine.cc b/libs/ardour/audioengine.cc index 8035e750a0..e5cb0d96f3 100644 --- a/libs/ardour/audioengine.cc +++ b/libs/ardour/audioengine.cc @@ -489,8 +489,12 @@ AudioEngine::process_callback (pframes_t nframes) /* tell all Ports that we're starting a new cycle */ - PortManager::cycle_start (nframes, _session); + { + PBD::TimerRAII tr (dsp_stats); + + PortManager::cycle_start (nframes, _session); + } /* test if we are freewheeling and there are freewheel signals connected. * ardour should act normally even when freewheeling unless /it/ is * exporting (which is what Freewheel.empty() tests for). diff --git a/libs/ardour/session.cc b/libs/ardour/session.cc index 238d4f2c8c..0b6e5abe89 100644 --- a/libs/ardour/session.cc +++ b/libs/ardour/session.cc @@ -7254,6 +7254,9 @@ Session::get_dsp_stats () const double avg; double dev; + AudioEngine::instance()->dsp_stats.get_stats (min, max, avg, dev); + ss << "Engine: " << min << ' ' << max << ' ' << avg << ' ' << dev << endl; + dsp_stats.get_stats (min, max, avg, dev); ss << "Session: " << min << ' ' << max << ' ' << avg << ' ' << dev << endl;