6 вересня 2009 о 22:44 +0200 Lucas Nussbaum написав(-ла):
> [ 3] .text                PROGBITS     c10000e0 0010e0 242af5  0 AX     0   0 
> 32
From stap log:
found kernel _stext load address: 0xc01010e8

> 
> > Are you using relocable kernel (CONFIG_RELOCATABLE)?
> 
> Yes. I used config-2.6.30-1-686 as a basis, and only modified what was
> needed for systemtap (config attached).
I think this is the problem, I dont see where relocations are applied to
build id address in systemtap. I made a patch (attached) that assumes
that offset between _stext and build is the same after relocation. Could
you try it (just put into debian/patches and rebuild systemtap)?


diff -ruN systemtap-0.9.9-old/runtime/sym.c systemtap-0.9.9/runtime/sym.c
--- systemtap-0.9.9-old/runtime/sym.c   2009-08-05 05:53:49.000000000 +0200
+++ systemtap-0.9.9/runtime/sym.c       2009-09-06 23:33:15.148720468 +0200
@@ -259,7 +259,7 @@
 
                    /* notes end address */
                    if (!strcmp(m->name, "kernel")) {
-                         notes_addr = m->build_id_offset;
+                         notes_addr = _stp_module_relocate("kernel", "_stext", 
m->build_id_offset);
                          base_addr = _stp_module_relocate("kernel",
                                                           "_stext", 0);
                     } else {
diff -ruN systemtap-0.9.9-old/translate.cxx systemtap-0.9.9/translate.cxx
--- systemtap-0.9.9-old/translate.cxx   2009-08-05 05:53:49.000000000 +0200
+++ systemtap-0.9.9/translate.cxx       2009-09-06 23:32:23.765440472 +0200
@@ -4883,7 +4883,7 @@
        correct either.  We may instead need a relocation basis different
        from _stext, such as __start_notes.  */
     if (modname == "kernel")
-      c->output << ".build_id_offset = 0x" << hex << build_id_vaddr
+      c->output << ".build_id_offset = 0x" << hex << build_id_vaddr - (base + 
extra_offset)
                 << dec << ",\n";
     else
       c->output << ".build_id_offset = 0x" << hex

Attachment: signature.asc
Description: Digital signature

Reply via email to