Merge callgrind/ changes from branches/MESSAGING_TIDYUP r10464.
See trunk r10465 commit message for details.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10471 a5019735-40e9-0310-863c-91ae7b9d1cf9
diff --git a/callgrind/bb.c b/callgrind/bb.c
index 3b8d1e8..2dca73e 100644
--- a/callgrind/bb.c
+++ b/callgrind/bb.c
@@ -259,13 +259,13 @@
   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 );
diff --git a/callgrind/callstack.c b/callgrind/callstack.c
index 988bde4..70495e1 100644
--- a/callgrind/callstack.c
+++ b/callgrind/callstack.c
@@ -124,7 +124,7 @@
     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 @@
     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		
diff --git a/callgrind/command.c b/callgrind/command.c
index 78f57d8..e9b40c2 100644
--- a/callgrind/command.c
+++ b/callgrind/command.c
@@ -113,7 +113,7 @@
 		   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 @@
 
     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);
     }
diff --git a/callgrind/dump.c b/callgrind/dump.c
index 28bb8eb..488775a 100644
--- a/callgrind/dump.c
+++ b/callgrind/dump.c
@@ -1265,7 +1265,7 @@
 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 @@
    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 @@
     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 @@
    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 @@
    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) */
diff --git a/callgrind/fn.c b/callgrind/fn.c
index 58a69c8..0845a13 100644
--- a/callgrind/fn.c
+++ b/callgrind/fn.c
@@ -75,7 +75,8 @@
 		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 @@
             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->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));
       }
diff --git a/callgrind/main.c b/callgrind/main.c
index a2a6253..53ae058 100644
--- a/callgrind/main.c
+++ b/callgrind/main.c
@@ -1005,7 +1005,7 @@
 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 @@
     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 @@
     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 @@
       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 @@
    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 @@
 
    if (VG_(clo_verbosity > 0)) {
       VG_(message)(Vg_UserMsg,
-                   "For interactive control, run 'callgrind_control -h'.");
+                   "For interactive control, run 'callgrind_control -h'.\n");
    }
 }
 
diff --git a/callgrind/sim.c b/callgrind/sim.c
index 9e53f89..a84ee5a 100644
--- a/callgrind/sim.c
+++ b/callgrind/sim.c
@@ -673,7 +673,7 @@
      */
     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 @@
    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 @@
    // 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 @@
    /* 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 @@
    /* 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 @@
    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 @@
       /* 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 @@
   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 @@
 
   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 @@
   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 @@
 	     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 @@
   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 @@
   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 @@
 	     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);
 }