diff options
author | hunt <hunt> | 2007-01-10 15:24:36 +0000 |
---|---|---|
committer | hunt <hunt> | 2007-01-10 15:24:36 +0000 |
commit | 83c370cb3bd238ac65ebd784446d8339d9971108 (patch) | |
tree | c37027afeb07e3b9c0b4da90336220590343d711 /examples | |
parent | 0fa344a92f52c5916a81b86557a3c1339a26e58b (diff) | |
download | systemtap-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')
-rw-r--r-- | examples/ChangeLog | 18 | ||||
-rwxr-xr-x | examples/small_demos/top.stp | 6 |
2 files changed, 19 insertions, 5 deletions
diff --git a/examples/ChangeLog b/examples/ChangeLog new file mode 100644 index 00000000..e31c2634 --- /dev/null +++ b/examples/ChangeLog @@ -0,0 +1,18 @@ +2007-01-10 Martin Hunt <hunt@redhat.com> + + * small_demos/top.stp: Use "limit" option in foreach. + +2006-04-20 Martin Hunt <hunt@redhat.com> + + * small_demos/top.stp: Use printf. + +2006-03-30 Martin Hunt <hunt@redhat.com> + + * small_demos/close.stp: Make it executable. + +2006-03-09 Martin Hunt <hunt@redhat.com> + + * key.stp: Toy example. + * prof.stp: Example profiler. + * top.stp: Print the top 20 syscalls. + 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 } |