summaryrefslogtreecommitdiff
path: root/libs/ardour/graph.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2010-06-03 21:28:02 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2010-06-03 21:28:02 +0000
commit4d828729cdcc9fe391ffc3ef973a490da0dcebbb (patch)
tree56d3e9f71b9eebdc947d28e81a9ca2fd1e1a4791 /libs/ardour/graph.cc
parentdb1fa42f14c54d9a9714aafe35d669a81469f964 (diff)
add DEBUG::ProcessThreads as a debug tag for parallelization (probably to be renamed)
git-svn-id: svn://localhost/ardour2/branches/3.0@7229 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/graph.cc')
-rw-r--r--libs/ardour/graph.cc14
1 files changed, 11 insertions, 3 deletions
diff --git a/libs/ardour/graph.cc b/libs/ardour/graph.cc
index 3c5fcc64f0..bd4a5fab31 100644
--- a/libs/ardour/graph.cc
+++ b/libs/ardour/graph.cc
@@ -17,6 +17,9 @@
*/
+#include "pbd/compose.h"
+
+#include "ardour/debug.h"
#include "ardour/graph.h"
#include "ardour/types.h"
#include "ardour/session.h"
@@ -39,6 +42,7 @@
#include <cmath>
using namespace ARDOUR;
+using namespace PBD;
static unsigned int hardware_concurrency()
{
@@ -76,7 +80,7 @@ Graph::Graph( Session & session )
_graph_empty = true;
int num_cpu = hardware_concurrency();
- printf( "found %d cpus\n", num_cpu );
+ DEBUG_TRACE (DEBUG::ProcessThreads, string_compose ("Using %1 CPUs via %1 threads\n", num_cpu));
_thread_list.push_back( Glib::Thread::create( sigc::mem_fun( *this, &Graph::main_thread ), 100000, true, true, Glib::THREAD_PRIORITY_NORMAL ) );
for (int i=1; i<num_cpu; i++)
_thread_list.push_back( Glib::Thread::create( sigc::mem_fun( *this, &Graph::helper_thread ), 100000, true, true, Glib::THREAD_PRIORITY_NORMAL ) );
@@ -305,11 +309,11 @@ Graph::run_one()
{
_execution_tokens += 1;
pthread_mutex_unlock( &_trigger_mutex );
- //printf( "going to sleep...\n" );
+ DEBUG_TRACE (DEBUG::ProcessThreads, string_compose ("%1 goes to sleep\n", pthread_self()));
sem_wait( &_execution_sem );
if (_quit_threads)
return true;
- //printf( "wake up...\n" );
+ DEBUG_TRACE (DEBUG::ProcessThreads, string_compose ("%1 is awake\n", pthread_self()));
pthread_mutex_lock( &_trigger_mutex );
if (_trigger_queue.size())
{
@@ -386,6 +390,7 @@ again:
void
Graph::dump( int chain )
{
+#ifndef NDEBUG
node_list_t::iterator ni;
node_set_t::iterator ai;
@@ -409,6 +414,7 @@ Graph::dump( int chain )
}
printf( "final activation refcount: %d\n", _init_finished_refcount[chain] );
+#endif
}
int
@@ -490,6 +496,8 @@ Graph::process_one_route( Route * route )
assert( route );
+ DEBUG_TRACE (DEBUG::ProcessThreads, string_compose ("%1 runs route %2\n", pthread_self(), route->name()));
+
if (_process_silent)
retval = route->silent_roll (_process_nframes, _process_start_frame, _process_end_frame, _process_can_record, _process_rec_monitors_input, need_butler);
else if (_process_noroll)