diff options
author | mmason <mmason> | 2007-08-01 16:01:32 +0000 |
---|---|---|
committer | mmason <mmason> | 2007-08-01 16:01:32 +0000 |
commit | 0b1587bf6dae8229f80ebcdeb7d9b95e6f3b95af (patch) | |
tree | 728188554034c1ed0445fa5eac57d2e2c4068beb | |
parent | e35faec0cfebfe4fc2d2a6632cdc249e6da42d90 (diff) | |
download | systemtap-steved-0b1587bf6dae8229f80ebcdeb7d9b95e6f3b95af.tar.gz systemtap-steved-0b1587bf6dae8229f80ebcdeb7d9b95e6f3b95af.tar.xz systemtap-steved-0b1587bf6dae8229f80ebcdeb7d9b95e6f3b95af.zip |
Changed pid to tid throughout. Changed delete method in decumulate().
-rw-r--r-- | testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | testsuite/systemtap.samples/profile.stp | 27 |
2 files changed, 18 insertions, 14 deletions
diff --git a/testsuite/ChangeLog b/testsuite/ChangeLog index 82aafd35..5f719701 100644 --- a/testsuite/ChangeLog +++ b/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2007-07-25 Mike Mason <mmlnx@us.ibm.com> + + * systemtap.samples/profile.stp: Changed pid to tid throughout. + Changed delete method in decumulate(). + 2007-07-26 David Smith <dsmith@redhat.com> PR 4295 diff --git a/testsuite/systemtap.samples/profile.stp b/testsuite/systemtap.samples/profile.stp index 880bd14a..a1453541 100644 --- a/testsuite/systemtap.samples/profile.stp +++ b/testsuite/systemtap.samples/profile.stp @@ -3,21 +3,20 @@ global command, syscall_count, syscall_times, this_syscall_time, this_syscall function accumulate () { - pid = pid() - if (! ([pid] in command)) command[pid] = execname() + tid = tid() + if (! ([tid] in command)) command[tid] = execname() syscall=pp() # just the substring ideally - syscall_count[pid,syscall] ++ - this_syscall[pid] = syscall - this_syscall_time[pid] = gettimeofday_us() + syscall_count[tid,syscall] ++ + this_syscall[tid] = syscall + this_syscall_time[tid] = gettimeofday_us() } function decumulate () { - pid = pid() - syscall = this_syscall[pid] - syscall_times[pid,syscall] += - gettimeofday_us() - this_syscall_time[pid] + tid = tid() + syscall = this_syscall[tid] + syscall_times[tid,syscall] += gettimeofday_us() - this_syscall_time[tid] # free up memory - this_syscall[pid] = "" - this_syscall_time[pid] = 0 + delete(this_syscall[tid]) + delete(this_syscall_time[tid]) } probe kernel.function("sys_*").call { accumulate () @@ -29,9 +28,9 @@ probe timer.ms(5000) { exit () } probe end { - foreach ([pid,syscall] in syscall_count-) { - printf("%s(%d) %s count=%d ttime=%d\n", command[pid], pid, syscall, - syscall_count[pid,syscall], syscall_times[pid,syscall]) + foreach ([tid,syscall] in syscall_count-) { + printf("%s(%d) %s count=%d ttime=%d\n", command[tid], tid, syscall, + syscall_count[tid,syscall], syscall_times[tid,syscall]) if (count++ > 30) next } |