mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-07 15:25:01 +01:00
abstractUI: pseudo-no-op: debug trace message expansion, and some reformatting
This commit is contained in:
parent
5d023b4c60
commit
6e65e9c82f
2 changed files with 12 additions and 9 deletions
|
|
@ -115,10 +115,12 @@ EventLoop::get_request_buffers_for_target_thread (const std::string& target_thre
|
||||||
vector<ThreadBufferMapping> ret;
|
vector<ThreadBufferMapping> ret;
|
||||||
Glib::Threads::RWLock::WriterLock lm (thread_buffer_requests_lock);
|
Glib::Threads::RWLock::WriterLock lm (thread_buffer_requests_lock);
|
||||||
|
|
||||||
for (ThreadRequestBufferList::const_iterator x = thread_buffer_requests.begin();
|
DEBUG_TRACE (PBD::DEBUG::EventLoop, string_compose ("%1 look for request buffers via %2\n", pthread_name(), target_thread));
|
||||||
x != thread_buffer_requests.end(); ++x) {
|
|
||||||
|
for (ThreadRequestBufferList::const_iterator x = thread_buffer_requests.begin(); x != thread_buffer_requests.end(); ++x) {
|
||||||
|
|
||||||
if (x->second.target_thread_name == target_thread) {
|
if (x->second.target_thread_name == target_thread) {
|
||||||
|
DEBUG_TRACE (PBD::DEBUG::EventLoop, string_compose ("for thread \"%1\", request buffer for %2/%3 thread %4\n", target_thread, x->first, x->second.emitting_thread));
|
||||||
ret.push_back (x->second);
|
ret.push_back (x->second);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -129,8 +131,7 @@ EventLoop::get_request_buffers_for_target_thread (const std::string& target_thre
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
EventLoop::register_request_buffer_factory (const string& target_thread_name,
|
EventLoop::register_request_buffer_factory (const string& target_thread_name, void* (*factory)(uint32_t))
|
||||||
void* (*factory)(uint32_t))
|
|
||||||
{
|
{
|
||||||
|
|
||||||
RequestBufferSupplier trs;
|
RequestBufferSupplier trs;
|
||||||
|
|
@ -141,6 +142,7 @@ EventLoop::register_request_buffer_factory (const string& target_thread_name,
|
||||||
Glib::Threads::RWLock::WriterLock lm (thread_buffer_requests_lock);
|
Glib::Threads::RWLock::WriterLock lm (thread_buffer_requests_lock);
|
||||||
request_buffer_suppliers.push_back (trs);
|
request_buffer_suppliers.push_back (trs);
|
||||||
}
|
}
|
||||||
|
DEBUG_TRACE (PBD::DEBUG::EventLoop, string_compose ("event loop %1 registered a buffer factory for %2\n", pthread_name(), target_thread_name));
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
||||||
|
|
@ -89,6 +89,7 @@ AbstractUI<RequestObject>::AbstractUI (const string& name)
|
||||||
|
|
||||||
for (vector<EventLoop::ThreadBufferMapping>::iterator t = tbm.begin(); t != tbm.end(); ++t) {
|
for (vector<EventLoop::ThreadBufferMapping>::iterator t = tbm.begin(); t != tbm.end(); ++t) {
|
||||||
request_buffers[t->emitting_thread] = static_cast<RequestBuffer*> (t->request_buffer);
|
request_buffers[t->emitting_thread] = static_cast<RequestBuffer*> (t->request_buffer);
|
||||||
|
DEBUG_TRACE (PBD::DEBUG::AbstractUI, string_compose ("%6: %1/%2/%3 create pre-registered request buffer-A @ %4 for %5\n", event_loop_name(), pthread_name(), pthread_self(), t->request_buffer, t->emitting_thread, this));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -192,7 +193,7 @@ AbstractUI<RequestObject>::get_request (RequestType rt)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
DEBUG_TRACE (PBD::DEBUG::AbstractUI, string_compose ("%1: allocated per-thread request of type %2, caller %3\n", event_loop_name(), rt, pthread_name()));
|
DEBUG_TRACE (PBD::DEBUG::AbstractUI, string_compose ("%1: allocated per-thread request of type %2, caller %3 aka %4\n", event_loop_name(), rt, pthread_name(), pthread_self()));
|
||||||
|
|
||||||
vec.buf[0]->type = rt;
|
vec.buf[0]->type = rt;
|
||||||
return vec.buf[0];
|
return vec.buf[0];
|
||||||
|
|
@ -260,8 +261,8 @@ AbstractUI<RequestObject>::handle_ui_requests ()
|
||||||
|
|
||||||
i->second->get_read_vector (&vec);
|
i->second->get_read_vector (&vec);
|
||||||
|
|
||||||
DEBUG_TRACE (PBD::DEBUG::AbstractUI, string_compose ("%1 reading requests from RB[%2] @ %5, requests = %3 + %4\n",
|
DEBUG_TRACE (PBD::DEBUG::AbstractUI, string_compose ("%1 reading requests from RB[%2] @ %5 for thread %6, requests = %3 + %4\n",
|
||||||
event_loop_name(), std::distance (request_buffers.begin(), i), vec.len[0], vec.len[1], i->second));
|
event_loop_name(), std::distance (request_buffers.begin(), i), vec.len[0], vec.len[1], i->second, i->first));
|
||||||
|
|
||||||
if (vec.len[0] == 0) {
|
if (vec.len[0] == 0) {
|
||||||
break;
|
break;
|
||||||
|
|
@ -418,13 +419,13 @@ AbstractUI<RequestObject>::send_request (RequestObject *req)
|
||||||
RequestBuffer* rbuf = get_per_thread_request_buffer ();
|
RequestBuffer* rbuf = get_per_thread_request_buffer ();
|
||||||
|
|
||||||
if (rbuf != 0) {
|
if (rbuf != 0) {
|
||||||
DEBUG_TRACE (PBD::DEBUG::AbstractUI, string_compose ("%1/%2 send per-thread request type %3 using ringbuffer @ %4 IR: %5\n", event_loop_name(), pthread_name(), req->type, rbuf, req->invalidation));
|
DEBUG_TRACE (PBD::DEBUG::AbstractUI, string_compose ("%1/%2/%6 send per-thread request type %3 using ringbuffer @ %4 IR: %5\n", event_loop_name(), pthread_name(), req->type, rbuf, req->invalidation, pthread_self()));
|
||||||
rbuf->increment_write_ptr (1);
|
rbuf->increment_write_ptr (1);
|
||||||
} else {
|
} else {
|
||||||
/* no per-thread buffer, so just use a list with a lock so that it remains
|
/* no per-thread buffer, so just use a list with a lock so that it remains
|
||||||
* single-reader/single-writer semantics
|
* single-reader/single-writer semantics
|
||||||
*/
|
*/
|
||||||
DEBUG_TRACE (PBD::DEBUG::AbstractUI, string_compose ("%1/%2 send heap request type %3 IR %4\n", event_loop_name(), pthread_name(), req->type, req->invalidation));
|
DEBUG_TRACE (PBD::DEBUG::AbstractUI, string_compose ("%1/%2/%5 send heap request type %3 IR %4\n", event_loop_name(), pthread_name(), req->type, req->invalidation, pthread_self()));
|
||||||
Glib::Threads::RWLock::WriterLock lm (request_buffer_map_lock);
|
Glib::Threads::RWLock::WriterLock lm (request_buffer_map_lock);
|
||||||
request_list.push_back (req);
|
request_list.push_back (req);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue