]> sourceware.org Git - systemtap.git/commitdiff
tweak demo script to solve namespace collision
authorFrank Ch. Eigler <fche@elastic.org>
Wed, 29 Oct 2008 18:01:52 +0000 (14:01 -0400)
committerFrank Ch. Eigler <fche@elastic.org>
Wed, 29 Oct 2008 18:01:52 +0000 (14:01 -0400)
testsuite/systemtap.examples/ChangeLog
testsuite/systemtap.examples/process/syscalltimes

index 3a0afda4bf53fc9ba8e9ec5129d7e2062155c370..093785ed564d29a6e1a0ced07bdc01c1e297e3a5 100644 (file)
@@ -1,3 +1,8 @@
+2008-10-29  Frank Ch. Eigler  <fche@elastic.org>
+
+       * process/syscalltimes: Rename global "start" to avoid collision
+       with syscall tapset local variable.
+
 2008-10-27  William Cohen  <wcohen@redhat.com>
 
        * io/disktop.stp: Make use of devname added to vfs tapset.
index 84ca77a9f45bc8c2c062f74dc407c3d201291840..a5a7b73d57fcf43aaf418f54efaa71a0cce113d1 100755 (executable)
@@ -82,7 +82,7 @@ echo "Creating and building SystemTap module..."
 # SystemTap script
 #
 stap $P_VERBOSE_STR -e '
-global start, timebycall, timebypid, timebyuid, timebyexec
+global starttime, timebycall, timebypid, timebyuid, timebyexec
 global f_exec_str, f_pid_str, f_uid_str
 global f_exec, f_pid, f_uid
 global prt_totals, filter_str
@@ -134,14 +134,14 @@ probe begin {
 }
 
 probe syscall.* {
-       start[name, tid()] = gettimeofday_ns()
+       starttime[name, tid()] = gettimeofday_ns()
 }
 
 probe syscall.*.return {
        # Skip if we have not seen this before
-       if (!([name, tid()] in start)) next
+       if (!([name, tid()] in starttime)) next
 
-       delta = gettimeofday_ns() - start[name, tid()]
+       delta = gettimeofday_ns() - starttime[name, tid()]
 
        # Check filters
        if ('$FILTER') {
@@ -165,7 +165,7 @@ probe syscall.*.return {
        if (target && prt_totals)
                timebycall[name] <<< delta
 
-       delete start[name, tid()]
+       delete starttime[name, tid()]
 }
 
 function print_header() {
This page took 0.028963 seconds and 5 git commands to generate.