summaryrefslogtreecommitdiffstats
path: root/testsuite/systemtap.samples
diff options
context:
space:
mode:
authorhunt <hunt>2007-11-12 22:04:35 +0000
committerhunt <hunt>2007-11-12 22:04:35 +0000
commitdda823f922ac7294cd24eeb4b1bb7436af24c8c7 (patch)
treebf8a4507dda929f48b1ad31e216b5694e1e99384 /testsuite/systemtap.samples
parenteddde980ee23baef42edb992da5cb977ba6b4c0c (diff)
downloadsystemtap-steved-dda823f922ac7294cd24eeb4b1bb7436af24c8c7.tar.gz
systemtap-steved-dda823f922ac7294cd24eeb4b1bb7436af24c8c7.tar.xz
systemtap-steved-dda823f922ac7294cd24eeb4b1bb7436af24c8c7.zip
2007-11-12 Martin Hunt <hunt@redhat.com>
* systemtap.base/*.stp: Replace log() calls with println() (or printf() if formatting would help.) * systemtap.maps/*.stp: Ditto. * systemtap.samples/*.stp: Ditto. * systemtap.stress/*.stp: Ditto.
Diffstat (limited to 'testsuite/systemtap.samples')
-rw-r--r--testsuite/systemtap.samples/args.stp2
-rw-r--r--testsuite/systemtap.samples/arith.stp6
-rw-r--r--testsuite/systemtap.samples/arith_limits.stp7
-rw-r--r--testsuite/systemtap.samples/ioblocktest.stp4
-rw-r--r--testsuite/systemtap.samples/iotask.stp16
-rw-r--r--testsuite/systemtap.samples/iotask2.stp4
-rw-r--r--testsuite/systemtap.samples/primes.stp6
7 files changed, 22 insertions, 23 deletions
diff --git a/testsuite/systemtap.samples/args.stp b/testsuite/systemtap.samples/args.stp
index 85e731ac..84b6080e 100644
--- a/testsuite/systemtap.samples/args.stp
+++ b/testsuite/systemtap.samples/args.stp
@@ -3,7 +3,7 @@
global foo, bar
probe begin {
- log ("foo=" . foo . " bar=" . sprint (bar+0 /* cast bar to integer */))
+ printf("foo=%s bar=%d\n", foo, bar)
exit ()
}
diff --git a/testsuite/systemtap.samples/arith.stp b/testsuite/systemtap.samples/arith.stp
index 80f0c040..59016dcb 100644
--- a/testsuite/systemtap.samples/arith.stp
+++ b/testsuite/systemtap.samples/arith.stp
@@ -8,7 +8,7 @@ function test (v,n1,n2) {
failures ++
result = "fail"
}
- log ("test " . (sprint (++testno)) . " [" . v . "]\t" . result)
+ println ("test " . (sprint (++testno)) . " [" . v . "]\t" . result)
}
function stest (v,n1,n2) {
@@ -19,7 +19,7 @@ function stest (v,n1,n2) {
failures ++
result = "fail"
}
- log ("test " . (sprint (++testno)) . " [" . v . "]\t" . result)
+ println ("test " . (sprint (++testno)) . " [" . v . "]\t" . result)
}
@@ -75,5 +75,5 @@ probe timer.jiffies(1) { # some time after all the begin probes
}
probe end {
- log ("passes: " . sprint(passes) . " failures: " . sprint(failures))
+ printf ("passes: %d failures: %d\n", passes, failures)
}
diff --git a/testsuite/systemtap.samples/arith_limits.stp b/testsuite/systemtap.samples/arith_limits.stp
index f38a5a68..6c620830 100644
--- a/testsuite/systemtap.samples/arith_limits.stp
+++ b/testsuite/systemtap.samples/arith_limits.stp
@@ -8,7 +8,7 @@ function test (v,n1,n2) {
failures ++
result = "fail"
}
- log ("test " . (sprint (testno++)) . " [" . v . "]\t\t" . result)
+ printf ("test %d [%s]\t\t%s\n", testno++, v, result)
}
# Exactly the same as test() except it will magically work for strings.
@@ -22,7 +22,7 @@ function teststr (v,n1,n2) {
failures ++
result = "fail"
}
- log ("test " . (sprint (testno++)) . " [" . v . "]\t\t" . result)
+ printf ("test %d [%s]\t\t%s\n", testno++, v, result)
}
@@ -76,6 +76,5 @@ probe begin {
}
probe end {
- print ("passes: " . sprint(passes))
- print (" failures: " . sprint(failures). "\n")
+ printf ("passes: %d failures: %d\n", passes, failures)
}
diff --git a/testsuite/systemtap.samples/ioblocktest.stp b/testsuite/systemtap.samples/ioblocktest.stp
index 4aa3c3a9..f8a1c568 100644
--- a/testsuite/systemtap.samples/ioblocktest.stp
+++ b/testsuite/systemtap.samples/ioblocktest.stp
@@ -1,12 +1,12 @@
#! stap
global teststr
-probe begin { log("systemtap starting probe") }
+probe begin { println("systemtap starting probe") }
probe ioblock.request, ioblock.end {
teststr = sprintf("ioblock: %s\t%d\t%s\t%d\n", devname, sector,
bio_rw_str(rw), bio_rw_num(rw))
}
probe end {
- log("systemtap ending probe")
+ println("systemtap ending probe")
printf("%s", teststr)
}
diff --git a/testsuite/systemtap.samples/iotask.stp b/testsuite/systemtap.samples/iotask.stp
index 13d273a3..ee0ae4b4 100644
--- a/testsuite/systemtap.samples/iotask.stp
+++ b/testsuite/systemtap.samples/iotask.stp
@@ -23,23 +23,21 @@ probe kernel.function("sys_write") {
write_bytes[execname()] += $count;
}
-probe begin { log( "starting probe" ); }
+probe begin { println( "starting probe" ); }
probe end {
foreach( name in names){
- log ("process: " . name);
+ printf ("process: %s\n", name);
if (opens[name])
- log( "opens n=" . sprint(opens[name]));
- if ( reads[name]){
+ printf ("opens=%d\n",opens[name])
+ if (reads[name]){
count = reads[name]; total=read_bytes[name];
- log("reads n, sum, avg=". sprint(count)
- . "," . sprint(total) . "," . sprint(total/count));
+ printf("reads=%d, sum=%d, avg=%d\n", count, total, total/count);
}
if (writes[name]){
count = writes[name]; total=write_bytes[name];
- log("writes n, sum, avg=". sprint(count)
- . "," . sprint(total) . "," . sprint(total/count));
+ printf("writes=%d, sum=%d, avg=%d\n", count, total, total/count);
}
- log("");
+ println("");
}
}
diff --git a/testsuite/systemtap.samples/iotask2.stp b/testsuite/systemtap.samples/iotask2.stp
index 1f3248e3..cc4707b7 100644
--- a/testsuite/systemtap.samples/iotask2.stp
+++ b/testsuite/systemtap.samples/iotask2.stp
@@ -1,9 +1,9 @@
global names, opens, reads, writes
-probe begin { log("starting probe") }
+probe begin { println("starting probe") }
probe timer.ms(10000) {
- log("stopping probe after 10 seconds")
+ println("stopping probe after 10 seconds")
exit()
}
diff --git a/testsuite/systemtap.samples/primes.stp b/testsuite/systemtap.samples/primes.stp
index 7e7aeb37..1072b4b2 100644
--- a/testsuite/systemtap.samples/primes.stp
+++ b/testsuite/systemtap.samples/primes.stp
@@ -1,5 +1,7 @@
#! stap
+
global odds, evens
+
probe begin {
# "no" and "ne" are local integers
for (i=1; i<10; i++) {
@@ -13,9 +15,9 @@ 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])
}
}