#
global running, intervals
+global cache_misses, cache_hits, neg_cache_hits
probe begin {
printf("Collecting data, press ctrl-C to stop... ")
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") {
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,