From f487344bfb98d6a0a8203f36fdff848355827a69 Mon Sep 17 00:00:00 2001 From: Eric Bollengier Date: Tue, 11 Nov 2008 14:33:46 +0000 Subject: [PATCH] ebl Tweak dump code git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@8034 91ce42f0-d328-0410-95d8-f526ca767f89 --- bacula/src/cats/sql.c | 4 ++-- bacula/src/lib/signal.c | 8 +++++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/bacula/src/cats/sql.c b/bacula/src/cats/sql.c index 756c1e53d0..bbee8561b8 100644 --- a/bacula/src/cats/sql.c +++ b/bacula/src/cats/sql.c @@ -753,11 +753,11 @@ void _dbg_print_db(JCR *jcr, FILE *fp) return; } - fprintf(fp, "B_DB %p db_name=%s db_user=%s connected=%i\n", + fprintf(fp, "B_DB=%p db_name=%s db_user=%s connected=%i\n", mdb, NPRTB(mdb->db_name), NPRTB(mdb->db_user), mdb->connected); fprintf(fp, "\tcmd=\"%s\" changes=%i\n", NPRTB(mdb->cmd), mdb->changes); if (mdb->lock.valid == RWLOCK_VALID) { - fprintf(fp, "\tRWLOCK %p w_active=%i w_wait=%i\n", &mdb->lock, mdb->lock.w_active, mdb->lock.w_wait); + fprintf(fp, "\tRWLOCK=%p w_active=%i w_wait=%i\n", &mdb->lock, mdb->lock.w_active, mdb->lock.w_wait); #ifndef HAVE_WIN32 fprintf(fp, "\t\tthreadid=0x%x mutex=%p\n", (int)mdb->lock.writer_id, &mdb->lock.mutex); #endif diff --git a/bacula/src/lib/signal.c b/bacula/src/lib/signal.c index 941c6f7091..01fbecc7cc 100644 --- a/bacula/src/lib/signal.c +++ b/bacula/src/lib/signal.c @@ -87,12 +87,14 @@ static void dbg_print_bacula() { char buf[512]; - snprintf(buf, sizeof(buf), "%s/bacula.%d.bactrace", - working_directory, getpid()); + snprintf(buf, sizeof(buf), "%s/%s.%d.bactrace", + working_directory, my_name, getpid()); FILE *fp = fopen(buf, "ab") ; if (!fp) { fp = stderr; } + + fprintf(stderr, "Dumping: %s\n", buf); /* Print also B_DB and RWLOCK structure * Can add more info about JCR with dbg_jcr_add_hook() @@ -212,9 +214,9 @@ extern "C" void signal_handler(int sig) bmicrosleep(30, 0); } fprintf(stderr, _("It looks like the traceback worked ...\n")); + dbg_print_bacula(); } #endif - exit_handler(sig); } -- 2.39.5