Various debug spew

This commit is contained in:
Søren Sandmann Pedersen
2009-09-07 21:22:48 -04:00
parent d34a1cf460
commit 29e270cb8d
2 changed files with 14 additions and 6 deletions

View File

@ -237,7 +237,8 @@ on_read (gpointer data)
/* FIXME: return proper errors */ /* FIXME: return proper errors */
#define fail(x) \ #define fail(x) \
do { \ do { \
g_printerr ("the fail is strong %s\n", x); \ g_printerr ("the fail is "); \
perror (x); \
exit (-1); \ exit (-1); \
} while (0) } while (0)
@ -404,6 +405,8 @@ collector_new (CollectorFunc callback,
static void static void
process_mmap (Collector *collector, mmap_event_t *mmap) 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, tracker_add_map (collector->tracker,
mmap->pid, mmap->pid,
mmap->addr, mmap->addr,

View File

@ -287,9 +287,7 @@ tracker_add_map (tracker_t * tracker,
tracker_append (tracker, &event, sizeof (event)); tracker_append (tracker, &event, sizeof (event));
#if 0 g_print (" Added new map: %d (%s) %llx -- %llx \n", pid, filename, start, end);
g_print (" Added new map: %d (%s)\n", pid, filename);
#endif
} }
void void
@ -644,7 +642,7 @@ process_locate_map (process_t *process, gulong addr)
} }
const char * 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]"; static const char *const kernel = "[kernel]";
const BinSymbol *result; const BinSymbol *result;
@ -662,6 +660,8 @@ lookup_user_symbol (process_t *process, gulong address)
{ {
if (!process->undefined) if (!process->undefined)
{ {
g_print ("no map for %llx in %d (%s)\n", address, process->pid, process->comm);
process->undefined = process->undefined =
g_strdup_printf ("No map (%s)", process->comm); g_strdup_printf ("No map (%s)", process->comm);
} }
@ -807,7 +807,12 @@ process_sample (state_t *state, StackStash *resolved, sample_t *sample)
if (!process) 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; return;
} }