dwarf info in modules.

Tigran Aivazian tigran_aivazian@symantec.com
Mon Sep 12 10:05:00 GMT 2005


Hi,

I attempted to use systemtap 0.3 with modules and wrote trivial two-liner 
stp script:

probe module("tmod").function("*@tmod.c") { log ("enter") }
probe module("tmod").function("*@tmod.c").return { log ("exit") }

where tmod.c is a short module containing a single function called by both 
->init() and ->exit() entry points. I compile it with "-g" and also 
readelf -w kmod.ko shows that all DWARF2 debug info is present. However 
stap complains claiming it is missing:

# lsmod | grep tmod
tmod                    3584  0
# stap tmod.stp
WARNING: no dwarf info found for module tmod
semantic error: no match for probe point
          while: resolving probe point module("tmod").function("*@tmod.c")
WARNING: no dwarf info found for module tmod
semantic error: no match for probe point
          while: resolving probe point 
module("tmod").function("*@tmod.c").return
Pass 2: analysis failed.  Try again with '-v' (verbose) option.

This is on x86_64 architecture and 2.6.9-16.ELsmp kernel (of RHEL4 
update2).

Any ideas what is it that I am obviously doing wrong? (I have read the 
arch-0505 paper according to which my 2-liner script seems fine, i.e. both 
the probe family and probe points are specified correctly).

Kind regards
Tigran

Here is tmod.c:

# cat tmod.c
#include <linux/init.h>
#include <linux/sched.h>
#include <linux/module.h>

MODULE_DESCRIPTION("Test module");
MODULE_AUTHOR("Tigran Aivazian <tigran_aivazian@symantec.com>");
MODULE_LICENSE("GPL");

int tmod_func(int x)
{
         printk(KERN_INFO "tmod: tmod_func(%d)\n", x);
         return 0;
}

static int __init tmod_init(void)
{
         tmod_func(0);
         printk(KERN_INFO "tmod: ->init()\n");
         return 0;
}

static void __exit tmod_exit(void)
{
         tmod_func(1);
         printk(KERN_INFO "tmod: ->exit()\n");
}

module_init(tmod_init)
module_exit(tmod_exit)

EXPORT_SYMBOL(tmod_func);



More information about the Systemtap mailing list