projects
/
dcpomatic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
f61acf7
)
Add some possibly-useful markers for debugging threads from coredumps.
author
Carl Hetherington
<cth@carlh.net>
Tue, 20 Apr 2021 10:27:40 +0000
(12:27 +0200)
committer
Carl Hetherington
<cth@carlh.net>
Tue, 20 Apr 2021 22:52:07 +0000
(
00:52
+0200)
src/lib/butler.cc
patch
|
blob
|
history
src/lib/encode_server_finder.cc
patch
|
blob
|
history
src/lib/hints.cc
patch
|
blob
|
history
src/lib/j2k_encoder.cc
patch
|
blob
|
history
src/lib/job.cc
patch
|
blob
|
history
src/lib/job_manager.cc
patch
|
blob
|
history
src/lib/util.cc
patch
|
blob
|
history
src/lib/util.h
patch
|
blob
|
history
src/lib/writer.cc
patch
|
blob
|
history
src/wx/gl_video_view.cc
patch
|
blob
|
history
diff --git
a/src/lib/butler.cc
b/src/lib/butler.cc
index 37e8c95443021e3c7d70c174e3839f12fbcb24fa..6de5d57904efb7ecb32dfb167aff7f9112db953d 100644
(file)
--- a/
src/lib/butler.cc
+++ b/
src/lib/butler.cc
@@
-179,6
+179,8
@@
void
Butler::thread ()
try
{
Butler::thread ()
try
{
+ start_of_thread ("Butler");
+
while (true) {
boost::mutex::scoped_lock lm (_mutex);
while (true) {
boost::mutex::scoped_lock lm (_mutex);
diff --git
a/src/lib/encode_server_finder.cc
b/src/lib/encode_server_finder.cc
index 396d67623d6801d4cad459b7c59931ff5dab3139..2fab210c94838fe03e53a77ebea5ab0efcb87f87 100644
(file)
--- a/
src/lib/encode_server_finder.cc
+++ b/
src/lib/encode_server_finder.cc
@@
-96,6
+96,8
@@
void
EncodeServerFinder::search_thread ()
try
{
EncodeServerFinder::search_thread ()
try
{
+ start_of_thread ("EncodeServerFinder-search");
+
boost::system::error_code error;
boost::asio::io_service io_service;
boost::asio::ip::udp::socket socket (io_service);
boost::system::error_code error;
boost::asio::io_service io_service;
boost::asio::ip::udp::socket socket (io_service);
@@
-168,6
+170,8
@@
catch (...)
void
EncodeServerFinder::listen_thread ()
try {
void
EncodeServerFinder::listen_thread ()
try {
+ start_of_thread ("EncodeServerFinder-listen");
+
using namespace boost::asio::ip;
try {
using namespace boost::asio::ip;
try {
diff --git
a/src/lib/hints.cc
b/src/lib/hints.cc
index b23f32238182e1f603655ada06a2e24d51bc1807..52debf3ef313c44f3d4b745810e2964fe28cb28e 100644
(file)
--- a/
src/lib/hints.cc
+++ b/
src/lib/hints.cc
@@
-370,6
+370,8
@@
void
Hints::thread ()
try
{
Hints::thread ()
try
{
+ start_of_thread ("Hints");
+
auto film = _film.lock ();
if (!film) {
return;
auto film = _film.lock ();
if (!film) {
return;
diff --git
a/src/lib/j2k_encoder.cc
b/src/lib/j2k_encoder.cc
index c2553854bf5241e193e139987c1f6503956f7892..5dee5ca35af998c07ed1ebcc76684b25c946563c 100644
(file)
--- a/
src/lib/j2k_encoder.cc
+++ b/
src/lib/j2k_encoder.cc
@@
-283,6
+283,8
@@
void
J2KEncoder::encoder_thread (optional<EncodeServerDescription> server)
try
{
J2KEncoder::encoder_thread (optional<EncodeServerDescription> server)
try
{
+ start_of_thread ("J2KEncoder");
+
if (server) {
LOG_TIMING ("start-encoder-thread thread=%1 server=%2", thread_id (), server->host_name ());
} else {
if (server) {
LOG_TIMING ("start-encoder-thread thread=%1 server=%2", thread_id (), server->host_name ());
} else {
diff --git
a/src/lib/job.cc
b/src/lib/job.cc
index b1ff0fb32f23f82134fb3b461e4a821cfa5d50ba..b0ca8a7375b5679718efb13a58c6762831e7cbe9 100644
(file)
--- a/
src/lib/job.cc
+++ b/
src/lib/job.cc
@@
-95,6
+95,8
@@
Job::start ()
void
Job::run_wrapper ()
{
void
Job::run_wrapper ()
{
+ start_of_thread (String::compose("Job-%1", json_name()));
+
try {
run ();
try {
run ();
diff --git
a/src/lib/job_manager.cc
b/src/lib/job_manager.cc
index 2839bce30c379f8c98c85cffe5af54e0bd36cb50..4ed360bed4b913b595f2ff4184816a6032690a0c 100644
(file)
--- a/
src/lib/job_manager.cc
+++ b/
src/lib/job_manager.cc
@@
-153,6
+153,8
@@
JobManager::errors () const
void
JobManager::scheduler ()
{
void
JobManager::scheduler ()
{
+ start_of_thread ("JobManager");
+
while (true) {
boost::mutex::scoped_lock lm (_mutex);
while (true) {
boost::mutex::scoped_lock lm (_mutex);
diff --git
a/src/lib/util.cc
b/src/lib/util.cc
index d3511e8c7e34e0b1c5f5744147b18d83fb944837..65bfd4534b4b9ae51be736e258275e306e5d341c 100644
(file)
--- a/
src/lib/util.cc
+++ b/
src/lib/util.cc
@@
-1176,3
+1176,20
@@
to_upper (string s)
return s;
}
return s;
}
+
+/* Set to 1 to print the IDs of some of our threads to stdout on creation */
+#define DCPOMATIC_DEBUG_THREADS 0
+
+#if DCPOMATIC_DEBUG_THREADS
+void
+start_of_thread (string name)
+{
+ std::cout << "THREAD:" << name << ":" << std::hex << pthread_self() << "\n";
+}
+#else
+void
+start_of_thread (string)
+{
+
+}
+#endif
diff --git
a/src/lib/util.h
b/src/lib/util.h
index 7f8106f3c543775bfb10e62a04c00af7422fa9bd..a6b010e43a6011c9e256af37e2489b79173cc609 100644
(file)
--- a/
src/lib/util.h
+++ b/
src/lib/util.h
@@
-123,6
+123,7
@@
extern dcp::Size scale_for_display (dcp::Size s, dcp::Size display_container, dc
extern dcp::DecryptedKDM decrypt_kdm_with_helpful_error (dcp::EncryptedKDM kdm);
extern boost::filesystem::path default_font_file ();
extern std::string to_upper (std::string s);
extern dcp::DecryptedKDM decrypt_kdm_with_helpful_error (dcp::EncryptedKDM kdm);
extern boost::filesystem::path default_font_file ();
extern std::string to_upper (std::string s);
+extern void start_of_thread (std::string name);
template <class T>
std::list<T>
template <class T>
std::list<T>
diff --git
a/src/lib/writer.cc
b/src/lib/writer.cc
index 81b77d5cea62a5219257368af0711660e69ccfcf..7208402e45704002fc3f635bd2d3e16755ff47b4 100644
(file)
--- a/
src/lib/writer.cc
+++ b/
src/lib/writer.cc
@@
-393,6
+393,8
@@
void
Writer::thread ()
try
{
Writer::thread ()
try
{
+ start_of_thread ("Writer");
+
while (true)
{
boost::mutex::scoped_lock lock (_state_mutex);
while (true)
{
boost::mutex::scoped_lock lock (_state_mutex);
diff --git
a/src/wx/gl_video_view.cc
b/src/wx/gl_video_view.cc
index 076cb49ecedf2ec2a0fccdc13d0cb202c8504c7a..ad0ff38a741027bf57fc5de81762742a7a54f0a9 100644
(file)
--- a/
src/wx/gl_video_view.cc
+++ b/
src/wx/gl_video_view.cc
@@
-356,6
+356,8
@@
void
GLVideoView::thread ()
try
{
GLVideoView::thread ()
try
{
+ start_of_thread ("GLVideoView");
+
{
boost::mutex::scoped_lock lm (_canvas_mutex);
{
boost::mutex::scoped_lock lm (_canvas_mutex);