Make previous change print to stderr.
authordbaron@dbaron.org
Tue, 03 Apr 2007 17:45:07 -0700
changeset 310 fd323341d5eb7bafbcc98953df975b101591fa41
parent 309 503b4a4f93bba4ee0aeda47244397c40481399cb
child 311 77cfceb0d4253e49ba5b9f87b5f279face65826b
push idunknown
push userunknown
push dateunknown
milestone1.9a4pre
Make previous change print to stderr.
tools/trace-malloc/tmreader.c
--- a/tools/trace-malloc/tmreader.c
+++ b/tools/trace-malloc/tmreader.c
@@ -152,64 +152,64 @@ static int get_tmevent(FILE *fp, tmevent
         return 0;
     switch (c) {
       case TM_EVENT_LIBRARY:
         s = get_string(fp);
         if (!s)
             return 0;
         event->u.libname = s;
 #ifdef DEBUG_tmreader
-        printf("tmevent %c %u libname=\"%s\"\n", event->type, event->serial,
-               event->u.libname);
+        fprintf(stderr, "tmevent %c %u libname=\"%s\"\n", event->type, event->serial,
+                event->u.libname);
 #endif
         break;
 
       case TM_EVENT_FILENAME:
         s = get_string(fp);
         if (!s)
             return 0;
         event->u.srcname = s;
 #ifdef DEBUG_tmreader
-        printf("tmevent %c %u srcname=\"%s\"\n", event->type, event->serial,
-               event->u.srcname);
+        fprintf(stderr, "tmevent %c %u srcname=\"%s\"\n",
+                event->type, event->serial, event->u.srcname);
 #endif
         break;
 
       case TM_EVENT_METHOD:
         if (!get_uint32(fp, &event->u.method.library))
             return 0;
         if (!get_uint32(fp, &event->u.method.filename))
             return 0;
         if (!get_uint32(fp, &event->u.method.linenumber))
             return 0;
         s = get_string(fp);
         if (!s)
             return 0;
         event->u.method.name = s;
 #ifdef DEBUG_tmreader
-        printf("tmevent %c %u library=%u filename=%u linenumber=%u "
-               "name=\"%s\"\n",
-               event->type, event->serial,
-               event->u.method.library, event->u.method.filename,
-               event->u.method.linenumber, event->u.method.name);
+        fprintf(stderr, "tmevent %c %u library=%u filename=%u linenumber=%u "
+                "name=\"%s\"\n",
+                event->type, event->serial,
+                event->u.method.library, event->u.method.filename,
+                event->u.method.linenumber, event->u.method.name);
 #endif
         break;
 
       case TM_EVENT_CALLSITE:
         if (!get_uint32(fp, &event->u.site.parent))
             return 0;
         if (!get_uint32(fp, &event->u.site.method))
             return 0;
         if (!get_uint32(fp, &event->u.site.offset))
             return 0;
 #ifdef DEBUG_tmreader
-        printf("tmevent %c %u parent=%u method=%u offset=%u\n",
-               event->type, event->serial,
-               event->u.site.parent, event->u.site.method,
-               event->u.site.offset);
+        fprintf(stderr, "tmevent %c %u parent=%u method=%u offset=%u\n",
+                event->type, event->serial,
+                event->u.site.parent, event->u.site.method,
+                event->u.site.offset);
 #endif
         break;
 
       case TM_EVENT_MALLOC:
       case TM_EVENT_CALLOC:
       case TM_EVENT_FREE:
         if (!get_uint32(fp, &event->u.alloc.interval))
             return 0;
@@ -218,20 +218,20 @@ static int get_tmevent(FILE *fp, tmevent
         if (!get_uint32(fp, &event->u.alloc.ptr))
             return 0;
         if (!get_uint32(fp, &event->u.alloc.size))
             return 0;
         event->u.alloc.oldserial = 0;
         event->u.alloc.oldptr = 0;
         event->u.alloc.oldsize = 0;
 #ifdef DEBUG_tmreader
-        printf("tmevent %c %u interval=%u cost=%u ptr=0x%x size=%u\n",
-               event->type, event->serial,
-               event->u.alloc.interval, event->u.alloc.cost,
-               event->u.alloc.ptr, event->u.alloc.size);
+        fprintf(stderr, "tmevent %c %u interval=%u cost=%u ptr=0x%x size=%u\n",
+                event->type, event->serial,
+                event->u.alloc.interval, event->u.alloc.cost,
+                event->u.alloc.ptr, event->u.alloc.size);
 #endif
 #if defined(DEBUG_dp)
         if (c == TM_EVENT_MALLOC)
             printf("%d malloc %d 0x%p\n", event->u.alloc.cost,
                    event->u.alloc.size, event->u.alloc.ptr);
         else if (c == TM_EVENT_CALLOC)
             printf("%d calloc %d 0x%p\n", event->u.alloc.cost,
                    event->u.alloc.size, event->u.alloc.ptr);
@@ -252,23 +252,23 @@ static int get_tmevent(FILE *fp, tmevent
             return 0;
         if (!get_uint32(fp, &event->u.alloc.oldserial))
             return 0;
         if (!get_uint32(fp, &event->u.alloc.oldptr))
             return 0;
         if (!get_uint32(fp, &event->u.alloc.oldsize))
             return 0;
 #ifdef DEBUG_tmreader
-        printf("tmevent %c %u interval=%u cost=%u ptr=0x%x size=%u "
-               "oldserial=%u oldptr=0x%x oldsize=%u\n",
-               event->type, event->serial,
-               event->u.alloc.interval, event->u.alloc.cost,
-               event->u.alloc.ptr, event->u.alloc.size,
-               event->u.alloc.oldserial, event->u.alloc.oldptr,
-               event->u.alloc.oldsize);
+        fprintf(stderr, "tmevent %c %u interval=%u cost=%u ptr=0x%x size=%u "
+                "oldserial=%u oldptr=0x%x oldsize=%u\n",
+                event->type, event->serial,
+                event->u.alloc.interval, event->u.alloc.cost,
+                event->u.alloc.ptr, event->u.alloc.size,
+                event->u.alloc.oldserial, event->u.alloc.oldptr,
+                event->u.alloc.oldsize);
 #endif
 #if defined(DEBUG_dp)
         printf("%d realloc %d 0x%p %d\n", event->u.alloc.cost,
                event->u.alloc.size, event->u.alloc.ptr, event->u.alloc.oldsize);
 #endif
         break;
 
       case TM_EVENT_STATS:
@@ -312,17 +312,17 @@ static int get_tmevent(FILE *fp, tmevent
             return 0;
         if (!get_uint32(fp, &event->u.stats.tmstats.null_free_calls))
             return 0;
         if (!get_uint32(fp, &event->u.stats.calltree_maxkids_parent))
             return 0;
         if (!get_uint32(fp, &event->u.stats.calltree_maxstack_top))
             return 0;
 #ifdef DEBUG_tmreader
-        printf("tmevent %c %u\n", event->type, event->serial);
+        fprintf(stderr, "tmevent %c %u\n", event->type, event->serial);
 #endif
         break;
       default:
         fprintf(stderr, "Unknown event type %c\n", event->type);
         return 0;
     }
     return 1;
 }