[sysprof] Various debug spew



commit 29e270cb8d2fe0273e91118627a65f24d480b540
Author: Søren Sandmann Pedersen <ssp redhat com>
Date:   Mon Sep 7 21:22:48 2009 -0400

    Various debug spew

 collector.c |    5 ++++-
 tracker.c   |   15 ++++++++++-----
 2 files changed, 14 insertions(+), 6 deletions(-)
---
diff --git a/collector.c b/collector.c
index 3c54e2d..230e406 100644
--- a/collector.c
+++ b/collector.c
@@ -237,7 +237,8 @@ on_read (gpointer data)
 /* FIXME: return proper errors */
 #define fail(x)								\
     do {								\
-	g_printerr ("the fail is strong %s\n", x);			\
+	g_printerr ("the fail is ");					\
+	perror (x);							\
 	exit (-1);							\
     } while (0)
 
@@ -404,6 +405,8 @@ collector_new (CollectorFunc callback,
 static void
 process_mmap (Collector *collector, mmap_event_t *mmap)
 {
+    g_print ("%d %d => %s at %llx\n", mmap->pid, mmap->tid, mmap->filename, mmap->addr);
+    
     tracker_add_map (collector->tracker,
 		     mmap->pid,
 		     mmap->addr,
diff --git a/tracker.c b/tracker.c
index 3e0908b..d329c2a 100644
--- a/tracker.c
+++ b/tracker.c
@@ -287,9 +287,7 @@ tracker_add_map (tracker_t * tracker,
     
     tracker_append (tracker, &event, sizeof (event));
     
-#if 0
-    g_print ("   Added new map: %d (%s)\n", pid, filename);
-#endif
+    g_print ("   Added new map: %d (%s) %llx -- %llx \n", pid, filename, start, end);
 }
 
 void
@@ -644,7 +642,7 @@ process_locate_map (process_t *process, gulong addr)
 }
 
 const char *
-lookup_user_symbol (process_t *process, gulong address)
+lookup_user_symbol (process_t *process, uint64_t address)
 {
     static const char *const kernel = "[kernel]";
     const BinSymbol *result;
@@ -662,6 +660,8 @@ lookup_user_symbol (process_t *process, gulong address)
     {
 	if (!process->undefined)
 	{
+	    g_print ("no map for %llx in %d (%s)\n", address, process->pid, process->comm);
+	    
 	    process->undefined =
 		g_strdup_printf ("No map (%s)", process->comm);
 	}
@@ -807,7 +807,12 @@ process_sample (state_t *state, StackStash *resolved, sample_t *sample)
     
     if (!process)
     {
-	g_warning ("sample for unknown process %d\n", sample->pid);
+	static gboolean warned;
+	if (!warned)
+	{
+	    g_warning ("sample for unknown process %d", sample->pid);
+	    warned = TRUE;
+	}
 	return;
     }
     



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]