]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Merge callgrind/ changes from branches/MESSAGING_TIDYUP r10464.
authorJulian Seward <jseward@acm.org>
Wed, 15 Jul 2009 14:51:03 +0000 (14:51 +0000)
committerJulian Seward <jseward@acm.org>
Wed, 15 Jul 2009 14:51:03 +0000 (14:51 +0000)
See trunk r10465 commit message for details.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10471

callgrind/bb.c
callgrind/callstack.c
callgrind/command.c
callgrind/dump.c
callgrind/fn.c
callgrind/main.c
callgrind/sim.c

index 3b8d1e80a0ac4f5083c6299faede801a0e34b09c..2dca73e05d139eea2b16e7a44d35becdc275fc81 100644 (file)
@@ -259,13 +259,13 @@ BB* CLG_(get_bb)(Addr addr, IRSB* bbIn, /*OUT*/ Bool *seen_before)
   if (*seen_before) {
     if (bb->instr_count != n_instrs) {
       VG_(message)(Vg_DebugMsg, 
-                  "ERROR: BB Retranslation Mismatch at BB %#lx", addr);
+                  "ERROR: BB Retranslation Mismatch at BB %#lx\n", addr);
       VG_(message)(Vg_DebugMsg,
-                  "  new: Obj %s, Off %#lx, BBOff %#lx, Instrs %u",
+                  "  new: Obj %s, Off %#lx, BBOff %#lx, Instrs %u\n",
                   obj->name, obj->offset,
                   addr - obj->offset, n_instrs);
       VG_(message)(Vg_DebugMsg,
-                  "  old: Obj %s, Off %#lx, BBOff %#lx, Instrs %u",
+                  "  old: Obj %s, Off %#lx, BBOff %#lx, Instrs %u\n",
                   bb->obj->name, bb->obj->offset,
                   bb->offset, bb->instr_count);
       CLG_ASSERT(bb->instr_count == n_instrs );
index 988bde42e01318552ed255eabdab1017fc3eb68c..70495e1fc04728e2a25a2b650e9cc56d83236833 100644 (file)
@@ -124,7 +124,7 @@ static void function_entered(fn_node* fn)
     CLG_(clo).verbose = fn->verbosity;
     fn->verbosity = old;
     VG_(message)(Vg_DebugMsg, 
-                "Entering %s: Verbosity set to %d",
+                "Entering %s: Verbosity set to %d\n",
                 fn->name, CLG_(clo).verbose);
   }
 #endif         
@@ -169,7 +169,7 @@ static void function_left(fn_node* fn)
     CLG_(clo).verbose = fn->verbosity;
     fn->verbosity = old;
     VG_(message)(Vg_DebugMsg, 
-                "Leaving %s: Verbosity set back to %d",
+                "Leaving %s: Verbosity set back to %d\n",
                 fn->name, CLG_(clo).verbose);
   }
 #endif         
index 78f57d85a51d39a072f3ca01aa4dbeb8300420ce..e9b40c28bffaacd6ad25156c3fc4d211b472e2f5 100644 (file)
@@ -113,7 +113,7 @@ static void setup_control(void)
                   VKI_S_IRUSR|VKI_S_IWUSR);
     if (sr_isError(res)) {
       VG_(message)(Vg_DebugMsg, 
-                  "warning: can't write info file '%s'", info_file);
+                  "warning: can't write info file '%s'\n", info_file);
       info_file = 0;
       fd = -1;
     }
@@ -524,7 +524,8 @@ void CLG_(check_command)()
 
     if (do_kill) {
       VG_(message)(Vg_UserMsg,
-                  "Killed because of command from %s", current_command_file);
+                  "Killed because of command from %s\n",
+                   current_command_file);
       CLG_(fini)(0);
       VG_(exit)(1);
     }
index 28bb8eb2989f2b64501f65423f9cac0802b6fcd1..488775afd4b7d44142480a2d3714a5b44ed099d8 100644 (file)
@@ -1265,7 +1265,7 @@ static
 void file_err(void)
 {
    VG_(message)(Vg_UserMsg,
-                "Error: can not open cache simulation output file `%s'",
+                "Error: can not open cache simulation output file `%s'\n",
                 filename );
    VG_(exit)(1);
 }
