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 using task_state()


system: centos5.3, x86_64, (running inside vmware fusion) updated
using yum with the latest packages.
kernel version:
Linux localhost.localdomain 2.6.18-128.4.1.el5 #1 SMP Tue Aug 4
20:19:25 EDT 2009 x86_64 x86_64 x86_64 GNU/Linux
kernel-debug versions:
kernel-debuginfo-2.6.18-128.4.1.el5
kernel-debug-devel-2.6.18-128.4.1.el5
kernel-debuginfo-common-2.6.18-128.4.1.el5
(please mind the debuginfo-2.6.18-128.4.1 packages do not exist for
centos yet, so I've pulled them from a redhat repo)

in order to get information about the execution of a process, I've
made a little systemtap program:

probe begin{
? ? ? ?printf("Start of profile of pid: %d\n", target() )
}
probe timer.profile {
? ? ? ?printf("pid: %d , state: %d ", target(), task_state(target()) )
}

it gives the following error:
[root@localhost ~]# stap -vvv -x 5259 proc.stp
SystemTap translator/driver (version 0.7.2/0.137 non-git sources)
Copyright (C) 2005-2008 Red Hat, Inc. and others
This is free software; see the source for copying conditions.
Session arch: x86_64 release: 2.6.18-128.4.1.el5
Created temporary directory "/tmp/stapnIm06M"
Searched '/usr/share/systemtap/tapset/x86_64/*.stp', found 2
Searched '/usr/share/systemtap/tapset/*.stp', found 43
Pass 1: parsed user script and 45 library script(s) in 160usr/40sys/212real ms.
Eliding unused function backtrace
Eliding unused function caller
Eliding unused function caller_addr
Eliding unused function cpu
Eliding unused function cpuid
Eliding unused function egid
Eliding unused function euid
Eliding unused function execname
Eliding unused function gid
Eliding unused function is_return
Eliding unused function module_name
Eliding unused function pexecname
Eliding unused function pid
Eliding unused function pp
Eliding unused function ppid
Eliding unused function print_backtrace
Eliding unused function print_regs
Eliding unused function print_stack
Eliding unused function probefunc
Eliding unused function probemod
Eliding unused function registers_valid
Eliding unused function stack_size
Eliding unused function stack_unused
Eliding unused function stack_used
Eliding unused function stp_pid
Eliding unused function task_cpu
Eliding unused function task_current
Eliding unused function task_egid
Eliding unused function task_euid
Eliding unused function task_execname
Eliding unused function task_gid
Eliding unused function task_max_file_handles
Eliding unused function task_nice
Eliding unused function task_open_file_handles
Eliding unused function task_parent
Eliding unused function task_pid
Eliding unused function task_prio
Eliding unused function task_tid
Eliding unused function task_uid
Eliding unused function tid
Eliding unused function uid
Eliding unused function user_mode
Eliding side-effect-free singleton block operator '{' at proc.stp:1:12
Eliding side-effect-free singleton block operator '{' at proc.stp:4:21
Pass 2: analyzed script: 2 probe(s), 2 function(s), 1 embed(s), 0
global(s) in 10usr/0sys/12real ms.
probe_1402 locks nothing
Pass 3: translated to C into
"/tmp/stapnIm06M/stap_b54f1e997b11400f05adf0ee18f0a1f2_736.c" in
30usr/290sys/320real ms.
Running make -C "/lib/modules/2.6.18-128.4.1.el5/build"
M="/tmp/stapnIm06M" modules V=1
make: Entering directory `/usr/src/kernels/2.6.18-128.4.1.el5-x86_64'
test -e include/linux/autoconf.h -a -e include/config/auto.conf || ( ? ? ? ? ? \
? ? ? ?echo; ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? \
? ? ? ?echo " ?ERROR: Kernel configuration is invalid."; ? ? ? ? ? ? ? \
? ? ? ?echo " ? ? ? ? include/linux/autoconf.h or
include/config/auto.conf are missing."; ? ? ?\
? ? ? ?echo " ? ? ? ? Run 'make oldconfig && make prepare' on kernel
src to fix it."; ?\
? ? ? ?echo; ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? \
? ? ? ?/bin/false)
mkdir -p /tmp/stapnIm06M/.tmp_versions
rm -f /tmp/stapnIm06M/.tmp_versions/*
make -f scripts/Makefile.build obj=/tmp/stapnIm06M
?gcc -Wp,-MD,/tmp/stapnIm06M/.stap_b54f1e997b11400f05adf0ee18f0a1f2_736.o.d
?-nostdinc -isystem /usr/lib/gcc/x86_64-redhat-linux/4.1.2/include
-D__KERNEL__ -Iinclude ?-include include/linux/autoconf.h ?-Wall
-Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing
-fno-common -Wstrict-prototypes -Wundef
-Werror-implicit-function-declaration -fwrapv -Os ?-mtune=generic -m64
-mno-red-zone -mcmodel=kernel -pipe -fno-reorder-blocks
-Wno-sign-compare -fno-asynchronous-unwind-tables -funit-at-a-time
-mno-sse -mno-mmx -mno-sse2 -mno-3dnow -fomit-frame-pointer -g
-fno-stack-protector -Wdeclaration-after-statement -Wno-pointer-sign
-Iinclude2/asm/mach-default ?-DSTAPCONF_HRTIMER_REL
-DSTAPCONF_INODE_PRIVATE ?-DSTAPCONF_CONSTANT_TSC
-DSTAPCONF_KTIME_GET_REAL ? ?-DSTAPCONF_UNREGISTER_KPROBES
-DSTAPCONF_LINUX_UACCESS_H ?-DSTAPCONF_ONEACHCPU_RETRY
-freorder-blocks -Wno-unused -Werror -I"/usr/share/systemtap/runtime"
-DMODULE -D"KBUILD_STR(s)=#s"
-D"KBUILD_BASENAME=KBUILD_STR(stap_b54f1e997b11400f05adf0ee18f0a1f2_736)"
?-D"KBUILD_MODNAME=KBUILD_STR(stap_b54f1e997b11400f05adf0ee18f0a1f2_736)"
-c -o /tmp/stapnIm06M/.tmp_stap_b54f1e997b11400f05adf0ee18f0a1f2_736.o
/tmp/stapnIm06M/stap_b54f1e997b11400f05adf0ee18f0a1f2_736.c
?Building modules, stage 2.
make -rR -f /usr/src/kernels/2.6.18-128.4.1.el5-x86_64/scripts/Makefile.modpost
?scripts/mod/modpost -m -a -i
/usr/src/kernels/2.6.18-128.4.1.el5-x86_64/Module.symvers -I
/tmp/stapnIm06M/Module.symvers -o /tmp/stapnIm06M/Module.symvers -K
/usr/src/kernels/2.6.18-128.4.1.el5-x86_64/Module.markers -M
/tmp/stapnIm06M/Module.markers
/tmp/stapnIm06M/stap_b54f1e997b11400f05adf0ee18f0a1f2_736.o
?gcc -Wp,-MD,/tmp/stapnIm06M/.stap_b54f1e997b11400f05adf0ee18f0a1f2_736.mod.o.d
?-nostdinc -isystem /usr/lib/gcc/x86_64-redhat-linux/4.1.2/include
-D__KERNEL__ -Iinclude ?-include include/linux/autoconf.h ?-Wall
-Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing
-fno-common -Wstrict-prototypes -Wundef
-Werror-implicit-function-declaration -fwrapv -Os ?-mtune=generic -m64
-mno-red-zone -mcmodel=kernel -pipe -fno-reorder-blocks
-Wno-sign-compare -fno-asynchronous-unwind-tables -funit-at-a-time
-mno-sse -mno-mmx -mno-sse2 -mno-3dnow -fomit-frame-pointer -g
-fno-stack-protector -Wdeclaration-after-statement -Wno-pointer-sign
?-D"KBUILD_STR(s)=#s"
-D"KBUILD_BASENAME=KBUILD_STR(stap_b54f1e997b11400f05adf0ee18f0a1f2_736.mod)"
?-D"KBUILD_MODNAME=KBUILD_STR(stap_b54f1e997b11400f05adf0ee18f0a1f2_736)"
-DMODULE -c -o /tmp/stapnIm06M/stap_b54f1e997b11400f05adf0ee18f0a1f2_736.mod.o
/tmp/stapnIm06M/stap_b54f1e997b11400f05adf0ee18f0a1f2_736.mod.c
?ld -m elf_x86_64 -r -o
/tmp/stapnIm06M/stap_b54f1e997b11400f05adf0ee18f0a1f2_736.ko
/tmp/stapnIm06M/stap_b54f1e997b11400f05adf0ee18f0a1f2_736.o
/tmp/stapnIm06M/stap_b54f1e997b11400f05adf0ee18f0a1f2_736.mod.o
make: Leaving directory `/usr/src/kernels/2.6.18-128.4.1.el5-x86_64'
Pass 4: compiled C into "stap_b54f1e997b11400f05adf0ee18f0a1f2_736.ko"
in 1490usr/790sys/2357real ms.
Copying /tmp/stapnIm06M/stap_b54f1e997b11400f05adf0ee18f0a1f2_736.ko
to /root/.systemtap/cache/b5/stap_b54f1e997b11400f05adf0ee18f0a1f2_736.ko
Copying /tmp/stapnIm06M/stap_b54f1e997b11400f05adf0ee18f0a1f2_736.c to
/root/.systemtap/cache/b5/stap_b54f1e997b11400f05adf0ee18f0a1f2_736.c
Pass 5: starting run.
Running /usr/bin/staprun -v -v -t 5259
/tmp/stapnIm06M/stap_b54f1e997b11400f05adf0ee18f0a1f2_736.ko
staprun:main:249
modpath="/tmp/stapnIm06M/stap_b54f1e997b11400f05adf0ee18f0a1f2_736.ko",
modname="stap_b54f1e997b11400f05adf0ee18f0a1f2_736"
staprun:init_staprun:207 init_staprun
staprun:insert_module:47 inserting module
staprun:insert_module:66 module options: _stp_bufsize=0
staprun:init_ctl_channel:30 Opening
/sys/kernel/debug/systemtap/stap_b54f1e997b11400f05adf0ee18f0a1f2_736/.cmd
execing: /usr/libexec/systemtap/stapio -v -v -t 5259
/tmp/stapnIm06M/stap_b54f1e997b11400f05adf0ee18f0a1f2_736.ko
stapio:main:37 modpath="/tmp/stapnIm06M/stap_b54f1e997b11400f05adf0ee18f0a1f2_736.ko",
modname="stap_b54f1e997b11400f05adf0ee18f0a1f2_736"
stapio:init_stapio:250 init_stapio
stapio:init_ctl_channel:30 Opening
/sys/kernel/debug/systemtap/stap_b54f1e997b11400f05adf0ee18f0a1f2_736/.cmd
stapio:stp_main_loop:339 in main loop
stapio:stp_main_loop:346 nb=4
stapio:init_relayfs:124 initializing relayfs
stapio:init_relayfs:148 attempting to open
/sys/kernel/debug/systemtap/stap_b54f1e997b11400f05adf0ee18f0a1f2_736/trace0
stapio:init_relayfs:148 attempting to open
/sys/kernel/debug/systemtap/stap_b54f1e997b11400f05adf0ee18f0a1f2_736/trace1
stapio:init_relayfs:154 ncpus=1, bulkmode = 0
stapio:init_relayfs:204 starting threads
stapio:stp_main_loop:346 nb=12
stapio:stp_main_loop:386 probe_start() returned 0
stapio:stp_main_loop:346 nb=143
ERROR: kernel read fault at 0x000000000000148b ((&(t->state))) near
identifier 'task_state' at /usr/share/systemtap/tapset/task.stp:43:10
stapio:stp_main_loop:346 nb=53
WARNING: Number of errors: 1, skipped probes: 0
stapio:stp_main_loop:346 nb=4
stapio:stp_main_loop:379 got STP_EXIT
stapio:cleanup_and_exit:297 detach=0
stapio:close_relayfs:221 closing
Start of profile of pid: 5259
stapio:close_relayfs:240 done
stapio:cleanup_and_exit:310 closing control channel
stapio:cleanup_and_exit:316 removing stap_b54f1e997b11400f05adf0ee18f0a1f2_736
Pass 5: run completed in 10usr/50sys/74real ms.
Running rm -rf /tmp/stapnIm06M

as far as me concerned, the error is:
ERROR: kernel read fault at 0x000000000000148b ((&(t->state))) near
identifier 'task_state' at /usr/share/systemtap/tapset/task.stp:43:10
this is a stp file which did come from the repository, row 43 is:
? ? 40 // ? TASK_TRACED ? ? ? ? ? ?8
? ? 41 // ? EXIT_ZOMBIE ? ? ? ? ? 16
? ? 42 // ? EXIT_DEAD ? ? ? ? ? ? 32
? ? 43 function task_state:long (task:long) %{ /* pure */
? ? 44 ? ? struct task_struct *t = (struct task_struct *)(long)THIS->task;
? ? 45 ? ? THIS->__retvalue = kread(&(t->state));
? ? 46 ? ? CATCH_DEREF_FAULT();
? ? 47 %}

am I doing something wrong? anybody else got a working program which
is able to tell me the times a process has been running, queued and
stopped?

regards

frits hoogland


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