summaryrefslogtreecommitdiffstats
path: root/testsuite/buildok/stat_extract.stp
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/buildok/stat_extract.stp')
-rwxr-xr-xtestsuite/buildok/stat_extract.stp27
1 files changed, 27 insertions, 0 deletions
diff --git a/testsuite/buildok/stat_extract.stp b/testsuite/buildok/stat_extract.stp
new file mode 100755
index 00000000..82b37545
--- /dev/null
+++ b/testsuite/buildok/stat_extract.stp
@@ -0,0 +1,27 @@
+#! stap -p4
+
+# test the translatability of the statistic extraction operators
+
+global foo
+global bar
+
+global i
+
+probe timer.ms(100)
+{
+ foo <<< i++
+ bar[10,"hello"] <<< (12 * i)
+ if (@count(foo) > 1000)
+ exit()
+}
+
+probe begin
+{
+ i = 1
+}
+
+probe end
+{
+ printf("foo: min %d, max %d, count %d, sum %d, avg %d\n",
+ @min(foo), @max(foo), @count(foo), @sum(foo), @avg(foo))
+}