+/*
+ Bacula® - The Network Backup Solution
+
+ Copyright (C) 2003-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.
+ This program is Free Software; you can redistribute it and/or
+ modify it under the terms of version two of the GNU General Public
+ License as published by the Free Software Foundation plus additions
+ that are listed in the file LICENSE.
+
+ This program is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ 02110-1301, USA.
+
+ Bacula® is a registered trademark of John Walker.
+ The licensor of Bacula is the Free Software Foundation Europe
+ (FSFE), Fiduciary Program, Sumatrastrasse 25, 8006 Zürich,
+ Switzerland, email:ftf@fsfeurope.org.
+*/
/*
* This file handles the status command
*
* Version $Id$
*
*/
-/*
- Copyright (C) 2003-2006 Kern Sibbald
-
- This program is free software; you can redistribute it and/or
- modify it under the terms of the GNU General Public License
- version 2 as amended with additional clauses defined in the
- file LICENSE in the main source directory.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- the file LICENSE for additional details.
-
- */
#include "bacula.h"
#include "stored.h"
extern BSOCK *filed_chan;
extern int r_first, r_last;
extern struct s_res resources[];
+extern void *start_heap;
/* Static variables */
static char qstatus[] = ".status %127s\n";
AUTOCHANGER *changer;
DEVICE *dev;
char dt[MAX_TIME_LENGTH];
- char *msg, b1[35], b2[35], b3[35], b4[35];
+ char b1[35], b2[35], b3[35], b4[35], b5[35];
+ POOLMEM *msg;
int bpb;
int len;
- msg = (char *)get_pool_memory(PM_MESSAGE);
+ msg = get_pool_memory(PM_MESSAGE);
len = Mmsg(msg, _("%s Version: %s (%s) %s %s %s\n"),
my_name, VERSION, BDATE, HOST_OS, DISTNAME, DISTVER);
dt, num_jobs_run, num_jobs_run == 1 ? "" : "s");
sendit(msg, len, arg);
- len = Mmsg(msg, _(" 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));
+ len = Mmsg(msg, _(" Heap: heap=%s smbytes=%s max_bytes=%s bufs=%s max_bufs=%s\n"),
+ edit_uint64_with_commas((char *)sbrk(0)-(char *)start_heap, b1),
+ edit_uint64_with_commas(sm_bytes, b2),
+ edit_uint64_with_commas(sm_max_bytes, b3),
+ edit_uint64_with_commas(sm_buffers, b4),
+ edit_uint64_with_commas(sm_max_buffers, b5));
sendit(msg, len, arg);
/*
free_pool_memory(msg);
return;
}
- switch (dev->dev_blocked) {
+ switch (dev->blocked()) {
case BST_UNMOUNTED:
len = Mmsg(msg, _(" Device is BLOCKED. User unmounted.\n"));
sendit(msg, len, arg);
dev->state & ST_MOUNTED ? "" : "!");
sendit(msg, len, arg);
- len = Mmsg(msg, _("num_writers=%d block=%d\n\n"), dev->num_writers, dev->dev_blocked);
+ len = Mmsg(msg, _("num_writers=%d block=%d\n\n"), dev->num_writers, dev->blocked());
sendit(msg, len, arg);
len = Mmsg(msg, _("Device parameters:\n"));
}
if (rdcr && rdcr->device) {
len = Mmsg(msg, _("Reading: %s %s job %s JobId=%d Volume=\"%s\"\n"
- " pool=\"%s\" device=\"%s\"\n"),
+ " pool=\"%s\" device=%s\n"),
job_level_to_str(jcr->JobLevel),
job_type_to_str(jcr->JobType),
JobName,
}
if (dcr && dcr->device) {
len = Mmsg(msg, _("Writing: %s %s job %s JobId=%d Volume=\"%s\"\n"
- " pool=\"%s\" device=\"%s\"\n"),
+ " pool=\"%s\" device=%s\n"),
job_level_to_str(jcr->JobLevel),
job_type_to_str(jcr->JobType),
JobName,
dcr->dev?dcr->dev->print_name():
dcr->device->device_name);
sendit(msg, len, arg);
+ len= Mmsg(msg, _(" spooling=%d despooling=%d despool_wait=%d\n"),
+ dcr->spooling, dcr->despooling, dcr->despool_wait);
+ sendit(msg, len, arg);
}
sec = time(NULL) - jcr->run_time;
if (sec <= 0) {