Add some debug code to time things in the process
[ardour.git] / libs / ardour / session_process.cc
index 4876dc7931249953db79fe9b2c5047a3ae642da0..80f922117da4e4bf29deec16f1afc9a155ef4be6 100644 (file)
@@ -39,6 +39,7 @@
 #include "ardour/graph.h"
 #include "ardour/audio_port.h"
 #include "ardour/tempo.h"
+#include "ardour/cycle_timer.h"
 
 #include "midi++/manager.h"
 #include "midi++/mmc.h"
@@ -103,6 +104,8 @@ Session::fail_roll (pframes_t nframes)
 int
 Session::no_roll (pframes_t nframes)
 {
+       PT_TIMING_CHECK (4);
+       
        framepos_t end_frame = _transport_frame + nframes; // FIXME: varispeed + no_roll ??
        int ret = 0;
        bool declick = get_transport_declick_required();
@@ -112,10 +115,11 @@ Session::no_roll (pframes_t nframes)
                _click_io->silence (nframes);
        }
 
-       if (_process_graph->threads_in_use() > 0) {
+       if (1 || _process_graph->threads_in_use() > 0) {
                DEBUG_TRACE(DEBUG::ProcessThreads,"calling graph/no-roll\n");
                _process_graph->routes_no_roll( nframes, _transport_frame, end_frame, non_realtime_work_pending(), declick);
        } else {
+               PT_TIMING_CHECK (10);
                for (RouteList::iterator i = r->begin(); i != r->end(); ++i) {
 
                        if ((*i)->is_hidden()) {
@@ -130,8 +134,10 @@ Session::no_roll (pframes_t nframes)
                                break;
                        }
                }
+               PT_TIMING_CHECK (11);
        }
 
+       PT_TIMING_CHECK (5);
        return ret;
 }
 
@@ -242,6 +248,8 @@ Session::get_track_statistics ()
 void
 Session::process_with_events (pframes_t nframes)
 {
+       PT_TIMING_CHECK (3);
+       
        SessionEvent*  ev;
        pframes_t      this_nframes;
        framepos_t     end_frame;