From 83c370cb3bd238ac65ebd784446d8339d9971108 Mon Sep 17 00:00:00 2001 From: hunt Date: Wed, 10 Jan 2007 15:24:36 +0000 Subject: [PATCH] 2007-01-10 Martin Hunt * small_demos/top.stp: Use "limit" option in foreach. --- examples/ChangeLog | 18 ++++++++++++++++++ examples/small_demos/top.stp | 6 +----- 2 files changed, 19 insertions(+), 5 deletions(-) create mode 100644 examples/ChangeLog diff --git a/examples/ChangeLog b/examples/ChangeLog new file mode 100644 index 000000000..e31c2634b --- /dev/null +++ b/examples/ChangeLog @@ -0,0 +1,18 @@ +2007-01-10 Martin Hunt + + * small_demos/top.stp: Use "limit" option in foreach. + +2006-04-20 Martin Hunt + + * small_demos/top.stp: Use printf. + +2006-03-30 Martin Hunt + + * small_demos/close.stp: Make it executable. + +2006-03-09 Martin Hunt + + * 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 fa180dd58..ed6589076 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 } -- 2.43.5