From 6612059a9f1b7414b1d5046795b2dea0ca4e791a Mon Sep 17 00:00:00 2001 From: xion Date: Thu, 23 Jun 2016 09:08:00 +0800 Subject: [PATCH] add an io count tracer Change-Id: I9ad826eca3ea97505a660e8d226780de7c7ecbc7 --- scripts/io-count.stp | 23 +++++++++++++++++++++++ tests/ci/scalpels-ci.sh | 2 +- tools/init_scalpels.sh | 1 + 3 files changed, 25 insertions(+), 1 deletion(-) create mode 100755 scripts/io-count.stp diff --git a/scripts/io-count.stp b/scripts/io-count.stp new file mode 100755 index 0000000..c178100 --- /dev/null +++ b/scripts/io-count.stp @@ -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; + +} + diff --git a/tests/ci/scalpels-ci.sh b/tests/ci/scalpels-ci.sh index 622b1d8..b61c186 100755 --- a/tests/ci/scalpels-ci.sh +++ b/tests/ci/scalpels-ci.sh @@ -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 diff --git a/tools/init_scalpels.sh b/tools/init_scalpels.sh index ccc0ec0..c38499e 100755 --- a/tools/init_scalpels.sh +++ b/tools/init_scalpels.sh @@ -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