-/*
- * General header file configurations that apply to
- * all daemons. System dependent stuff goes here.
- *
- * Version $Id$
- */
/*
Bacula® - The Network Backup Solution
- Copyright (C) 2000-2006 Free Software Foundation Europe e.V.
+ Copyright (C) 2000-2007 Free Software Foundation Europe e.V.
The main author of Bacula is Kern Sibbald, with contributions from
many others, a complete list can be found in the file AUTHORS.
(FSFE), Fiduciary Program, Sumatrastrasse 25, 8006 Zürich,
Switzerland, email:ftf@fsfeurope.org.
*/
+/*
+ * General header file configurations that apply to
+ * all daemons. System dependent stuff goes here.
+ *
+ * Version $Id$
+ */
#ifndef _BACONFIG_H
memset(&mr, 0, sizeof(mr));
memset(&sdmr, 0, sizeof(sdmr));
memset(&jm, 0, sizeof(jm));
+ Dsm_check(1);
/*
* Request to find next appendable Volume for this Job
ATTR_DBR *ar = NULL;
POOLMEM *omsg;
+ Dsm_check(1);
if (!jcr->pool->catalog_files) {
return; /* user disabled cataloging */
}
if (debug_level <= 0) {
debug_level = 1;
}
- Dmsg1(0, "Debug level = %d\n", debug_level);
+ Dmsg1(10, "Debug level = %d\n", debug_level);
break;
case 'f': /* run in foreground */
}
generate_job_event(jcr, "JobInit");
+ Dsm_check(1);
return true;
bail_out:
jcr->my_thread_id = pthread_self();
pthread_detach(jcr->my_thread_id);
- sm_check(__FILE__, __LINE__, true);
+ Dsm_check(1);
Dmsg0(200, "=====Start Job=========\n");
set_jcr_job_status(jcr, JS_Running); /* this will be set only if no error */
control_jcr = (JCR *)self->data;
+ Dsm_check(1);
Dmsg1(800, "job_monitor_watchdog %p called\n", self);
foreach_jcr(jcr) {
Dmsg0(100, "Done with term_find_files\n");
free_jcr(jcr); /* destroy JCR record */
Dmsg0(100, "Done with free_jcr\n");
+ Dsm_check(1);
return NULL;
}
*/
const char *working_directory = NULL; /* working directory path stored here */
int verbose = 0; /* increase User messages */
-int debug_level = 0; /* debug level */
+int debug_level = 1; /* debug level */
time_t daemon_start_time = 0; /* Daemon start time */
const char *version = VERSION " (" BDATE ")";
char my_name[30]; /* daemon name is stored here */
sigaction(SIGQUIT, &sighandle, NULL);
sigaction(SIGILL, &sighandle, NULL);
sigaction(SIGTRAP, &sighandle, NULL);
-/* sigaction(SIGABRT, &sighandle, NULL); */
+ sigaction(SIGABRT, &sighandle, NULL);
#ifdef SIGEMT
sigaction(SIGEMT, &sighandle, NULL);
#endif
-/*
-
- S M A R T A L L O C
- Smart Memory Allocator
-
- Evolved over several years, starting with the initial
- SMARTALLOC code for AutoSketch in 1986, guided by the Blind
- Watchbreaker, John Walker. Isolated in this general-purpose
- form in September of 1989. Updated with be more POSIX
- compliant and to include Web-friendly HTML documentation in
- October of 1998 by the same culprit. For additional
- information and the current version visit the Web page:
-
- http://www.fourmilab.ch/smartall/
-
-
- Version $Id$
-
-*/
/*
Bacula® - The Network Backup Solution
(FSFE), Fiduciary Program, Sumatrastrasse 25, 8006 Zürich,
Switzerland, email:ftf@fsfeurope.org.
*/
+/*
+
+ S M A R T A L L O C
+ Smart Memory Allocator
+
+ Evolved over several years, starting with the initial
+ SMARTALLOC code for AutoSketch in 1986, guided by the Blind
+ Watchbreaker, John Walker. Isolated in this general-purpose
+ form in September of 1989. Updated with be more POSIX
+ compliant and to include Web-friendly HTML documentation in
+ October of 1998 by the same culprit. For additional
+ information and the current version visit the Web page:
+
+ http://www.fourmilab.ch/smartall/
+
+
+ Version $Id$
+
+*/
#include "bacula.h"
/* Use the real routines here */
}
cp -= HEAD_SIZE;
- qp = (struct b_queue *) cp;
+ qp = (struct b_queue *)cp;
struct abufhead *head = (struct abufhead *)cp;
P(mutex);
/* SM_CHECK -- Check the buffers and dump if any damage exists. */
void sm_check(const char *fname, int lineno, bool bufdump)
{
- if (!sm_check_rtn(fname, lineno, bufdump)) {
- Emsg2(M_ABORT, 0, _("Damaged buffer found. Called from %s:%d\n"),
- fname, lineno);
- }
+ if (!sm_check_rtn(fname, lineno, bufdump)) {
+ Emsg2(M_ABORT, 0, _("Damaged buffer found. Called from %s:%d\n"),
+ fname, lineno);
+ }
}
#undef sm_check_rtn
that all the other safeguards still apply to buffers
allocated when sm_static(1) mode is in effect. */
-void sm_static(int mode)
+void sm_static(bool mode)
{
- bufimode = (bool) (mode != 0);
+ bufimode = mode;
}
/*
-/*
-
- Definitions for the smart memory allocator
-
- Version $Id$
-
-*/
/*
Bacula® - The Network Backup Solution
(FSFE), Fiduciary Program, Sumatrastrasse 25, 8006 Zürich,
Switzerland, email:ftf@fsfeurope.org.
*/
+/*
+
+ Definitions for the smart memory allocator
+
+ Version $Id$
+
+*/
extern uint64_t DLL_IMP_EXP sm_max_bytes;
extern uint64_t DLL_IMP_EXP sm_bytes;
extern void sm_new_owner(const char *fname, int lineno, char *buf);
#ifdef SMCHECK
+#define Dsm_check(lvl) if ((lvl)<=debug_level) sm_check(__FILE__, __LINE__, true)
extern void sm_check(const char *fname, int lineno, bool bufdump);
extern int sm_check_rtn(const char *fname, int lineno, bool bufdump);
#else
+#define Dsm_check(lvl, f, l, fl)
#define sm_check(f, l, fl)
#define sm_check_rtn(f, l, fl) 1
#endif
char *icmd;
int status, timeout;
- sm_check(__FILE__, __LINE__, false);
+ Dsm_check(1);
if (mount) {
if (is_mounted()) {
Dmsg0(200, "======= mount=1\n");
}
get_out:
set_mounted(false);
- sm_check(__FILE__, __LINE__, false);
free_pool_memory(results);
Dmsg0(200, "============ mount=0\n");
+ Dsm_check(1);
return false;
}
struct timespec timeout;
int errstat;
+ Dsm_check(1);
Dmsg1(200, "Run_cmd: %s\n", jcr->dir_bsock->msg);
/* The following jobs don't need the FD */
switch (jcr->JobType) {
delete jcr->write_store;
jcr->write_store = NULL;
}
+ Dsm_check(1);
return;
}
#undef VERSION
#define VERSION "2.1.11"
-#define BDATE "22 May 2007"
-#define LSMDATE "22May07"
+#define BDATE "24 May 2007"
+#define LSMDATE "24May07"
#define PROG_COPYRIGHT "Copyright (C) %d-2007 Free Software Foundation Europe e.V.\n"
#define BYEAR "2007" /* year for copyright messages in progs */
Technical notes on version 2.1
General:
+24May07
+kes Add additional sm_check() code on debug level 1.
+kes Set default debug level to 1.
+kes Trap SIGABRT in attempt to get traceback.
23May07
kes Reduce bat connect timeout from 30 to 15 seconds.
kes More restructuring and implementing BSOCK class in place of