summaryrefslogtreecommitdiffstats
path: root/examples/small_demos
diff options
context:
space:
mode:
authorhunt <hunt>2007-01-10 15:24:36 +0000
committerhunt <hunt>2007-01-10 15:24:36 +0000
commit83c370cb3bd238ac65ebd784446d8339d9971108 (patch)
treec37027afeb07e3b9c0b4da90336220590343d711 /examples/small_demos
parent0fa344a92f52c5916a81b86557a3c1339a26e58b (diff)
downloadsystemtap-steved-83c370cb3bd238ac65ebd784446d8339d9971108.tar.gz
systemtap-steved-83c370cb3bd238ac65ebd784446d8339d9971108.tar.xz
systemtap-steved-83c370cb3bd238ac65ebd784446d8339d9971108.zip
2007-01-10 Martin Hunt <hunt@redhat.com>
* small_demos/top.stp: Use "limit" option in foreach.
Diffstat (limited to 'examples/small_demos')
-rwxr-xr-xexamples/small_demos/top.stp6
1 files changed, 1 insertions, 5 deletions
diff --git a/examples/small_demos/top.stp b/examples/small_demos/top.stp
index fa180dd5..ed658907 100755
--- a/examples/small_demos/top.stp
+++ b/examples/small_demos/top.stp
@@ -6,13 +6,9 @@
global syscalls
function print_top () {
- cnt=0
printf ("SYSCALL\t\t\t\tCOUNT\n")
- foreach ([name] in syscalls-) {
+ foreach ([name] in syscalls- limit 20)
printf("%-20s\t\t%5d\n",name, syscalls[name])
- if (cnt++ == 20)
- break
- }
printf("--------------------------------------\n")
delete syscalls
}