From 78fda566780f43f90e688b683323b9dc7ac63318 Mon Sep 17 00:00:00 2001 From: "Frank Ch. Eigler" Date: Wed, 29 Oct 2008 14:01:52 -0400 Subject: [PATCH] tweak demo script to solve namespace collision --- testsuite/systemtap.examples/ChangeLog | 5 +++++ testsuite/systemtap.examples/process/syscalltimes | 10 +++++----- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/testsuite/systemtap.examples/ChangeLog b/testsuite/systemtap.examples/ChangeLog index 3a0afda4b..093785ed5 100644 --- a/testsuite/systemtap.examples/ChangeLog +++ b/testsuite/systemtap.examples/ChangeLog @@ -1,3 +1,8 @@ +2008-10-29 Frank Ch. Eigler + + * process/syscalltimes: Rename global "start" to avoid collision + with syscall tapset local variable. + 2008-10-27 William Cohen * 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 84ca77a9f..a5a7b73d5 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() { -- 2.43.5