13
0

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
This commit is contained in:
Paul Davis 2010-06-03 21:28:02 +00:00
parent db1fa42f14
commit 4d828729cd
3 changed files with 13 additions and 3 deletions

View File

@ -35,6 +35,7 @@ namespace PBD {
extern uint64_t Configuration;
extern uint64_t Latency;
extern uint64_t Processors;
extern uint64_t ProcessThreads;
extern uint64_t Graph;
extern uint64_t Destruction;
extern uint64_t MTC;

View File

@ -32,6 +32,7 @@ uint64_t PBD::DEBUG::SnapBBT = PBD::new_debug_bit ("snapbbt");
uint64_t PBD::DEBUG::Configuration = PBD::new_debug_bit ("configuration");
uint64_t PBD::DEBUG::Latency = PBD::new_debug_bit ("latency");
uint64_t PBD::DEBUG::Processors = PBD::new_debug_bit ("processors");
uint64_t PBD::DEBUG::ProcessThreads = PBD::new_debug_bit ("processthreads");
uint64_t PBD::DEBUG::Graph = PBD::new_debug_bit ("graph");
uint64_t PBD::DEBUG::Destruction = PBD::new_debug_bit ("destruction");
uint64_t PBD::DEBUG::MTC = PBD::new_debug_bit ("mtc");

View File

@ -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)