summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
Diffstat (limited to 'examples')
-rw-r--r--examples/ChangeLog18
-rwxr-xr-xexamples/small_demos/top.stp6
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
}