add an io count tracer
Change-Id: I9ad826eca3ea97505a660e8d226780de7c7ecbc7
This commit is contained in:
parent
1fb41db448
commit
6612059a9f
23
scripts/io-count.stp
Executable file
23
scripts/io-count.stp
Executable file
@ -0,0 +1,23 @@
|
|||||||
|
#!/usr/bin/env stap
|
||||||
|
# alias_suffixes.stp
|
||||||
|
# Uses alias suffixes to track time intervals for a subset of kernel
|
||||||
|
# functions. Based on func_time_stats.stp.
|
||||||
|
|
||||||
|
global now_count =0;
|
||||||
|
global old_count = 0;
|
||||||
|
|
||||||
|
|
||||||
|
# We can apply a suffix to multiple probe points designated by one alias:
|
||||||
|
probe miscellany = syscall.{open,close,read,write} { }
|
||||||
|
|
||||||
|
probe miscellany {
|
||||||
|
now_count = now_count +1;
|
||||||
|
}
|
||||||
|
|
||||||
|
probe timer.ms(1000){
|
||||||
|
new_count = now_count - old_count;
|
||||||
|
printf("%d\n",new_count);
|
||||||
|
old_count = now_count;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -13,7 +13,7 @@ function debug_msg {
|
|||||||
|
|
||||||
function basic_test {
|
function basic_test {
|
||||||
sca tracer -l
|
sca tracer -l
|
||||||
sca start -a rpc -a rabbit -a traffic
|
sca start -a rpc -a rabbit -a traffic -a iocount
|
||||||
|
|
||||||
sca load --storm
|
sca load --storm
|
||||||
sleep 10
|
sleep 10
|
||||||
|
@ -10,4 +10,5 @@ sca-manage setup -t name=oslolock -t tpl="stap %(tracer_path)s/oslo-lock.stp"
|
|||||||
sca-manage setup -t name=modelsave -t tpl="stap %(tracer_path)s/model-save.stp"
|
sca-manage setup -t name=modelsave -t tpl="stap %(tracer_path)s/model-save.stp"
|
||||||
sca-manage setup -t name=sqlaexec -t tpl="stap %(tracer_path)s/sqla-exec.stp"
|
sca-manage setup -t name=sqlaexec -t tpl="stap %(tracer_path)s/sqla-exec.stp"
|
||||||
sca-manage setup -t name=rpccount -t tpl="stap %(tracer_path)s/rpc-count.stp"
|
sca-manage setup -t name=rpccount -t tpl="stap %(tracer_path)s/rpc-count.stp"
|
||||||
|
sca-manage setup -t name=iocount -t tpl="stap %(tracer_path)s/io-count.stp"
|
||||||
sca tracer -l
|
sca tracer -l
|
||||||
|
Loading…
Reference in New Issue
Block a user