]> sourceware.org Git - systemtap.git/commitdiff
2007-11-12 Martin Hunt <hunt@redhat.com>
authorhunt <hunt>
Mon, 12 Nov 2007 22:04:35 +0000 (22:04 +0000)
committerhunt <hunt>
Mon, 12 Nov 2007 22:04:35 +0000 (22:04 +0000)
* 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.

30 files changed:
testsuite/ChangeLog
testsuite/buildok/context_test.stp
testsuite/systemtap.base/add.stp
testsuite/systemtap.base/array_size.stp
testsuite/systemtap.base/be_order.stp
testsuite/systemtap.base/deref.stp
testsuite/systemtap.base/deref2.stp
testsuite/systemtap.base/equal.stp
testsuite/systemtap.base/finloop2.stp
testsuite/systemtap.base/global_init.stp
testsuite/systemtap.base/if.stp
testsuite/systemtap.base/inc.stp
testsuite/systemtap.base/kfunct.stp
testsuite/systemtap.base/kmodule.stp
testsuite/systemtap.base/logical_and.stp
testsuite/systemtap.base/not.stp
testsuite/systemtap.base/print.stp
testsuite/systemtap.base/prologues.stp
testsuite/systemtap.base/simple.stp
testsuite/systemtap.base/tri.stp
testsuite/systemtap.maps/absentstats.stp
testsuite/systemtap.printf/hello2.stp
testsuite/systemtap.samples/args.stp
testsuite/systemtap.samples/arith.stp
testsuite/systemtap.samples/arith_limits.stp
testsuite/systemtap.samples/ioblocktest.stp
testsuite/systemtap.samples/iotask.stp
testsuite/systemtap.samples/iotask2.stp
testsuite/systemtap.samples/primes.stp
testsuite/systemtap.stress/current.stp

index 58f0cc134eee26c4a596d53927ed2c271002ccd9..302fda2505b8406e57bb9c1b4e7e85dd3d967231 100644 (file)
@@ -1,3 +1,11 @@
+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.                
+
 2007-11-09  Masami Hiramatsu  <mhiramat@redhat.com>
 
        PR3858
index 36bf8ca69c98047868906f19111b8a75991cf4cd..e98b0065b52b0806e44f8d0bda24410336a2c41e 100755 (executable)
@@ -8,16 +8,16 @@ function print_stuff () {
        print("\n\n")
        print_stack(bt)
        print("\n\n")
-       log("execname is \"" . execname() . "\"")
-       log("pid is " . sprint(pid()))
-       log("tid is " . sprint(tid()))
-       log("pexecname is \"" . pexecname() . "\"")
-       log("ppid is " . sprint(ppid()))
-       log("uid is " . sprint(uid()))
-       log("euid is " . sprint(euid()))
-       log("gid is " . sprint(gid()))
-       log("egid is " . sprint(egid()))
-       log("pp is '" . pp() . "'")
+       printf("execname is %s\n", execname())
+       printf("pid is %d\n",pid())
+       printf("tid is %d\n", tid())
+       printf("pexecname is %s\n", pexecname())
+       printf("ppid is %d\n", ppid())
+       printf("uid is %d\n", uid())
+       printf("euid is %d\n", euid())
+       printf("gid is %d\n", gid())
+       printf("egid is %d\n", egid())
+       printf("pp is %s\n", pp())
 }
 
 probe kernel.function("uptime_read_proc") {
index 3fa7be382302477f33f6a4ab387cc4447d4fa316..8ae46f10a11982f8648905bee214881dd7a33aae 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * add.stp
  *
- * Check the systemtap "addition" works
+ * Check that systemtap "addition" works
  */
 
 global x3
@@ -10,17 +10,17 @@ global x2
 
 probe begin
 {
-       log("systemtap starting probe")
+       println("systemtap starting probe")
        x1 = 42; x2 = 53;
 }
 
 probe end
 {
-       log("systemtap ending probe")
+       println("systemtap ending probe")
        x3 = x1 + x2;
        if (x3 != 95 ) {
-               log("systemtap test failure");
+               println("systemtap test failure")
        } else {
-               log("systemtap test success");
+               println("systemtap test success")
        }
 }
index cf597a618b55e5e8b13240663024c1229cd0bb70..7b45724788c59f27b408afaa7ccfb475c5ad8ca9 100644 (file)
@@ -6,8 +6,8 @@
  * Call with MAXMAPENTRIES << 100
  */
 
-probe begin {  log("systemtap starting probe")  }
-probe end   {  log("systemtap ending probe")    }
+probe begin {  println("systemtap starting probe")  }
+probe end   {  println("systemtap ending probe")    }
 
 global a[100]
 
@@ -24,7 +24,7 @@ probe end(1) {
             ++bad
     }
     if (ok == 100 && bad == 0)
-        log("systemtap test success")
+        println("systemtap test success")
     else
         printf("systemtap test failure - ok:%d, bad:%d\n", ok, bad)
 }
