summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrank Ch. Eigler <fche@elastic.org>2008-10-29 14:01:52 -0400
committerFrank Ch. Eigler <fche@elastic.org>2008-10-29 14:01:52 -0400
commit78fda566780f43f90e688b683323b9dc7ac63318 (patch)
treef995960278c3125c7ef3be330252faa6dbad06be
parent4487fde80fa26c47733d9e5fb343752b400b82e6 (diff)
downloadsystemtap-steved-78fda566780f43f90e688b683323b9dc7ac63318.tar.gz
systemtap-steved-78fda566780f43f90e688b683323b9dc7ac63318.tar.xz
systemtap-steved-78fda566780f43f90e688b683323b9dc7ac63318.zip
tweak demo script to solve namespace collision
-rw-r--r--testsuite/systemtap.examples/ChangeLog5
-rwxr-xr-xtestsuite/systemtap.examples/process/syscalltimes10
2 files changed, 10 insertions, 5 deletions
diff --git a/testsuite/systemtap.examples/ChangeLog b/testsuite/systemtap.examples/ChangeLog
index 3a0afda4..093785ed 100644
--- a/testsuite/systemtap.examples/ChangeLog
+++ b/testsuite/systemtap.examples/ChangeLog
@@ -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.
diff --git a/testsuite/systemtap.examples/process/syscalltimes b/testsuite/systemtap.examples/process/syscalltimes
index 84ca77a9..a5a7b73d 100755
--- a/testsuite/systemtap.examples/process/syscalltimes
+++ b/testsuite/systemtap.examples/process/syscalltimes
@@ -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() {