knows about it.
*/
- PBD::ThreadCreated (pthread_self(), X_("Audioengine"));
+ PBD::ThreadCreatedWithRequestSize (pthread_self(), X_("Audioengine"), 4096);
#ifdef VST_SUPPORT
if (Config->get_use_vst()) {
bool restart;
vector<MIDI::Port*> ports;
- PBD::ThreadCreated (pthread_self(), X_("MIDI"));
+ PBD::ThreadCreatedWithRequestSize (pthread_self(), X_("MIDI"), 2048);
memset (&rtparam, 0, sizeof (rtparam));
rtparam.sched_priority = 9; /* XXX should be relative to audio (JACK) thread */
#include <pbd/touchable.h>
#include <pbd/failed_constructor.h>
#include <pbd/pthread_utils.h>
+#include <pbd/stacktrace.h>
#include <gtkmm2ext/gtk_ui.h>
#include <gtkmm2ext/textviewer.h>
}
PBD::ThreadCreated.connect (mem_fun (*this, &UI::register_thread));
+ PBD::ThreadCreatedWithRequestSize.connect (mem_fun (*this, &UI::register_thread_with_request_count));
_ok = false;
_active = false;
void
UI::register_thread (pthread_t thread_id, string name)
{
- RingBufferNPT<Request>* b = new RingBufferNPT<Request> (128);
+ register_thread_with_request_count (thread_id, name, 256);
+}
+
+void
+UI::register_thread_with_request_count (pthread_t thread_id, string name, uint32_t num_requests)
+{
+ RingBufferNPT<Request>* b = new RingBufferNPT<Request> (num_requests);
{
PBD::LockMonitor lm (request_buffer_map_lock, __LINE__, __FILE__);
void call_slot_locked (sigc::slot<void>);
void touch_display (Touchable *);
void receive (Transmitter::Channel, const char *);
+
void register_thread (pthread_t, string);
+ void register_thread_with_request_count (pthread_t, string, uint32_t num_requests);
bool caller_is_gui_thread () {
return pthread_equal (gui_thread, pthread_self());
pool.cc
pthread_utils.cc
receiver.cc
+stacktrace.cc
strsplit.cc
textreceiver.cc
transmitter.cc
conf = Configure(pbd3)
if conf.CheckFunc('getmntent'):
conf.env.Append(CCFLAGS="-DHAVE_GETMNTENT")
+if conf.CheckCHeader('execinfo.h'):
+ conf.env.Append(CXXFLAGS="-DHAVE_EXECINFO")
pbd3 = conf.Finish()
pbd3.Merge ([ libraries['sigc2'], libraries['xml'] ])
namespace PBD {
extern sigc::signal<void,pthread_t,std::string> ThreadCreated;
+ extern sigc::signal<void,pthread_t,std::string,uint32_t> ThreadCreatedWithRequestSize;
}
#endif /* __pbd_pthread_utils__ */
--- /dev/null
+#ifndef __libpbd_stacktrace_h__
+#define __libpbd_stacktrace_h__
+
+#include <ostream>
+
+namespace PBD {
+ void stacktrace (std::ostream& out);
+}
+
+#endif /* __libpbd_stacktrace_h__ */
#include <map>
#include <iostream>
#include <string>
+#include <stdint.h>
#include <pbd/pthread_utils.h>
namespace PBD {
sigc::signal<void,pthread_t,std::string> ThreadCreated;
+ sigc::signal<void,pthread_t,std::string,uint32_t> ThreadCreatedWithRequestSize;
}
using namespace PBD;
--- /dev/null
+#include <pbd/stacktrace.h>
+#include <iostream>
+
+/* Obtain a backtrace and print it to stdout. */
+
+#ifdef HAVE_EXECINFO
+
+#include <execinfo.h>
+#include <stdlib.h>
+
+void
+PBD::stacktrace (std::ostream& out)
+{
+ void *array[200];
+ size_t size;
+ char **strings;
+ size_t i;
+
+ size = backtrace (array, 200);
+ strings = backtrace_symbols (array, size);
+
+ if (strings) {
+
+ printf ("Obtained %zd stack frames.\n", size);
+
+ for (i = 0; i < size; i++) {
+ out << strings[i] << std::endl;
+ }
+
+ free (strings);
+ }
+}
+
+#else
+
+void
+PBD::stacktrace (std::ostream& out)
+{
+ out << "stack tracing is not enabled on this platform" << std::endl;
+}
+
+#endif /* HAVE_EXECINFO */