add an io count tracer

Change-Id: I9ad826eca3ea97505a660e8d226780de7c7ecbc7
This commit is contained in:
xion 2016-06-23 09:08:00 +08:00
parent 1fb41db448
commit 6612059a9f
3 changed files with 25 additions and 1 deletions

23
scripts/io-count.stp Executable file
View 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;
}

View File

@ -13,7 +13,7 @@ function debug_msg {
function basic_test {
sca tracer -l
sca start -a rpc -a rabbit -a traffic
sca start -a rpc -a rabbit -a traffic -a iocount
sca load --storm
sleep 10

View File

@ -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=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=iocount -t tpl="stap %(tracer_path)s/io-count.stp"
sca tracer -l