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]

kernel read fault when accessing context variables


systemtap version 0.0.20090613-1
Ubuntu 9.10 x86_64 kernel 2.6.31-22-generic
debug kernel installed using 2.6.31-22 according to the instructions here:
http://sourceware.org/systemtap/wiki/SystemtapOnUbuntu

I'm trying to access the prev/next task structs within the scheduler e.g.

probe kernel.statement("schedule@kernel/sched.c:line#") {
    ppid = $prev->tgid
    npid = $npid->tgid

    printf("ppid:%d, npid:%d\n", ppid, npid)
}

I am able access $npid->tgid just fine and it prints the correct npid,
however whenever I try to access $prev->tgid the entire probe is skipped and
I get a kernel read fault:

SystemTap translator/driver (version 0.9.8/0.141 non-git sources)
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.31-22-generic
Created temporary directory "/tmp/stapmQJ4zq"
Searched '/usr/share/systemtap/tapset/x86_64/*.stp', found 3
Searched '/usr/share/systemtap/tapset/*.stp', found 51
Pass 1: parsed user script and 54 library script(s) in 350usr/50sys/443real
ms.
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)$
parsed 'schedule@kernel/sched.c:5364' -> func 'schedule', file
'kernel/sched.c', line 0x7fff7a68e9d4
focused on module 'kernel = [0xffffffff81000000-0xffffffff81a0c000, bias
0x0] file /usr/lib/debug/boot/vmlinux-2.6.31-22-generic ELF machine |x86_64
(code 62)
focused on module 'kernel'
selected source file '/build/buildd/linux-2.6.31/kernel/sched.c'
selected function schedule
probe schedule@/build/buildd/linux-2.6.31/kernel/sched.c:5365 kernel
reloc=.dynamic section=.text pc=0xffffffff8152bc4e
finding location for local 'prev' near address 0xffffffff8152bc4e, module
bias 0x0
Pass 2: analyzed script: 1 probe(s), 1 function(s), 0 embed(s), 0 global(s)
in 620usr/390sys/1030real ms.
Pass 3: using cached
/home/tony/.systemtap/cache/37/stapconf_372e45b50185996104fc41217631e5f5_364.h
Pass 3: using cached
/home/tony/.systemtap/cache/f4/stap_f43d8fd5008d00d09fc93292d18a3a6d_1120.c
Pass 4: using cached
/home/tony/.systemtap/cache/f4/stap_f43d8fd5008d00d09fc93292d18a3a6d_1120.ko
Pass 5: starting run.
Running /usr/bin/staprun -v -v -c '/usr/bin/gedit'
/tmp/stapmQJ4zq/stap_f43d8fd5008d00d09fc93292d18a3a6d_1120.ko
staprun:main:269
modpath="/tmp/stapmQJ4zq/stap_f43d8fd5008d00d09fc93292d18a3a6d_1120.ko",
modname="stap_f43d8fd5008d00d09fc93292d18a3a6d_1120"
staprun:check_signature:224 checking signature for
/tmp/stapmQJ4zq/stap_f43d8fd5008d00d09fc93292d18a3a6d_1120.ko
staprun:check_signature:241 verify_module returns 0
staprun:init_staprun:207 init_staprun
staprun:insert_module:53 inserting module
staprun:insert_module:72 module options: _stp_bufsize=0
staprun:init_ctl_channel:30 Opening
/sys/kernel/debug/systemtap/stap_f43d8fd5008d00d09fc93292d18a3a6d_1120/.cmd
execing: /usr/lib/systemtap/stapio -v -v -c /usr/bin/gedit
/tmp/stapmQJ4zq/stap_f43d8fd5008d00d09fc93292d18a3a6d_1120.ko 
stapio:main:37
modpath="/tmp/stapmQJ4zq/stap_f43d8fd5008d00d09fc93292d18a3a6d_1120.ko",
modname="stap_f43d8fd5008d00d09fc93292d18a3a6d_1120"
stapio:init_stapio:290 init_stapio
stapio:init_ctl_channel:30 Opening
/sys/kernel/debug/systemtap/stap_f43d8fd5008d00d09fc93292d18a3a6d_1120/.cmd
stapio:stp_main_loop:471 in main loop
stapio:stp_main_loop:478 nb=4
stapio:init_relayfs:234 initializing relayfs
stapio:init_relayfs:258 attempting to open
/sys/kernel/debug/systemtap/stap_f43d8fd5008d00d09fc93292d18a3a6d_1120/trace0
stapio:init_relayfs:258 attempting to open
/sys/kernel/debug/systemtap/stap_f43d8fd5008d00d09fc93292d18a3a6d_1120/trace1
stapio:init_relayfs:264 ncpus=1, bulkmode = 0
stapio:init_relayfs:335 starting threads
stapio:stp_main_loop:478 nb=12
stapio:stp_main_loop:519 probe_start() returned 0
stapio:stp_main_loop:525 detaching pid 22717
stapio:stp_main_loop:478 nb=99
ERROR: kernel read fault at 0x000000000000029d (addr) near identifier
'$prev' at test.stp:2:9
stapio:stp_main_loop:478 nb=4
stapio:stp_main_loop:511 got STP_REQUEST_EXIT
stapio:chld_proc:54 chld_proc 17 (Child exited)
stapio:stp_main_loop:478 nb=53
WARNING: Number of errors: 1, skipped probes: 1
stapio:stp_main_loop:478 nb=4
stapio:stp_main_loop:504 got STP_EXIT
stapio:cleanup_and_exit:371 detach=0
stapio:close_relayfs:352 closing
stapio:close_relayfs:371 done
stapio:cleanup_and_exit:388 closing control channel
stapio:cleanup_and_exit:413 removing
stap_f43d8fd5008d00d09fc93292d18a3a6d_1120
Pass 5: run completed in 10usr/50sys/231real ms.
Running rm -rf /tmp/stapmQJ4zq
tony@tonys-laptop:~/Desktop$ stap -V
SystemTap translator/driver (version 0.9.8/0.141 non-git sources)
Copyright (C) 2005-2009 Red Hat, Inc. and others
This is free software; see the source for copying conditions.

I've tried building my own kernel, I've tried version 2.6.28, this error
seems to persist no matter what I try. I've even tried systemtap 1.2 same
problem.
-- 
View this message in context: http://old.nabble.com/kernel-read-fault-when-accessing-context-variables-tp29099754p29099754.html
Sent from the Sourceware - systemtap mailing list archive at Nabble.com.


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