]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/tools/bbatch.c
ebl Fix warning on 64bit
[bacula/bacula] / bacula / src / tools / bbatch.c
index b42ce0c8f35406b1178fc5f0922c9c337fbea58a..17259dcf59e247be515c8cc687574825cf390325 100644 (file)
@@ -80,7 +80,8 @@ PROG_COPYRIGHT
 " will start 3 thread and load dat1, dat and datx in your catalog\n"
 "See bbatch.c to generate datafile\n\n"
 "Usage: bbatch [ options ] -w working/dir -f datafile\n"
-"       -d <nn>           set debug level to nn\n"
+"       -d <nn>           set debug level to <nn>\n"
+"       -dt               print timestamp in debug output\n"
 "       -n <name>         specify the database name (default bacula)\n"
 "       -u <user>         specify database user name (default bacula)\n"
 "       -P <password      specify database password (default none)\n"
@@ -113,9 +114,14 @@ int main (int argc, char *argv[])
    while ((ch = getopt(argc, argv, "h:c:d:n:P:Su:vf:w:?")) != -1) {
       switch (ch) {
       case 'd':                    /* debug level */
-         debug_level = atoi(optarg);
-         if (debug_level <= 0)
-            debug_level = 1;
+         if (*optarg == 't') {
+            dbg_timestamp = true;
+         } else {
+            debug_level = atoi(optarg);
+            if (debug_level <= 0) {
+               debug_level = 1;
+            }
+         }
          break;
 
       case 'h':
@@ -278,7 +284,7 @@ static void *do_batch(void *jcr)
    P(mutex);
    char ed1[200], ed2[200];
    printf("\rbegin = %s, end = %s\n", edit_int64(begin, ed1),edit_int64(end, ed2));
-   printf("Insert time = %llims\n", (end - begin) / 10000);
+   printf("Insert time = %sms\n", edit_int64((end - begin) / 10000, ed1));
    printf("Create %u files at %.2f/s\n", lineno, 
          (lineno / ((float)((end - begin) / 1000000))));
    nb--;