diff --git a/scalpels/agents/base.py b/scalpels/agents/base.py index 376db14..0cb4d75 100644 --- a/scalpels/agents/base.py +++ b/scalpels/agents/base.py @@ -91,3 +91,6 @@ def parse_modelsave(out): def parse_sqlaexec(out): return _parse_count_stream(out, "Sqlalchemy-Execute") + +def parse_rpccount(out): + return _parse_count_stream(out, "RPC-Count") diff --git a/scalpels/cli/actions/start.py b/scalpels/cli/actions/start.py index cfe1641..bd04fd8 100644 --- a/scalpels/cli/actions/start.py +++ b/scalpels/cli/actions/start.py @@ -43,6 +43,7 @@ agents_map = { "oslolock": "stap %s/oslo-lock.stp", # with sudo, need add current user to stapdev group "modelsave": "stap %s/model-save.stp", # with sudo, need add current user to stapdev group "sqlaexec": "stap %s/sqla-exec.stp", # with sudo, need add current user to stapdev group + "rpccount": "stap %s/rpc-count.stp", # with sudo, need add current user to stapdev group } def run(config): diff --git a/scripts/rpc-count.stp b/scripts/rpc-count.stp new file mode 100755 index 0000000..5c475b2 --- /dev/null +++ b/scripts/rpc-count.stp @@ -0,0 +1,14 @@ +#!/usr/bin/stap + +global count = 0; +global old_count = 0; +probe python.function.entry { + if ((funcname == "call" || funcname == "cast") && isinstr(filename, "oslo_messaging/rpc/client.py") ) { + count = count + 1; + } +} +probe timer.ms(1000) { + new_count = count - old_count; + printf("%d\n", new_count); + old_count = count; +}