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 */
#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,

View File

@ -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;
}