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]

Re: Why can't I access 'kill_something_info' probes?


Om wrote:
Hi,
I am writing some scriptlets to check trace signals. (I know about the signal tapset, but...)


Here is the script.

# This traces kill related syscalls
#
probe kernel.function("sys_kill")
{
    printf("%d sends %d to %d\n", pid(), $sig, $pid)
}

probe kernel.function("kill_something_info")
{
    printf("info->si_signo=%d\n", $info->si_signo)
    printf("info->si_errno=%d\n", $info->si_errno)
}
probe timer.ms(10000)
{
    exit()
}

--End of script.

Errors here...
[root@... signals]# stap -vvvv ./killtrace.stp
SystemTap translator/driver (version 0.6.2/0.127 built 2008-03-27)
Copyright (C) 2005-2008 Red Hat, Inc. and others
This is free software; see the source for copying conditions.
Created temporary directory "/tmp/stapdnhska"
Searched '/usr/share/systemtap/tapset/x86_64/*.stp', found 1
Searched '/usr/share/systemtap/tapset/*.stp', found 37
Pass 1: parsed user script and 38 library script(s) in 290usr/10sys/307real ms.
control symbols: kts: 0xffffffff81257a00 kte: 0xffffffff8125ac27 stext: 0xffffffff81009000
parsed 'sys_kill' -> func 'sys_kill'
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.*|.*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)$
pattern 'kernel' matches module 'kernel'
focused on module 'kernel = [0xffffffff81000000-0xffffffff81514720, bias 0x0] file /usr/lib/debug/lib/modules/2.6.23.17-88.fc7/vmlinux ELF machine x86_64 (code 62)
pattern 'sys_kill' matches function 'sys_kill'
selected function sys_kill
probe sys_kill@kernel/signal.c:2073 kernel section=.text pc=0xffffffff8104065f
finding location for local 'sig' near address ffffffff8104065f, module bias 0
finding location for local 'pid' near address ffffffff8104065f, module bias 0
control symbols: kts: 0xffffffff81257a00 kte: 0xffffffff8125ac27 stext: 0xffffffff81009000
parsed 'kill_something_info' -> func 'kill_something_info'
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.*|.*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)$
pattern 'kernel' matches module 'kernel'
focused on module 'kernel = [0xffffffff81000000-0xffffffff81514720, bias 0x0] file /usr/lib/debug/lib/modules/2.6.23.17-88.fc7/vmlinux ELF machine x86_64 (code 62)
pattern 'kill_something_info' matches function 'kill_something_info'
checking instances of inline kill_something_info
examining inline instance of kill_something_info
selected inline instance of kill_something_info
entry-pc lookup (dwarf_ranges, ignored 2 more) = 0xffffffff81040691 (rc 0)
querying entrypc ffffffff81040691 of instance of inline 'kill_something_info'
probe kill_something_info@kernel/signal.c:1146 kernel section=.text pc=0xffffffff81040691
finding location for local 'info' near address ffffffff81040691, module bias 0
finding location for local 'info' near address ffffffff81040691, module bias 0
dwarf_builder releasing dwflpp
Eliding unused function print_regs
...
<snip>
...
Eliding unused function stp_print_binary
semantic error: failed to retrieve location attribute for local 'info' (dieoffset: 0x334d03): identifier '$info' at ./killtrace.stp:10:32
semantic error: failed to retrieve location attribute for local 'info' (dieoffset: 0x334d03): identifier '$info' at ./killtrace.stp:11:32
Pass 2: analyzed script: 3 probe(s), 4 function(s), 0 embed(s), 0 global(s) in 580usr/150sys/732real ms.

Seems this function is implicitly inlined. To access parameters of inline functions is still pending problem for systemtap/gcc. But you can try marker to get the inline function parameter information.

For your case, I found kill_something_info is just called in sys_kill
and always info.si_signo = sig; info.si_errno = 0 in kill_something_info
entry. So no necessary to do another probe. just sys_kill is enough.

BTW: probe kernel.function("sys_kill").return could be the reference to
the result of signal dispatch.

Regards,
Wenji






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