@@ -1467,7 +1467,7 @@ static int new_dumpfile(Char buf[BUF_LEN], int tid, Char* trigger)
    my_fwrite(fd, "\n\n",2);
 
    if (VG_(clo_verbosity) > 1)
-       VG_(message)(Vg_DebugMsg, "Dump to %s", filename);
+       VG_(message)(Vg_DebugMsg, "Dump to %s\n", filename);
 
    return fd;
 }
@@ -1489,7 +1489,7 @@ static void close_dumpfile(int fd)
     if (filename[0] == '.') {
        if (-1 == VG_(rename) (filename, filename+1)) {
            /* Can not rename to correct file name: give out warning */
-           VG_(message)(Vg_DebugMsg, "Warning: Can not rename .%s to %s",
+           VG_(message)(Vg_DebugMsg, "Warning: Can not rename .%s to %s\n",
                         filename, filename);
        }
    }
@@ -1619,7 +1619,7 @@ void CLG_(dump_profile)(Char* trigger, Bool only_current_thread)
    CLG_(init_dumps)();
 
    if (VG_(clo_verbosity) > 1)
-       VG_(message)(Vg_DebugMsg, "Start dumping at BB %llu (%s)...",
+       VG_(message)(Vg_DebugMsg, "Start dumping at BB %llu (%s)...\n",
                    CLG_(stat).bb_executions,
                    trigger ? trigger : (Char*)"Prg.Term.");
 
@@ -1630,7 +1630,7 @@ void CLG_(dump_profile)(Char* trigger, Bool only_current_thread)
    bbs_done = CLG_(stat).bb_executions++;
 
    if (VG_(clo_verbosity) > 1)
-     VG_(message)(Vg_DebugMsg, "Dumping done.");
+     VG_(message)(Vg_DebugMsg, "Dumping done.\n");
 }
 
 /* copy command to cmd buffer (could change) */
index 58a69c87c5f43e2e7bb5440b14b5426f9c95a0c4..0845a1307e4b24810462c5c2139d26e41b7637d7 100644 (file)
@@ -75,7 +75,8 @@ static Bool check_code(obj_node* obj,
                if (len == 0) break;
 
                CLG_ASSERT(len >2);
-                CLG_DEBUG(1, " found chunk %d at %#lx, checking %d bytes of [%x %x %x...]\n",
+                CLG_DEBUG(1, " found chunk %d at %#lx, checking %d bytes "
+                             "of [%x %x %x...]\n",
                           chunk-1, addr - obj->start, len,
                          code[start], code[start+1], code[start+2]);
 
@@ -89,7 +90,8 @@ static Bool check_code(obj_node* obj,
             if (found) {
                CLG_DEBUG(1, "found at offset %#lx.\n", addr - obj->start);
                if (VG_(clo_verbosity) > 1)
-                   VG_(message)(Vg_DebugMsg, "Found runtime_resolve (%s): %s +%#lx=%#lx, length %d",
+                   VG_(message)(Vg_DebugMsg, "Found runtime_resolve (%s): "
+                                              "%s +%#lx=%#lx, length %d\n",
                                 pat->name, obj->name + obj->last_slash_pos,
                                 addr - obj->start, addr, pat->len);
                    
@@ -566,7 +568,8 @@ fn_node* CLG_(get_fn_node)(BB* bb)
          fn->pop_on_jump = True;
 
          if (VG_(clo_verbosity) > 1)
-             VG_(message)(Vg_DebugMsg, "Symbol match: found runtime_resolve: %s +%#lx=%#lx",
+             VG_(message)(Vg_DebugMsg, "Symbol match: found runtime_resolve:"
+                                        " %s +%#lx=%#lx\n",
                      bb->obj->name + bb->obj->last_slash_pos,
                      bb->offset, bb_addr(bb));
       }
index a2a62539b224f3edb25031c0647534d938b1b8a4..53ae058d039ea3ceecc770eaa99eca50fc794de7 100644 (file)
@@ -1005,7 +1005,7 @@ static void zero_thread_cost(thread_info* t)
 void CLG_(zero_all_cost)(Bool only_current_thread)
 {
   if (VG_(clo_verbosity) > 1)
-    VG_(message)(Vg_DebugMsg, "  Zeroing costs...");
+    VG_(message)(Vg_DebugMsg, "  Zeroing costs...\n");
 
   if (only_current_thread)
     zero_thread_cost(CLG_(get_current_thread)());
@@ -1013,7 +1013,7 @@ void CLG_(zero_all_cost)(Bool only_current_thread)
     CLG_(forall_threads)(zero_thread_cost);
 
   if (VG_(clo_verbosity) > 1)
-    VG_(message)(Vg_DebugMsg, "  ...done");
+    VG_(message)(Vg_DebugMsg, "  ...done\n");
 }
 
 static
@@ -1055,7 +1055,7 @@ void CLG_(set_instrument_state)(Char* reason, Bool state)
     CLG_(forall_threads)(zero_thread_cost);
 
   if (VG_(clo_verbosity) > 1)
-    VG_(message)(Vg_DebugMsg, "%s: instrumentation switched %s",
+    VG_(message)(Vg_DebugMsg, "%s: instrumentation switched %s\n",
                 reason, state ? "ON" : "OFF");
 }
   
@@ -1197,76 +1197,76 @@ void finish(void)
       CLG_(stat).file_line_debug_BBs +
       CLG_(stat).no_debug_BBs;
     
-    VG_(message)(Vg_DebugMsg, "");
-    VG_(message)(Vg_DebugMsg, "Distinct objects: %d",
+    VG_(message)(Vg_DebugMsg, "\n");
+    VG_(message)(Vg_DebugMsg, "Distinct objects: %d\n",
                 CLG_(stat).distinct_objs);
-    VG_(message)(Vg_DebugMsg, "Distinct files:   %d",
+    VG_(message)(Vg_DebugMsg, "Distinct files:   %d\n",
                 CLG_(stat).distinct_files);
-    VG_(message)(Vg_DebugMsg, "Distinct fns:     %d",
+    VG_(message)(Vg_DebugMsg, "Distinct fns:     %d\n",
                 CLG_(stat).distinct_fns);
-    VG_(message)(Vg_DebugMsg, "Distinct contexts:%d",
+    VG_(message)(Vg_DebugMsg, "Distinct contexts:%d\n",
                 CLG_(stat).distinct_contexts);
-    VG_(message)(Vg_DebugMsg, "Distinct BBs:     %d",
+    VG_(message)(Vg_DebugMsg, "Distinct BBs:     %d\n",
                 CLG_(stat).distinct_bbs);
-    VG_(message)(Vg_DebugMsg, "Cost entries:     %d (Chunks %d)",
+    VG_(message)(Vg_DebugMsg, "Cost entries:     %d (Chunks %d)\n",
                 CLG_(costarray_entries), CLG_(costarray_chunks));
-    VG_(message)(Vg_DebugMsg, "Distinct BBCCs:   %d",
+    VG_(message)(Vg_DebugMsg, "Distinct BBCCs:   %d\n",
                 CLG_(stat).distinct_bbccs);
-    VG_(message)(Vg_DebugMsg, "Distinct JCCs:    %d",
+    VG_(message)(Vg_DebugMsg, "Distinct JCCs:    %d\n",
                 CLG_(stat).distinct_jccs);
-    VG_(message)(Vg_DebugMsg, "Distinct skips:   %d",
+    VG_(message)(Vg_DebugMsg, "Distinct skips:   %d\n",
                 CLG_(stat).distinct_skips);
-    VG_(message)(Vg_DebugMsg, "BB lookups:       %d",
+    VG_(message)(Vg_DebugMsg, "BB lookups:       %d\n",
                 BB_lookups);
     if (BB_lookups>0) {
-      VG_(message)(Vg_DebugMsg, "With full      debug info:%3d%% (%d)", 
+      VG_(message)(Vg_DebugMsg, "With full      debug info:%3d%% (%d)\n", 
                   CLG_(stat).full_debug_BBs    * 100 / BB_lookups,
                   CLG_(stat).full_debug_BBs);
-      VG_(message)(Vg_DebugMsg, "With file/line debug info:%3d%% (%d)", 
+      VG_(message)(Vg_DebugMsg, "With file/line debug info:%3d%% (%d)\n", 
                   CLG_(stat).file_line_debug_BBs * 100 / BB_lookups,
                   CLG_(stat).file_line_debug_BBs);
-      VG_(message)(Vg_DebugMsg, "With fn name   debug info:%3d%% (%d)", 
+      VG_(message)(Vg_DebugMsg, "With fn name   debug info:%3d%% (%d)\n", 
                   CLG_(stat).fn_name_debug_BBs * 100 / BB_lookups,
                   CLG_(stat).fn_name_debug_BBs);
-      VG_(message)(Vg_DebugMsg, "With no        debug info:%3d%% (%d)", 
+      VG_(message)(Vg_DebugMsg, "With no        debug info:%3d%% (%d)\n", 
                   CLG_(stat).no_debug_BBs      * 100 / BB_lookups,
                   CLG_(stat).no_debug_BBs);
     }
-    VG_(message)(Vg_DebugMsg, "BBCC Clones:       %d",
+    VG_(message)(Vg_DebugMsg, "BBCC Clones:       %d\n",
                 CLG_(stat).bbcc_clones);
-    VG_(message)(Vg_DebugMsg, "BBs Retranslated:  %d",
+    VG_(message)(Vg_DebugMsg, "BBs Retranslated:  %d\n",
                 CLG_(stat).bb_retranslations);
-    VG_(message)(Vg_DebugMsg, "Distinct instrs:   %d",
+    VG_(message)(Vg_DebugMsg, "Distinct instrs:   %d\n",
                 CLG_(stat).distinct_instrs);
     VG_(message)(Vg_DebugMsg, "");
     
-    VG_(message)(Vg_DebugMsg, "LRU Contxt Misses: %d",
+    VG_(message)(Vg_DebugMsg, "LRU Contxt Misses: %d\n",
                 CLG_(stat).cxt_lru_misses);
-    VG_(message)(Vg_DebugMsg, "LRU BBCC Misses:   %d",
+    VG_(message)(Vg_DebugMsg, "LRU BBCC Misses:   %d\n",
                 CLG_(stat).bbcc_lru_misses);
-    VG_(message)(Vg_DebugMsg, "LRU JCC Misses:    %d",
+    VG_(message)(Vg_DebugMsg, "LRU JCC Misses:    %d\n",
                 CLG_(stat).jcc_lru_misses);
-    VG_(message)(Vg_DebugMsg, "BBs Executed:      %llu",
+    VG_(message)(Vg_DebugMsg, "BBs Executed:      %llu\n",
                 CLG_(stat).bb_executions);
-    VG_(message)(Vg_DebugMsg, "Calls:             %llu",
+    VG_(message)(Vg_DebugMsg, "Calls:             %llu\n",
                 CLG_(stat).call_counter);
-    VG_(message)(Vg_DebugMsg, "CondJMP followed:  %llu",
+    VG_(message)(Vg_DebugMsg, "CondJMP followed:  %llu\n",
                 CLG_(stat).jcnd_counter);
-    VG_(message)(Vg_DebugMsg, "Boring JMPs:       %llu",
+    VG_(message)(Vg_DebugMsg, "Boring JMPs:       %llu\n",
                 CLG_(stat).jump_counter);
-    VG_(message)(Vg_DebugMsg, "Recursive calls:   %llu",
+    VG_(message)(Vg_DebugMsg, "Recursive calls:   %llu\n",
                 CLG_(stat).rec_call_counter);
-    VG_(message)(Vg_DebugMsg, "Returns:           %llu",
+    VG_(message)(Vg_DebugMsg, "Returns:           %llu\n",
                 CLG_(stat).ret_counter);
 
     VG_(message)(Vg_DebugMsg, "");
   }
 
   CLG_(sprint_eventmapping)(buf, CLG_(dumpmap));
-  VG_(message)(Vg_UserMsg, "Events    : %s", buf);
+  VG_(message)(Vg_UserMsg, "Events    : %s\n", buf);
   CLG_(sprint_mappingcost)(buf, CLG_(dumpmap), CLG_(total_cost));
-  VG_(message)(Vg_UserMsg, "Collected : %s", buf);
-  VG_(message)(Vg_UserMsg, "");
+  VG_(message)(Vg_UserMsg, "Collected : %s\n", buf);
+  VG_(message)(Vg_UserMsg, "\n");
 
   //  if (CLG_(clo).simulate_cache)
   (*CLG_(cachesim).printstat)();
@@ -1308,7 +1308,7 @@ void CLG_(post_clo_init)(void)
    CLG_DEBUG(1, "  rec. sep. : %d\n", CLG_(clo).separate_recursions);
 
    if (!CLG_(clo).dump_line && !CLG_(clo).dump_instr && !CLG_(clo).dump_bb) {
-       VG_(message)(Vg_UserMsg, "Using source line as position.");
+       VG_(message)(Vg_UserMsg, "Using source line as position.\n");
        CLG_(clo).dump_line = True;
    }
 
@@ -1333,7 +1333,7 @@ void CLG_(post_clo_init)(void)
 
    if (VG_(clo_verbosity > 0)) {
       VG_(message)(Vg_UserMsg,
-                   "For interactive control, run 'callgrind_control -h'.");
+                   "For interactive control, run 'callgrind_control -h'.\n");
    }
 }
 
index 9e53f8916916f14ebc6c78d272f05252050d3b22..a84ee5ad48937f122da5f79aa3b53890fafe2ca9 100644 (file)
@@ -673,7 +673,7 @@ void cacheuse_initcache(cache_t2* c)
      */
     if ( (1<<c->tag_shift) < c->assoc) {
        VG_(message)(Vg_DebugMsg,
-                    "error: Use associativity < %d for cache use statistics!",
+                    "error: Use associativity < %d for cache use statistics!\n",
                     (1<<c->tag_shift) );
        VG_(tool_panic)("Unsupported cache configuration");
     }
@@ -1307,13 +1307,13 @@ void check_cache(cache_t* cache, Char *name)
    if (( cache->size % (cache->line_size * cache->assoc) != 0) ||
        (-1 == VG_(log2)(cache->size/cache->line_size/cache->assoc))) {
       VG_(message)(Vg_UserMsg,
-         "error: %s set count not a power of two; aborting.",
+         "error: %s set count not a power of two; aborting.\n",
          name);
    }
 
    if (-1 == VG_(log2)(cache->line_size)) {
       VG_(message)(Vg_UserMsg,
-         "error: %s line size of %dB not a power of two; aborting.",
+         "error: %s line size of %dB not a power of two; aborting.\n",
          name, cache->line_size);
       VG_(exit)(1);
    }
@@ -1323,7 +1323,7 @@ void check_cache(cache_t* cache, Char *name)
    // stupid anyway.
    if (cache->line_size < MIN_LINE_SIZE) {
       VG_(message)(Vg_UserMsg,
-         "error: %s line size of %dB too small; aborting.",
+         "error: %s line size of %dB too small; aborting.\n",
          name, cache->line_size);
       VG_(exit)(1);
    }
@@ -1331,7 +1331,7 @@ void check_cache(cache_t* cache, Char *name)
    /* Then check cache size > line size (causes seg faults if not). */
    if (cache->size <= cache->line_size) {
       VG_(message)(Vg_UserMsg,
-         "error: %s cache size of %dB <= line size of %dB; aborting.",
+         "error: %s cache size of %dB <= line size of %dB; aborting.\n",
          name, cache->size, cache->line_size);
       VG_(exit)(1);
    }
@@ -1339,7 +1339,7 @@ void check_cache(cache_t* cache, Char *name)
    /* Then check assoc <= (size / line size) (seg faults otherwise). */
    if (cache->assoc > (cache->size / cache->line_size)) {
       VG_(message)(Vg_UserMsg,
-         "warning: %s associativity > (size / line size); aborting.", name);
+         "warning: %s associativity > (size / line size); aborting.\n", name);
       VG_(exit)(1);
    }
 }
@@ -1371,12 +1371,12 @@ void configure_caches(cache_t* I1c, cache_t* D1c, cache_t* L2c)
    check_cache(L2c, "L2");
 
    if (VG_(clo_verbosity) > 1) {
-      VG_(message)(Vg_UserMsg, "Cache configuration used:");
-      VG_(message)(Vg_UserMsg, "  I1: %dB, %d-way, %dB lines",
+      VG_(message)(Vg_UserMsg, "Cache configuration used:\n");
+      VG_(message)(Vg_UserMsg, "  I1: %dB, %d-way, %dB lines\n",
                                I1c->size, I1c->assoc, I1c->line_size);
-      VG_(message)(Vg_UserMsg, "  D1: %dB, %d-way, %dB lines",
+      VG_(message)(Vg_UserMsg, "  D1: %dB, %d-way, %dB lines\n",
                                D1c->size, D1c->assoc, D1c->line_size);
-      VG_(message)(Vg_UserMsg, "  L2: %dB, %d-way, %dB lines",
+      VG_(message)(Vg_UserMsg, "  L2: %dB, %d-way, %dB lines\n",
                                L2c->size, L2c->assoc, L2c->line_size);
    }
 #undef CMD_LINE_DEFINED
@@ -1446,13 +1446,15 @@ static void cachesim_post_clo_init(void)
       /* Output warning for not supported option combinations */
       if (clo_simulate_hwpref) {
          VG_(message)(Vg_DebugMsg,
-                      "warning: prefetch simulation can not be used with cache usage");
+                      "warning: prefetch simulation can not be "
+                       "used with cache usage\n");
          clo_simulate_hwpref = False;
       }
 
       if (clo_simulate_writeback) {
          VG_(message)(Vg_DebugMsg,
-                      "warning: write-back simulation can not be used with cache usage");
+                      "warning: write-back simulation can not be "
+                       "used with cache usage\n");
          clo_simulate_writeback = False;
       }
 
@@ -1652,25 +1654,25 @@ void cachesim_printstat(void)
   Int p;
 
   if ((VG_(clo_verbosity) >1) && clo_simulate_hwpref) {
-    VG_(message)(Vg_DebugMsg, "Prefetch Up:       %llu", 
+    VG_(message)(Vg_DebugMsg, "Prefetch Up:       %llu\n", 
                 prefetch_up);
-    VG_(message)(Vg_DebugMsg, "Prefetch Down:     %llu", 
+    VG_(message)(Vg_DebugMsg, "Prefetch Down:     %llu\n", 
                 prefetch_down);
-    VG_(message)(Vg_DebugMsg, "");
+    VG_(message)(Vg_DebugMsg, "\n");
   }
 
   /* I cache results.  Use the I_refs value to determine the first column
    * width. */
   l1 = commify(total[CLG_(sets).off_full_Ir], 0, buf1);
-  VG_(message)(Vg_UserMsg, "I   refs:      %s", buf1);
+  VG_(message)(Vg_UserMsg, "I   refs:      %s\n", buf1);
 
   if (!CLG_(clo).simulate_cache) return;
 
   commify(total[CLG_(sets).off_full_Ir +1], l1, buf1);
-  VG_(message)(Vg_UserMsg, "I1  misses:    %s", buf1);
+  VG_(message)(Vg_UserMsg, "I1  misses:    %s\n", buf1);
 
   commify(total[CLG_(sets).off_full_Ir +2], l1, buf1);
-  VG_(message)(Vg_UserMsg, "L2i misses:    %s", buf1);
+  VG_(message)(Vg_UserMsg, "L2i misses:    %s\n", buf1);
 
   p = 100;
 
@@ -1679,12 +1681,12 @@ void cachesim_printstat(void)
 
   percentify(total[CLG_(sets).off_full_Ir+1] * 100 * p /
             total[CLG_(sets).off_full_Ir], p, l1+1, buf1);
-  VG_(message)(Vg_UserMsg, "I1  miss rate: %s", buf1);
+  VG_(message)(Vg_UserMsg, "I1  miss rate: %s\n", buf1);
        
   percentify(total[CLG_(sets).off_full_Ir+2] * 100 * p /
             total[CLG_(sets).off_full_Ir], p, l1+1, buf1);
-  VG_(message)(Vg_UserMsg, "L2i miss rate: %s", buf1);
-  VG_(message)(Vg_UserMsg, "");
+  VG_(message)(Vg_UserMsg, "L2i miss rate: %s\n", buf1);
+  VG_(message)(Vg_UserMsg, "\n");
    
   /* D cache results.
      Use the D_refs.rd and D_refs.wr values to determine the
@@ -1698,19 +1700,19 @@ void cachesim_printstat(void)
   commify( D_total[0], l1, buf1);
   l2 = commify(total[CLG_(sets).off_full_Dr], 0,  buf2);
   l3 = commify(total[CLG_(sets).off_full_Dw], 0,  buf3);
-  VG_(message)(Vg_UserMsg, "D   refs:      %s  (%s rd + %s wr)",
+  VG_(message)(Vg_UserMsg, "D   refs:      %s  (%s rd + %s wr)\n",
               buf1,  buf2,  buf3);
 
   commify( D_total[1], l1, buf1);
   commify(total[CLG_(sets).off_full_Dr+1], l2, buf2);
   commify(total[CLG_(sets).off_full_Dw+1], l3, buf3);
-  VG_(message)(Vg_UserMsg, "D1  misses:    %s  (%s rd + %s wr)",
+  VG_(message)(Vg_UserMsg, "D1  misses:    %s  (%s rd + %s wr)\n",
               buf1, buf2, buf3);
 
   commify( D_total[2], l1, buf1);
   commify(total[CLG_(sets).off_full_Dr+2], l2, buf2);
   commify(total[CLG_(sets).off_full_Dw+2], l3, buf3);
-  VG_(message)(Vg_UserMsg, "L2d misses:    %s  (%s rd + %s wr)",
+  VG_(message)(Vg_UserMsg, "L2d misses:    %s  (%s rd + %s wr)\n",
               buf1, buf2, buf3);
 
   p = 10;
@@ -1724,15 +1726,17 @@ void cachesim_printstat(void)
             total[CLG_(sets).off_full_Dr], p, l2+1, buf2);
   percentify(total[CLG_(sets).off_full_Dw+1] * 100 * p /
             total[CLG_(sets).off_full_Dw], p, l3+1, buf3);
-  VG_(message)(Vg_UserMsg, "D1  miss rate: %s (%s   + %s  )", buf1, buf2,buf3);
+  VG_(message)(Vg_UserMsg, "D1  miss rate: %s (%s   + %s  )\n", 
+               buf1, buf2,buf3);
   
   percentify( D_total[2] * 100 * p / D_total[0],  p, l1+1, buf1);
   percentify(total[CLG_(sets).off_full_Dr+2] * 100 * p /
             total[CLG_(sets).off_full_Dr], p, l2+1, buf2);
   percentify(total[CLG_(sets).off_full_Dw+2] * 100 * p /
             total[CLG_(sets).off_full_Dw], p, l3+1, buf3);
-  VG_(message)(Vg_UserMsg, "L2d miss rate: %s (%s   + %s  )", buf1, buf2,buf3);
-  VG_(message)(Vg_UserMsg, "");
+  VG_(message)(Vg_UserMsg, "L2d miss rate: %s (%s   + %s  )\n", 
+               buf1, buf2,buf3);
+  VG_(message)(Vg_UserMsg, "\n");
 
 
   
@@ -1749,7 +1753,7 @@ void cachesim_printstat(void)
   commify(L2_total,   l1, buf1);
   commify(L2_total_r, l2, buf2);
   commify(L2_total_w, l3, buf3);
-  VG_(message)(Vg_UserMsg, "L2 refs:       %s  (%s rd + %s wr)",
+  VG_(message)(Vg_UserMsg, "L2 refs:       %s  (%s rd + %s wr)\n",
               buf1, buf2, buf3);
   
   L2_total_m  =
@@ -1763,7 +1767,7 @@ void cachesim_printstat(void)
   commify(L2_total_m,  l1, buf1);
   commify(L2_total_mr, l2, buf2);
   commify(L2_total_mw, l3, buf3);
-  VG_(message)(Vg_UserMsg, "L2 misses:     %s  (%s rd + %s wr)",
+  VG_(message)(Vg_UserMsg, "L2 misses:     %s  (%s rd + %s wr)\n",
               buf1, buf2, buf3);
   
   percentify(L2_total_m  * 100 * p /
@@ -1773,7 +1777,7 @@ void cachesim_printstat(void)
             p, l2+1, buf2);
   percentify(L2_total_mw * 100 * p /
             total[CLG_(sets).off_full_Dw], p, l3+1, buf3);
-  VG_(message)(Vg_UserMsg, "L2 miss rate:  %s (%s   + %s  )",
+  VG_(message)(Vg_UserMsg, "L2 miss rate:  %s (%s   + %s  )\n",
               buf1, buf2,buf3);
 }