index 166d0dca7da393aa74255e16cf53bcc058303eb7..57effb1f5b8573fae3aa4bb0a412bee8619efa22 100644 (file)
@@ -4,8 +4,8 @@
  * Check that ordering of begin/end probes works
  */
 
-probe begin {  log("systemtap starting probe")  }
-probe end   {  log("systemtap ending probe")    }
+probe begin {  println("systemtap starting probe")  }
+probe end   {  println("systemtap ending probe")    }
 
 global beginstr, endstr
 
@@ -24,12 +24,12 @@ probe end(9223372036854775807) {
   endstr .= "z"
 
   if (beginstr == "abccde")
-    log("systemtap test success")
+    println("systemtap test success")
   else
     printf("systemtap test failure - beginstr:%s != abccde\n", beginstr)
 
   if (endstr == "vwxxyz")
-    log("systemtap test success")
+    println("systemtap test success")
   else
     printf("systemtap test failure - endstr:%s != vwxxyz\n", endstr)
 }
index b003d6579c1e5d691404e0271bd940e001fa4230..3f76bfb66877846e47f0f90d78ed34462c649011 100644 (file)
@@ -4,8 +4,8 @@
  * Check that the deref mechanisms work correctly.
  */
 
-probe begin {  log("systemtap starting probe")  }
-probe end   {  log("systemtap ending probe")    }
+probe begin {  println("systemtap starting probe")  }
+probe end   {  println("systemtap ending probe")    }
 
 probe end(1) {
   log_test("kread u8", kread_u8())
@@ -29,7 +29,7 @@ probe end(1) {
 
 function log_test(test:string, result:long) {
   if (result)
-    log("systemtap test success")
+    println("systemtap test success")
   else
     printf("systemtap test failure - %s\n", test)
 }
index aa59490c17529ee748beb43c6b31e4d03457191f..0008bae7ba0113fd10fb0e65c0123183847e6bfc 100644 (file)
@@ -3,7 +3,7 @@
 # It's just an ordinary function that returns a 4-byte signed value,
 # even on a 64-bit hosts.
 probe kernel.function("sock_alloc_fd").return {
-      log ($return < 0 ? "neg" : "pos")
+      println ($return < 0 ? "neg" : "pos")
 }
 probe timer.s (5) { exit () }
-probe begin { log ("start") }
\ No newline at end of file
+probe begin { println ("start") }
index 83ca0115e8419aa39866bd79470f1a9ac5347334..0333307ada3e22714e88ebe223a70ba3aa2ebe12 100644 (file)
@@ -7,22 +7,22 @@
 global count
 global count2
 
-probe begin { log("systemtap starting probe") }
+probe begin { println("systemtap starting probe") }
 
 probe kernel.function("schedule") { ++count; ++count2; }
 
 probe end
 {
-       log("systemtap ending probe")
-       log("count = " . sprint(count));
-       log("count2 = " . sprint(count));
+       println("systemtap ending probe")
+       printf("count = %d\n", count)
+       printf("count2 = %d\n", count)
        if ( count == count2) {
                if ( (count-1) == count2 ) {
-                       log("systemtap test failure");
+                       println("systemtap test failure");
                } else {
-                       log("systemtap test success");
+                       println("systemtap test success");
                }
        } else {
-               log("systemtap test failure");
+               println("systemtap test failure");
        }
 }
index 8f12fd8a5594c4fce8dd00f9cc6aaf40f548af03..b675be41ef593f42b6262273be6945ba97cb86af 100644 (file)
@@ -10,7 +10,7 @@ global loop_count
 
 probe begin
 {
-       log("systemtap starting probe")
+       println("systemtap starting probe")
 }
 
 probe kernel.function("schedule")
@@ -23,12 +23,12 @@ probe kernel.function("schedule")
 
 probe end
 {
-       log("systemtap ending probe")
-       log("count = " . sprint(count));
-       log("loop_count = " . sprint(loop_count));
+       println("systemtap ending probe")
+       printf("count = %d\n", count)
+       printf("loop_count = %d\n", loop_count)
        if ( count * 10 == loop_count) {
-               log("systemtap test success");
+               println("systemtap test success");
        } else {
-               log("systemtap test failure");
+               println("systemtap test failure");
        }
 }
index a5d7e58e46d77a31538d8d1afd61853e73a1a0ed..304788464a7a34fdc33dc9202a657b67a82c9c3c 100644 (file)
@@ -4,8 +4,8 @@
  * Check that global variables are initialized before all begin probes
  */
 
-probe begin {  log("systemtap starting probe")  }
-probe end   {  log("systemtap ending probe")    }
+probe begin {  println("systemtap starting probe")  }
+probe end   {  println("systemtap ending probe")    }
 
 global gnum = 42
 global gstr = "foobar"
@@ -19,12 +19,12 @@ probe begin(-9223372036854775808) {
 
 probe end {
   if (gnum_saved == 42)
-    log("systemtap test success")
+    println("systemtap test success")
   else
     printf("systemtap test failure - gnum_saved:%d != 42\n", gnum_saved)
 
   if (gstr_saved == "foobar")
-    log("systemtap test success")
+    println("systemtap test success")
   else
     printf("systemtap test failure - gstr_saved:%s != foobar\n", gstr_saved)
 }
index bcbafd5170b9a3c96faff30a243500e4337d0913..fa4da54d0b0952a583f2595a0fc1cf134d4bc2ee 100644 (file)
@@ -4,19 +4,19 @@
  * Check the systemtap if statement works
  */
 
-probe begin { log("systemtap starting probe") }
+probe begin { println("systemtap starting probe") }
 
 probe end
 {
-       log("systemtap ending probe")
+       println("systemtap ending probe")
        if (1) {
-               log("systemtap test success");
+               println("systemtap test success");
        } else {
-               log("systemtap test failure");
+               println("systemtap test failure");
        }
        if (0) {
-               log("systemtap test failure");
+               println("systemtap test failure");
        } else {
-               log("systemtap test success");
+               println("systemtap test success");
        }
 }
index f37b2ceea2f3d205eeb86f0a4147e89fc2b8174b..17d6dc7c618fa4a4d0a055ec365cac44a02e0953 100644 (file)
@@ -1,24 +1,28 @@
 /*
  * inc.stp
  *
- * Check the systemtap ++ works
+ * Check that systemtap ++ works
  */
 
 global x1
 
 probe begin
 {
-       log("systemtap starting probe");
-       x1 = 41;
+       println("systemtap starting probe")
+       x1 = 41
 }
 
 probe end
 {
-       log("systemtap ending probe");
-       ++x1;
-       if (x1 != 42 ) {
-               log("systemtap test failure");
-       } else {
-               log("systemtap test success");
-       }
+       println("systemtap ending probe")
+       x1++
+       if (x1 == 42) {
+               ++x1
+               if (x1 != 43 ) {
+                       println("systemtap test failure")
+               } else {
+                       println("systemtap test success")
+               }
+       } else
+               println("systemtap test failure")
 }
index 15be51bd31b70feaaef74dbe749dd3bc51d1a45b..93031395125133a460ac568c6c52ad8fcb1296cb 100644 (file)
@@ -9,7 +9,7 @@ global count
 
 probe begin
 {
-       log("systemtap starting probe")
+       println("systemtap starting probe")
 }
 
 probe kernel.function("schedule")
@@ -19,6 +19,6 @@ probe kernel.function("schedule")
 
 probe end
 {
-       log("systemtap ending probe")
-       log("count = " . sprint(count));
+       println("systemtap ending probe")
+       printf("count = %d\n", count)
 }
index 9c718f29f38dd53832e5edefa086af4cbde290a0..19241cab37f4e8e3fee77a712a4f2ed81b8d3620 100644 (file)
@@ -9,7 +9,7 @@ global count
 
 probe begin
 {
-       log("systemtap starting probe")
+       println("systemtap starting probe")
 }
 
 probe module("ext3").function("ext3_sync_file") ?,
@@ -22,6 +22,6 @@ probe module("ext3").function("ext3_sync_file") ?,
 
 probe end
 {
-       log("systemtap ending probe")
-       log("count = " . sprint(count));
+       println("systemtap ending probe")
+       println("count = " . sprint(count));
 }
index 5017190baf860d3f763261cdd00945efbab56da1..3f4961b46210020d9b40cfc6b4b22f98dc43969b 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * logical_and.stp
  *
- * Check the systemtap "logical and" works
+ * Check that systemtap "logical and" works
  */
 
 global x1_0
@@ -11,31 +11,31 @@ global x4_1
 
 probe begin
 {
-       log("systemtap starting probe")
+       println("systemtap starting probe")
        x1_0 = 0; x2_1 = 1; x3_0 = 0; x4_1 = 1;
 }
 
 probe end
 {
-       log("systemtap ending probe")
+       println("systemtap ending probe")
        if (x1_0 && x3_0 ) {
-               log("systemtap test failure");
+               println("systemtap test failure");
        } else {
-               log("systemtap test success");
+               println("systemtap test success");
        }
        if (x2_1 && x3_0 ) {
-               log("systemtap test failure");
+               println("systemtap test failure");
        } else {
-               log("systemtap test success");
+               println("systemtap test success");
        }
        if (x1_0 && x4_1 ) {
-               log("systemtap test failure");
+               println("systemtap test failure");
        } else {
-               log("systemtap test success");
+               println("systemtap test success");
        }
        if (x2_1 && x4_1 ) {
-               log("systemtap test success");
+               println("systemtap test success");
        } else {
-               log("systemtap test failure");
+               println("systemtap test failure");
        }
 }
index 3e1bbd50518c5e0eca63fc2ecf52370d3e11cd13..166346dfe4441e4baddceebe5bd71a1265cfed84 100644 (file)
@@ -1,24 +1,24 @@
 /*
  * neg.stp
  *
- * Check the systemtap negation works
+ * Check that systemtap negation works
  */
 
 global x2, x1
 
 probe begin
 {
-       log("systemtap starting probe")
+       println("systemtap starting probe")
        x1 = 0xaaaaaaaaaaaaaaaa
 }
 
 probe end
 {
-       log("systemtap ending probe")
-       x2 = ~x1;
+       println("systemtap ending probe")
+       x2 = ~x1
        if ( x2 != 0x5555555555555555 ) {
-               log("systemtap test failure");
+               println("systemtap test failure")
        } else {
-               log("systemtap test success");
+               println("systemtap test success")
        }
 }
index e1b64c35763f38429f1d7463565491a0d47f7abd..161be4b4cca673c7ccb5e6e9af6cb0ac37eb58ba 100644 (file)
@@ -8,32 +8,33 @@ global s1, s2, s3
 
 probe begin
 {
-       log("systemtap starting probe")
-    s1 = "systemtap"
-    s2 = "test"
-    s3 = "success"
+       println("systemtap starting probe")
+       s1 = "systemtap"
+       s2 = "test"
+       s3 = "success"
 }
 
 probe end
 {
-       log("systemtap ending probe")
+       println("systemtap ending probe")
 
-    print(s1, " ", s2, " ", s3, "\n")
-    print(sprint(s1, " ", s2, " ", s3, "\n"))
+       print(s1, " ", s2, " ", s3, "\n")
+       print(sprint(s1, " ", s2, " ", s3, "\n"))
 
-    println(s1, " ", s2, " ", s3)
-    print(sprintln(s1, " ", s2, " ", s3))
+       println(s1, " ", s2, " ", s3)
+       print(sprintln(s1, " ", s2, " ", s3))
 
-    printd(" ", s1, s2, s3 . "\n")
-    print(sprintd(" ", s1, s2, s3 . "\n"))
+       printd(" ", s1, s2, s3 . "\n")
+       print(sprintd(" ", s1, s2, s3 . "\n"))
 
-    printdln(" ", s1, s2, s3)
-    print(sprintdln(" ", s1, s2, s3))
+       printdln(" ", s1, s2, s3)
+       print(sprintdln(" ", s1, s2, s3))
 
-    // check that formatting characters get escaped correctly in the delimiter
-    s = sprintd("%% % \\ \"", 1, 2, 3)
-    if (s == "1%% % \\ \"2%% % \\ \"3")
-        log("systemtap test success")
-    else
-        log("systemtap test failure")
+       // Check that formatting characters get escaped correctly 
+       // in the delimiter.
+       s = sprintd("%% % \\ \"", 1, 2, 3)
+       if (s == "1%% % \\ \"2%% % \\ \"3")
+               println("systemtap test success")
+       else
+               println("systemtap test failure")
 }
index fc32ccd90026dba9e6d20361f63ff4057dfb0a4b..cbda14f986270596b22b2cec1b184ad0d833a5bb 100644 (file)
@@ -1,6 +1,6 @@
 # These sys_ functions often display prologue sensitivity
 probe syscall.read, syscall.write {
-  log (name . argstr)
+  printf("%s (%s)\n", name, argstr)
   if (num++ > 20) exit()
 }
 global num
index 28a81cffaf95444f189acd1d94da7659e9d3029d..ee8a97a84c2c02e0c27a1ef60fc52e9d46884ac8 100644 (file)
@@ -7,10 +7,10 @@
 
 probe begin
 {
-       log("systemtap starting probe")
+       println("systemtap starting probe")
 }
 
 probe end
 {
-       log("systemtap ending probe")
+       println("systemtap ending probe")
 }
index 80aed1e78325def835d43ee814624b7d410baf72..92b78801545321b8d698cdadcb536a131e30c04c 100644 (file)
@@ -8,29 +8,29 @@ global x1, x2, x3, x4, x5, x6
 
 probe begin
 {
-       log("systemtap starting probe");
+       println("systemtap starting probe");
        x1 = 0; x2 = 1; x3=30;
 }
 
 probe end
 {
-       log("systemtap ending probe")
+       println("systemtap ending probe")
        x4 = x1 ? 9: 10;
        x5 = x2 ? 99: 100;
        x6 = x3 ? 999: 1000;
        if (x4 != 10 ) {
-               log("systemtap test failure");
+               println("systemtap test failure");
        } else {
-               log("systemtap test success");
+               println("systemtap test success");
        }
        if (x5 != 99 ) {
-               log("systemtap test failure");
+               println("systemtap test failure");
        } else {
-               log("systemtap test success");
+               println("systemtap test success");
        }
        if (x6 != 999 ) {
-               log("systemtap test failure");
+               println("systemtap test failure");
        } else {
-               log("systemtap test success");
+               println("systemtap test success");
        }
 }
index 641af5d351400768db623497950e916f87ac0b96..aeb176a1ffe979cdd03a66039f34ac4cd653f0fa 100644 (file)
@@ -1,7 +1,7 @@
 # stap -DMAXERRORS=40
 
 global sc
-probe begin { log(sprint(@count(sc))) }
+probe begin { println(@count(sc)) }
 probe begin { print(@sum(sc)) }
 probe begin { print(@max(sc)) }
 probe begin { print(@min(sc)) }
@@ -10,7 +10,7 @@ probe begin { print(@hist_log(sc)) }
 probe begin { x=@hist_log(sc)[5]; print(x) }
 
 global ry
-probe begin { log(sprint(@count(ry[4]))) }
+probe begin { println(@count(ry[4])) }
 probe begin { print(@sum(ry[4])) }
 probe begin { print(@max(ry[4])) }
 probe begin { print(@min(ry[4])) }
index aa0798fa78ff825242490fa12813a00f4b07047e..de3db58881988bffa2a3e1a3eceacd9c62a10bb6 100644 (file)
@@ -1,7 +1,7 @@
 probe begin
 {
        print("Print");
-       log("Systemtap");
+       println("Systemtap");
        warn("warning");
        exit()
 }
index 85e731aca5c0389094176dc197549de5342fbbe0..84b6080e30121cc835cf72337e1366afb9a44499 100644 (file)
@@ -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 ()
 }
 
index 80f0c0408719ae64f21128d1299e90202ba9ab29..59016dcb7325c6d9a38898dfb8a00ee085e3989f 100644 (file)
@@ -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)
 }
