Bug 5167 - port/include blktap scripts
Summary: port/include blktap scripts
Status: RESOLVED WONTFIX
Alias: None
Product: systemtap
Classification: Unclassified
Component: tapsets (show other bugs)
Version: unspecified
: P2 normal
Target Milestone: ---
Assignee: Unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-10-11 20:53 UTC by Frank Ch. Eigler
Modified: 2012-03-14 20:25 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Frank Ch. Eigler 2007-10-11 20:53:26 UTC
Tom Zanussi's blktap* scripts should get included in our samples
and/or wiki.  While it relies on the blktrace system being turned
on via its own userspace, the forthcoming marker-based blktrace should
be workable without that.

http://www.sourceware.org/ml/systemtap/2007-q1/msg00485.html
Comment 1 William Cohen 2012-03-14 14:41:30 UTC
The blktap code has five example scripts:

countall.stp - display counts of all blktrace events
spectest.stp - test 'speculative tracing' support
iotop.stp - periodically display top I/O producers
topfile.stp - display read/write I/O accumulated by file
traceread.stp - trace read I/O for all or selected file

Each example needs blktrace running to trigger the data collection
because the tapset probes kernel.function("_blk_add_trace").  There
are some additional probes in the kernel for kernel.function
("__set_page_dirty_nobuffers").

Didn't get any counts for the countall.stp or the other example
scripts. The bundling of the default handler functions in in the
tapsets/blktrace.stp blocks the real ones in countall.stp script from
being used.

I was able to veryify that __blk_add_trace was operating with the
following script:

$ stap  -I tapsets -e 'global c probe kernel.function("__blk_add_trace") { c[$what]++ } probe end {foreach (w+ in c) printf("c[0x%x] = %d\n", w, c[w]) }'
c[0x100001] = 2235
c[0x100002] = 2071
c[0x100004] = 164
c[0x100009] = 21
c[0x10000f] = 4470
c[0x110000c] = 164
c[0x1400007] = 162
c[0x1800008] = 162

partical list of things to fix:
       -break out the default handler functions into separate files
       -probe the tracepoint locations rather than __blk_add_trace
       	      (reduce overhead and eliminate need for blktrace to run)
       -address the deref() and access to data structure issues
       -make spectest.stp use the existing speculative.stp
Comment 2 Frank Ch. Eigler 2012-03-14 20:25:50 UTC
I'd rather investigate the more modern ioblame facilities.