summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRalph Boehme <slow@samba.org>2017-07-26 14:29:33 +0200
committerRalph Boehme <slow@samba.org>2017-08-11 14:19:24 +0200
commitb2f2ce0acc305f6ec99edf948c5994d7180c08a6 (patch)
tree42751ecff10068361701f9872ac7bf7abdd02c01
parent62925cfa6e796c546f9450846bb9e110f29139c0 (diff)
downloadsamba-b2f2ce0acc305f6ec99edf948c5994d7180c08a6.tar.gz
examples: add cache effectiveness stats to gencache.stp
Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Autobuild-User(master): Ralph Böhme <slow@samba.org> Autobuild-Date(master): Fri Aug 11 14:19:24 CEST 2017 on sn-devel-144
-rwxr-xr-xexamples/systemtap/gencache.stp23
1 files changed, 23 insertions, 0 deletions
diff --git a/examples/systemtap/gencache.stp b/examples/systemtap/gencache.stp
index 225f0aefd71..95fcff34acc 100755
--- a/examples/systemtap/gencache.stp
+++ b/examples/systemtap/gencache.stp
@@ -18,6 +18,7 @@
#
global running, intervals
+global cache_misses, cache_hits, neg_cache_hits
probe begin {
printf("Collecting data, press ctrl-C to stop... ")
@@ -37,6 +38,18 @@ probe process(@1).library("*").function("gencache_parse").return {
duration = end - begin
intervals["gencache_parse"] <<< duration
+
+ if ($return == 0) {
+ cache_misses++
+ } else {
+ cache_hits++
+ }
+}
+
+probe process(@1).library("*").function("gencache_get_data_blob_parser") {
+ if ($timeout == 0) {
+ neg_cache_hits++
+ }
}
probe process(@1).library("*").function("gencache_get_data_blob") {
@@ -106,6 +119,16 @@ probe process(@1).library("*").function("gencache_stabilize").return {
probe end {
printf("\n\n")
+ printf("Summary of cache access stats\n")
+ printf("=============================\n\n")
+ printf("%-10s %-10s %-10s\n",
+ "Hits", "Misses", "Negative-Hits");
+ printf("--------------------------------------\n")
+ printf("%-10d %-10d %-10d\n",
+ cache_hits, cache_misses, neg_cache_hits);
+
+ printf("\n")
+
foreach ([name] in intervals) {
printf("%-30s count: %d sum: %d us (min: %d us avg: %d us max: %d us)\n",
name,