]> git.sur5r.net Git - bacula/bacula/commitdiff
Add heap stats to Dir and SD -- eliminate #ifdefs
authorKern Sibbald <kern@sibbald.com>
Sun, 27 Jun 2004 17:02:14 +0000 (17:02 +0000)
committerKern Sibbald <kern@sibbald.com>
Sun, 27 Jun 2004 17:02:14 +0000 (17:02 +0000)
git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@1452 91ce42f0-d328-0410-95d8-f526ca767f89

bacula/src/dird/ua_status.c
bacula/src/filed/status.c
bacula/src/lib/smartall.c
bacula/src/lib/smartall.h
bacula/src/stored/status.c

index 2b2a4a400dde534f0b544e6633b2eb45f36bd0c3..29eb20f6c8df42fa68ca53804008e3fb1beaa2fa 100644 (file)
 extern char my_name[];
 extern time_t daemon_start_time;
 extern int num_jobs_run;
-#ifdef SMARTALLOC
-extern uint64_t sm_max_bytes;
-extern uint64_t sm_bytes;
-extern uint32_t sm_max_buffers;
-extern uint32_t sm_buffers;
-#endif
 
 static void list_scheduled_jobs(UAContext *ua);
 static void list_running_jobs(UAContext *ua);
@@ -212,7 +206,6 @@ static void do_director_status(UAContext *ua)
    bstrftime_nc(dt, sizeof(dt), daemon_start_time);
    bsendmsg(ua, _("Daemon started %s, %d Job%s run since started.\n"), 
         dt, num_jobs_run, num_jobs_run == 1 ? "" : "s");
-#ifdef SMARTALLOC
    if (debug_level > 0) {
       char b1[35], b2[35], b3[35], b4[35];
       bsendmsg(ua, _(" Heap: bytes=%s max_bytes=%s bufs=%s max_bufs=%s\n"),
@@ -220,8 +213,7 @@ static void do_director_status(UAContext *ua)
            edit_uint64_with_commas(sm_max_bytes, b2),
            edit_uint64_with_commas(sm_buffers, b3),
            edit_uint64_with_commas(sm_max_buffers, b4));
-    }
-#endif
+   }
    /*
     * List scheduled Jobs
     */
index 6cc5fc7efb8a637734eaf7159ea65302fd617f8c..d18b054e34fdf9716471f539c6e52ec2de9d183d 100755 (executable)
 extern char my_name[];
 extern int num_jobs_run;
 extern time_t daemon_start_time;
-#ifdef SMARTALLOC
-extern uint64_t sm_max_bytes;
-extern uint64_t sm_bytes;
-extern uint32_t sm_max_buffers;
-extern uint32_t sm_buffers;
-#endif
 
 /* Forward referenced functions */
 static void  list_terminated_jobs(void sendit(const char *msg, int len, void *sarg), void *arg);
@@ -86,7 +80,6 @@ static void do_status(void sendit(const char *msg, int len, void *sarg), void *a
       sendit(msg, len, arg);
    }
 #endif
-#ifdef SMARTALLOC
    if (debug_level > 0) {
       len = Mmsg(&msg, _(" Heap: bytes=%s max_bytes=%s bufs=%s max_bufs=%s\n"),
            edit_uint64_with_commas(sm_bytes, b1),
@@ -95,7 +88,6 @@ static void do_status(void sendit(const char *msg, int len, void *sarg), void *a
            edit_uint64_with_commas(sm_max_buffers, b4));
        sendit(msg, len, arg);
     }
-#endif
    if (debug_level > 0) {
       len = Mmsg(&msg, _(" Sizeof: off_t=%d size_t=%d\n"), sizeof(off_t),
            sizeof(size_t));
index 6e46ca7b6b91775a6191e10085ae90630c34abc5..0d75ffebef443734c8479e706f54f53fb7428b3a 100644 (file)
 #define Dmsg4(l,f,a1,a2,a3,a4)
       
 
+uint64_t sm_max_bytes = 0;
+uint64_t sm_bytes = 0;
+uint32_t sm_max_buffers = 0;
+uint32_t sm_buffers = 0;
 
 #ifdef SMARTALLOC
 
@@ -86,10 +90,6 @@ static struct b_queue abqueue = {    /* Allocated buffer queue */
    &abqueue, &abqueue
 };
 
-uint64_t sm_max_bytes = 0;
-uint64_t sm_bytes = 0;
-uint32_t sm_max_buffers = 0;
-uint32_t sm_buffers = 0;
 
 static bool bufimode = false;  /* Buffers not tracked when True */
 
index 26062e371cacf79e8581305f9f3c2a50908c1e6e..b879905411844e68d73a64e149763188dd3805c2 100644 (file)
 
  */
 
+extern uint64_t sm_max_bytes;
+extern uint64_t sm_bytes;
+extern uint32_t sm_max_buffers;
+extern uint32_t sm_buffers;
 
 #ifdef SMARTALLOC
 
index 6278f41ee221ea3af95cc881c47e1060a0c7625c..d07c43029d6174a159ac1828f2065f892e1c1152 100644 (file)
@@ -39,6 +39,7 @@ extern char my_name[];
 extern time_t daemon_start_time;
 extern int num_jobs_run;
 
+
 /* Static variables */
 
 
@@ -67,6 +68,14 @@ int status_cmd(JCR *jcr)
    bstrftime_nc(dt, sizeof(dt), daemon_start_time);
    bnet_fsend(user, _("Daemon started %s, %d Job%s run since started.\n"), dt, num_jobs_run,
         num_jobs_run == 1 ? "" : "s");
+   if (debug_level > 0) {
+      char b1[35], b2[35], b3[35], b4[35];
+      bnet_fsend(user, _(" Heap: bytes=%s max_bytes=%s bufs=%s max_bufs=%s\n"),
+           edit_uint64_with_commas(sm_bytes, b1),
+           edit_uint64_with_commas(sm_max_bytes, b2),
+           edit_uint64_with_commas(sm_buffers, b3),
+           edit_uint64_with_commas(sm_max_buffers, b4));
+   }
 
    /*
     * List running jobs