This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
How to get the detailed kernel stack trace if specified fuction takes too long to finish?
- From: liang xie <xieliang007 at gmail dot com>
- To: systemtap at sourceware dot org
- Date: Fri, 28 Mar 2014 12:22:24 +0800
- Subject: How to get the detailed kernel stack trace if specified fuction takes too long to finish?
- Authentication-results: sourceware.org; auth=none
Hi all,
Probably it's a newbie question, to be honest, i am new to SystemTap,
currently i want to capture the kernel stack trace if "sys_write" runs
too long, if that i could know where it sucks.
My OS:2.6.32-220.el6.x86_64
# stap -V
Systemtap translator/driver (version 1.6/0.152 non-git sources)
My tried script:
global i=0
global tb=0
global te=0
probe kernel.function("sys_write") {
tb=gettimeofday_us();
}
probe kernel.function("sys_write").return {
te=gettimeofday_us();
if(te-tb > 100000) {
i++;
printf("time_us: %d\n", te-tb);
print_backtrace();
if(i > 15) {
exit();
}
}
}
# stap -x <pid> xxx.stp
time_us: 226795
Returning from: 0xffffffff81176f90 : sys_write+0x0/0x90 [kernel]
Returning to : 0xffffffff8100b0f2 : system_call_fastpath+0x16/0x1b [kernel]
time_us: 101400
Returning from: 0xffffffff81176f90 : sys_write+0x0/0x90 [kernel]
Returning to : 0xffffffff8100b0f2 : system_call_fastpath+0x16/0x1b [kernel]
time_us: 527853
Returning from: 0xffffffff81176f90 : sys_write+0x0/0x90 [kernel]
Returning to : 0xffffffff8100b0f2 : system_call_fastpath+0x16/0x1b [kernel]
time_us: 133948
Returning from: 0xffffffff81176f90 : sys_write+0x0/0x90 [kernel]
Returning to : 0xffffffff8100b0f2 : system_call_fastpath+0x16/0x1b [kernel]
It doesn't show my "expected" kernel stack trace,e.g. file system or
block layer related stack trace. How to archive that? Any pointers
will be highly appreciated!
Best,
Liang