summaryrefslogtreecommitdiffstats
path: root/stapex.5.in
diff options
context:
space:
mode:
authorfche <fche>2007-03-04 19:38:20 +0000
committerfche <fche>2007-03-04 19:38:20 +0000
commit5b3452c9ed1738f019b73bf6ffd3440084567325 (patch)
tree5f5e4285307b6dcd844e08c91657b74392d89c4a /stapex.5.in
parent003c1a9c48f4b8de6c9f975be7ecc4ec35bd132a (diff)
downloadsystemtap-steved-5b3452c9ed1738f019b73bf6ffd3440084567325.tar.gz
systemtap-steved-5b3452c9ed1738f019b73bf6ffd3440084567325.tar.xz
systemtap-steved-5b3452c9ed1738f019b73bf6ffd3440084567325.zip
2007-03-04 Frank Ch. Eigler <fche@redhat.com>
* stap.1.in, stapex.5.in, staprun.8.in: Tweak text to remove authors credits, update examples and pointers.
Diffstat (limited to 'stapex.5.in')
-rw-r--r--stapex.5.in18
1 files changed, 8 insertions, 10 deletions
diff --git a/stapex.5.in b/stapex.5.in
index d43edda0..f8f61c32 100644
--- a/stapex.5.in
+++ b/stapex.5.in
@@ -36,10 +36,10 @@ probe begin {
probe end {
foreach (x+ in odds) {
- log("odds[" . sprint(x) . "] = " . sprint(odds[x]))
+ printf ("odds[%d] = %d\n", x, odds[x])
}
foreach (x in evens\-) {
- log("evens[" . sprint(x) . "] = " . sprint(evens[x]))
+ printf ("evens[%d] = %d\n", x, evens[x])
}
}
.ESAMPLE
@@ -52,12 +52,10 @@ odds[5] = 9
evens[5] = 8
evens[4] = 6
evens[2] = 2
+evens[1] = 0
.ESAMPLE
-Note that the evens[1] key is missing, since its value was zero. Any
-array element with an "empty" value (zero or empty string) is
-considered not present in the array, as if it was deleted. Note that
-all variables types are inferred, and that all locals and globals are
-initialized.
+Note that all variables types are inferred, and that all locals
+and globals are automatically initialized.
.PP
This script prints the primes between 0 and 49.
@@ -72,7 +70,7 @@ function isprime (x) {
}
probe begin {
for (i=0; i<50; i++)
- if (isprime (i)) log (sprint(i))
+ if (isprime (i)) printf("%d\n", i)
exit()
}
.ESAMPLE
@@ -87,7 +85,7 @@ function fibonacci(i) {
return fibonacci (i\-1) + fibonacci (i\-2)
}
probe begin {
- log ("11th fibonacci number: " . sprint (fibonacci (11)))
+ printf ("11th fibonacci number: %d\n", fibonacci (11))
exit ()
}
.ESAMPLE
@@ -110,8 +108,8 @@ each inlined function instance is listed separately.
% stap \-p2 \-e \[aq]probe kernel.function("*") {}\[aq] | sort | uniq
.ESAMPLE
-
.SH SEE ALSO
+.BR @prefix@/doc/systemtap*/examples
.IR stap (1)
.IR stapprobes (5)
.IR stapfuncs (5)