This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
Re: Newbie question -- arrays
- From: Srikar Dronamraju <srikar at linux dot vnet dot ibm dot com>
- To: Om Narasimhan <om dot turyx at gmail dot com>
- Cc: systemtap at sourceware dot org
- Date: Thu, 21 Aug 2008 12:41:31 +0530
- Subject: Re: Newbie question -- arrays
- References: <48AD0D7B.6010606@gmail.com>
- Reply-to: Srikar Dronamraju <srikar at linux dot vnet dot ibm dot com>
Hi,
Where did you get this script?
>
> [om@testserv /space/stap]$ cat open-count.stp
> # establish a timer for 3 seconds, in the meantime traces open() and counts
> who
> # does it most and prints top 10
>
> global op_uid_a # keeps the open counts by uid
>
> probe timer.ms(3000)
> {
> # foreach ( [op_id, op_name, op_count-] in op_uid_a limit 10) {
foreach ( [op_id -, op_name] in op_uid_a limit 10) {
# op_uid_a should take same number of index in the tuple.
> printf ("%s issued sys_open %d times\n", name, count)
> }
> exit()
> }
>
> probe syscall.open
> {
> op_uid_a[uid(), execname()]++
> printf ("%s(%d): sys_open, uid = %d\n", execname(), pid(), uid());
> }
--
Thanks and Regards
Srikar