diff --git a/ChangeLog b/ChangeLog index 846bbae0..94bb4fe1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,16 @@ +Tue Aug 30 16:57:33 2005 Søren Sandmann + + * configure.ac: Complain if we can't find /lib/modules/`uname + -r`/build/Makefile. + + * process.c (process_lookup_symbol): Take an address of 0x1 to + mean "in kernel". + + * module/sysprof-module.c (timer_notify): When reporting in-kernel + time, give the current pid instead of -1. + + * TODO: updates + Mon Aug 15 20:39:11 2005 Soeren Sandmann * binfile.c, process.c, profile.c: Fix some warnings. diff --git a/TODO b/TODO index 7424ea7e..9cf2699f 100644 --- a/TODO +++ b/TODO @@ -1,5 +1,10 @@ Before 1.0: +* Fix cache so that it correctly reloads libraries when new ones are + installed. (Cache can go stale - probably just dump the cache when + a new profiling session is started). Though printing debug stuff + doesn't seem to produce anything unexpected. + * Build system - Find out what distributions it actually works on (ask for sucess/failure-stories in 0.9.x releases) @@ -13,6 +18,7 @@ Before 1.0: - Announce on Freshmeat - Announce on Advogato - Announce on gnome-announce + - Announce on kernel list. - Announce on devtools list (?) Before 1.2: diff --git a/configure.ac b/configure.ac index 1382145d..0378ce16 100644 --- a/configure.ac +++ b/configure.ac @@ -77,12 +77,18 @@ KMINOR=`uname -r | cut -d"." -f 2` KMICRO=`uname -r | cut -d"." -f 3 | cut -d"-" -f 1` if [[ $KMICRO -lt 11 ]] ; then - if [[ $KMICRO -gt 8 ]]; then - echo - echo Linux \>= 2.6.11 is required - echo - exit 1 - fi + echo * + echo * Linux \>= 2.6.11 is required + echo * + exit 1 +fi + +if [ ! test -f /lib/modules/`uname -r`/build/Makefile ] ; then + echo \* + echo \* Sysprof requires the kernel source code to be installed. + echo \* On a Fedora Core system the relevant package is kernel-devel + echo \* + exit 1 fi AC_OUTPUT diff --git a/module/sysprof-module.c b/module/sysprof-module.c index 3389430f..5faa741d 100644 --- a/module/sysprof-module.c +++ b/module/sysprof-module.c @@ -462,10 +462,12 @@ timer_notify (struct pt_regs *regs) { /* kernel */ - trace->pid = -1; + trace->pid = current->pid; trace->truncated = 0; trace->n_addresses = 1; - trace->addresses[0] = 0x0; + + /* 0x1 is taken by sysprof to mean "in kernel" */ + trace->addresses[0] = (void *)0x1; } else { diff --git a/process.c b/process.c index a98ca991..5e1cd0d2 100644 --- a/process.c +++ b/process.c @@ -342,17 +342,26 @@ process_lookup_symbol (Process *process, gulong address) { static Symbol undefined; const Symbol *result; + static Symbol kernel; Map *map = process_locate_map (process, address); /* g_print ("addr: %x\n", address); */ - + if (!map) { - if (undefined.name) - g_free (undefined.name); - undefined.name = g_strdup_printf ("??? %s", process->cmdline); - undefined.address = 0xBABE0001; - + if (address == 0x1) + { + kernel.name = "in kernel"; + kernel.address = 0x0001337; + return &kernel; + } + else + { + if (undefined.name) + g_free (undefined.name); + undefined.name = g_strdup_printf ("??? %s", process->cmdline); + undefined.address = 0xBABE0001; + } #if 0 g_print ("no map for %p (%s)\n", address, process->cmdline); #endif