This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
reimplementation of smp_call_function example from OLS
- From: William Cohen <wcohen at redhat dot com>
- To: SystemTAP <systemtap at sources dot redhat dot com>
- Date: Thu, 15 Sep 2005 16:02:34 -0400
- Subject: reimplementation of smp_call_function example from OLS
Playing around with the instrumentation I attempted to reimplement the
example given in the OLS 2005 presenation so that it works with the
current translator. The attached scf.stp appears to work. Below is the
output.
Things that strike me about this example:
1) Outputting data could be simpler
2) Sorting the data would be useful. I should take a look at Tom's
kmalloc-top example that he checked in for sorting.
3) It appears that some backtraces are truncated.
-Will
stap scf.stp
start of data collection
end of data collection
traces[2234,hald,
0xc0114d67 : smp_call_function+0x10/0xfa
0xc016a6af : invalidate_bh_lrus+0x1b/0x22
0xc01697ca : invalidate_bdev+0x8/0x17
0xc0180649 : __invalidate_device+0x30/0x36
0xc016fb46 : check_disk_change+0x2b/0x66
0xc0256908 : get_disk+0x1d/0x7d
0xc028511e : cdrom_open+0x62/0xdb
0xc024da4e : kobj_lookup+0x152/0x196
0xc0281f1b : idecd_open+0x45/0x8f
0xc016fc81 : do_open+0x8f/0x343
0xc016ffad : blkdev_open+0x1a/0x4a
0xc01672c2 : dentry_open+0xcf/0x1e9
0xc01671ed : filp_open+0x40/0x46
0xc015161f : cache_alloc_debugcheck_after+0x31/0x129
0xc
] = 105
traces[2234,hald,
0xc0114d67 : smp_call_function+0x10/0xfa
0xc016a6af : invalidate_bh_lrus+0x1b/0x22
0xc01697ca : invalidate_bdev+0x8/0x17
0xc016f2b5 : kill_bdev+0xd/0x20
0xc017012c : blkdev_put+0x14f/0x164
0xc0168ddd : __fput+0xb1/0x18f
0xc016764e : filp_close+0x3e/0x62
0xc01039d1 : syscall_call+0x7/0xb
] = 104
traces[2234,hald,
0xc0114d67 : smp_call_function+0x10/0xfa
0xc0104416 : common_interrupt+0x1a/0x20
0xc016a6af : invalidate_bh_lrus+0x1b/0x22
0xc01697ca : invalidate_bdev+0x8/0x17
0xc016f2b5 : kill_bdev+0xd/0x20
0xc017012c : blkdev_put+0x14f/0x164
0xc0168ddd : __fput+0xb1/0x18f
0xc016764e : filp_close+0x3e/0x62
0xc01039d1 : syscall_call+0x7/0xb
] = 1
# scf.stp
# A reimplementation of user script:smp_call_function example given at OLS 2005
# in the current language.
#
# Will Cohen
global traces
probe kernel.function("smp_call_function")
{
traces[pid(), pexecname(), backtrace()] += 1;
}
probe end {
log("end of data collection");
foreach( [pid, name, stack] in traces){
log( "traces[" . string(pid) . "," . name . "," );
print_stack(stack)
log( "] = " . string(traces[pid, name, stack]) );
}
}
probe begin { log("start of data collection"); }