This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Resolving Module Functions


I'm getting weird errors when I try to resolve module functions -- and
I'm not sure why.  I've confirmed that system tap is working, by
counting the number of printk's that happen in the kernel.  But, for
some reason, I am not having luck when it comes to finding out how
many times my module's function is called.

I'm attaching my ststemtap script.  Here is the output from running
with -vvv -- I see it find the module, but, for some reason, it can't
find the function names.  nm shows the functions to be there. . . .
any ideas?

----------------stap -vvv output-------------------
codemonkey@bananatree:~/work$ sudo ~codemonkey/systemtap/bin/stap -vvv
allocs.stp function_name
SystemTap translator/driver (version 0.9.5/0.131 commit 7a51212c)
Copyright (C) 2005-2009 Red Hat, Inc. and others
This is free software; see the source for copying conditions.
Session arch: x86_64 release: 2.6.27-11-generic
Created temporary directory "/tmp/stapabx6s6"
Searched '/home/codemonkey/systemtap/share/systemtap/tapset/x86_64/*.stp',
found 2
Searched '/home/codemonkey/systemtap/share/systemtap/tapset/*.stp', found 49
Pass 1: parsed user script and 51 library script(s) in 160usr/20sys/190real ms.
parsed 'function_name' -> func 'function_name'
blacklist regexps:
blfn: ^(atomic_notifier_call_chain|default_do_nmi|__die|die_nmi|do_debug|do_general_protection|do_int3|do_IRQ|do_page_fault|do_sparc64_fault|do_trap|dummy_nmi_callback|flush_icache_range|ia64_bad_break|ia64_do_page_fault|ia64_fault|io_check_error|mem_parity_error|nmi_watchdog_tick|notifier_call_chain|oops_begin|oops_end|program_check_exception|single_step_exception|sync_regs|unhandled_fault|unknown_nmi_error|.*raw_.*lock.*|.*read_.*lock.*|.*write_.*lock.*|.*spin_.*lock.*|.*rwlock_.*lock.*|.*rwsem_.*lock.*|.*mutex_.*lock.*|raw_.*|.*seq_.*lock.*|atomic_.*|atomic64_.*|get_bh|put_bh|.*apic.*|.*APIC.*|.*softirq.*|.*IRQ.*|.*_intr.*|__delay|.*kernel_text.*|get_current|current_.*|.*exception_tables.*|.*setup_rt_frame.*|.*preempt_count.*|preempt_schedule|__switch_to)$
blfn_ret: ^(do_exit|sys_exit|sys_exit_group)$
blfile: ^(kernel/kprobes.c|arch/.*/kernel/kprobes.c|include/asm/io.h|include/asm/bitops.h|arch/.*/include/asm/io.h|arch/.*/include/asm/bitops.h|drivers/ide/ide-iops.c)$
focused on module 'my_driver = [0x10000-0x87c20, bias 0x0] file
/lib/modules/2.6.27-11-generic/extras/my_driver-driver.ko ELF machine
|x86_64 (code 62)
focused on module 'my_driver'
WARNING: cannot find module my_driver debuginfo: No such file or directory
focused on module 'my_driver = [0xc4b3700-0xc52b320, bias 0x0] file
/lib/modules/2.6.27-11-generic/drivers/my-driver.ko ELF machine
|x86_64 (code 62)
focused on module 'my_driver'
WARNING: cannot find module my_driver debuginfo: No such file or directory
semantic error: no match while resolving probe point
module("my_driver").function("function_name")
Pass 2: analyzed script: 1 probe(s), 5 function(s), 0 embed(s), 1
global(s) in 14140usr/120sys/14259real ms.
Pass 2: analysis failed.  Try again with another '--vp 01' option.
Running rm -rf /tmp/stapabx6s6
codemonkey@bananatree:~/work$
----------------stap -vvv output-------------------


----------------allocs.stp-------------------
#!/usr/bin/env stap

probe module("my_driver").function(@1) { # probe functions listed on
command line
   called[probefunc()] <<<1 # add count efficiently
}

global called

probe end {
   foreach (fn in called-)  # sortby call count in decreasing order
      printf("%s %d\n", fn, @count(called[fn]))
   exit()
}
----------------allocs.stp-------------------


Anyone know what I'm doing wrong?


-Dave


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]