index f38a5a6813e9070aea9ff42f370bcff5bd536dd3..6c6208300ef1057950cb55128ce23c7efa5a2ca2 100644 (file)
@@ -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)
 }
index 4aa3c3a93f658efd92611246408ae64527cd891b..f8a1c5685e980c768ae2a2c9eb47b559180f03cf 100644 (file)
@@ -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)
 }
index 13d273a33895e524c339765ae52116a3ed1b1ba6..ee0ae4b44fbb2ba03f51298afb5b4006ef67aba8 100644 (file)
@@ -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("");
   }
 }
index 1f3248e3a52c523d638f8682f200dcda8e3379ed..cc4707b753860156d46dc07924767bfb8c8a2c1a 100644 (file)
@@ -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()
 }
 
index 7e7aeb372fb9e23d306f48196da8ae1583e35daf..1072b4b25ad29829dcccac6704ffa74c092e6355 100644 (file)
@@ -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])
   }
 }
index ff2a9941942cc53a7f6be3b3b588c340401ddb1a..4c0f824c027958ec6c18803e49d127330c41e163 100644 (file)
@@ -14,7 +14,7 @@ function pcommlen:long () %{
     THIS->__retvalue = strlen(current->parent->comm);
 %}
 
-probe begin { log("systemtap starting probe") }
+probe begin { println("systemtap starting probe") }
 
 probe
     timer.profile,
@@ -73,7 +73,7 @@ function get_TASK_COMM_LEN:long() %{
 %}
 
 probe end {
-    log("systemtap ending probe")
+    println("systemtap ending probe")
     printf("count = %d\n", @count(length))
     printf("sum = %d\n", @sum(length))
     printf("min = %d\n", @min(length))
@@ -86,15 +86,15 @@ probe end {
      * valid, even though it dereferenced without crashing.
      */
     if (@min(length) > 0) {
-        log("systemtap test success")
+        println("systemtap test success")
     } else {
-        log("unexpected minimum length")
-        log("systemtap test failure")
+        println("unexpected minimum length")
+        println("systemtap test failure")
     }
     if (@max(length) < get_TASK_COMM_LEN()) {
-        log("systemtap test success")
+        println("systemtap test success")
     } else {
-        log("unexpected maximum length")
-        log("systemtap test failure")
+        println("unexpected maximum length")
+        println("systemtap test failure")
     }
 }
This page took 0.074002 seconds and 5 git commands to generate.