summaryrefslogtreecommitdiffstats
path: root/testsuite
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite')
-rwxr-xr-xtestsuite/buildok/stat_extract.stp27
-rwxr-xr-xtestsuite/buildok/stat_insert.stp62
-rwxr-xr-xtestsuite/semko/thirty.stp3
-rwxr-xr-xtestsuite/semko/thirtyone.stp3
-rwxr-xr-xtestsuite/semko/twentyeight.stp2
-rwxr-xr-xtestsuite/semko/twentyfive.stp2
-rwxr-xr-xtestsuite/semko/twentyfour.stp2
-rwxr-xr-xtestsuite/semko/twentynine.stp2
-rwxr-xr-xtestsuite/semko/twentyseven.stp2
-rwxr-xr-xtestsuite/semko/twentysix.stp3
10 files changed, 100 insertions, 8 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))
+}
diff --git a/testsuite/buildok/stat_insert.stp b/testsuite/buildok/stat_insert.stp
new file mode 100755
index 00000000..4039a190
--- /dev/null
+++ b/testsuite/buildok/stat_insert.stp
@@ -0,0 +1,62 @@
+#! stap -p4
+
+# test the translatability of the statistic insertion operator
+
+global loggy
+global logmap
+global liney
+global linemap
+
+global numbers
+global strings
+
+function wibble()
+{
+ i = 0
+ logmap[i++, "stewed"] <<< 1
+ logmap[i++, "boiled"] <<< 1 + 2
+ logmap[i++, "baked"] <<< x
+ logmap[i++, "fried"] <<< (x * y) + 3
+}
+
+function wobble()
+{
+ foreach (i in numbers)
+ {
+ foreach (j in strings)
+ {
+ linemap[strings[j],2*numbers[i],numbers[2*i]] <<< x * (y + i)
+ }
+ }
+}
+
+
+probe end {
+
+ numbers[1] = 2
+ numbers[2] = 5
+ numbers[3] = 98279
+ numbers[4] = 8739287
+
+ strings[1] = "sun"
+ strings[2] = "moon"
+ strings[3] = "saturn"
+ strings[4] = "venus"
+
+ p = 4
+ q = 5
+
+ liney <<< 1
+ liney <<< 1 + 2
+ liney <<< p
+ liney <<< (p * q) + 3
+
+ loggy <<< 1
+ loggy <<< 1 + 2
+ loggy <<< p
+ loggy <<< (p * q) + 3
+
+ wibble()
+ wobble()
+
+}
diff --git a/testsuite/semko/thirty.stp b/testsuite/semko/thirty.stp
index b8f0ab4b..b145f826 100755
--- a/testsuite/semko/thirty.stp
+++ b/testsuite/semko/thirty.stp
@@ -2,10 +2,11 @@
# need one of these for each prohibited statistic operation
-global log_hist(x, 10)
+global x
probe end
{
+ x <<< 1
x = 10
}
diff --git a/testsuite/semko/thirtyone.stp b/testsuite/semko/thirtyone.stp
index 4b6e98d5..0462d4d5 100755
--- a/testsuite/semko/thirtyone.stp
+++ b/testsuite/semko/thirtyone.stp
@@ -2,10 +2,11 @@
# need one of these for each prohibited statistic operation
-global log_hist(x, 10)
+global x
probe end
{
+ x[10] <<< 1
x[10] = 10
}
diff --git a/testsuite/semko/twentyeight.stp b/testsuite/semko/twentyeight.stp
index 68590f86..ea214596 100755
--- a/testsuite/semko/twentyeight.stp
+++ b/testsuite/semko/twentyeight.stp
@@ -2,7 +2,7 @@
# need one of these for each prohibited statistic operation
-global log_hist(x, 10)
+global x
probe end
{
diff --git a/testsuite/semko/twentyfive.stp b/testsuite/semko/twentyfive.stp
index 7ac7e099..8758bb67 100755
--- a/testsuite/semko/twentyfive.stp
+++ b/testsuite/semko/twentyfive.stp
@@ -2,7 +2,7 @@
# need one of these for each prohibited statistic operation
-global log_hist(x, 10), log_hist(y, 10)
+global x, y
probe end
diff --git a/testsuite/semko/twentyfour.stp b/testsuite/semko/twentyfour.stp
index 81a69902..ae75bf31 100755
--- a/testsuite/semko/twentyfour.stp
+++ b/testsuite/semko/twentyfour.stp
@@ -2,7 +2,7 @@
# need one of these for each prohibited statistic operation
-global log_hist(x, 10), log_hist(y, 10)
+global x, y
probe end
diff --git a/testsuite/semko/twentynine.stp b/testsuite/semko/twentynine.stp
index 8cc2e2d5..b26e9872 100755
--- a/testsuite/semko/twentynine.stp
+++ b/testsuite/semko/twentynine.stp
@@ -2,7 +2,7 @@
# need one of these for each prohibited statistic operation
-global log_hist(x, 10)
+global x
probe end
{
diff --git a/testsuite/semko/twentyseven.stp b/testsuite/semko/twentyseven.stp
index a678bcd2..6c5bd4f9 100755
--- a/testsuite/semko/twentyseven.stp
+++ b/testsuite/semko/twentyseven.stp
@@ -2,7 +2,7 @@
# need one of these for each prohibited statistic operation
-global log_hist(x, 10)
+global x
function foo(bar)
{
diff --git a/testsuite/semko/twentysix.stp b/testsuite/semko/twentysix.stp
index 34d6d1d3..9ebffa4a 100755
--- a/testsuite/semko/twentysix.stp
+++ b/testsuite/semko/twentysix.stp
@@ -2,11 +2,12 @@
# need one of these for each prohibited statistic operation
-global log_hist(x, 10)
+global x
probe end
{
+ x[10] <<< 1
x[10] = 10
}