~ chicken-core (chicken-5) 96c503a11fde5db6316dea578e3596b20e3da35b


commit 96c503a11fde5db6316dea578e3596b20e3da35b
Author:     Evan Hanson <evhan@foldling.org>
AuthorDate: Sat Jan 16 19:55:20 2016 +1300
Commit:     Evan Hanson <evhan@foldling.org>
CommitDate: Sat Jan 16 20:31:51 2016 +1300

    Add NEWS entry for the statistical profiler
    
    Also, clarify runtime argument documentation slightly.

diff --git a/NEWS b/NEWS
index 4336f0f0..188e06d4 100644
--- a/NEWS
+++ b/NEWS
@@ -59,6 +59,8 @@
 - Tools
   - A debugger is now available, known as "feathers", which allows
     basic source-level debugging of compiled Scheme code.
+  - A statistical profiler has been added, enabling sampling-based
+    runtime profiling of compiled programs.
 
 - Core libraries
   - Irregex has been updated to 0.9.4, which fixes severe performance
diff --git a/manual/Using the compiler b/manual/Using the compiler
index 137736cc..8655fb8f 100644
--- a/manual/Using the compiler	
+++ b/manual/Using the compiler	
@@ -226,7 +226,7 @@ compiler itself) accept a small set of runtime options:
 
 ; {{-:p}} : Enable collection of statistics for profiling purposes and write to PROFILE.{{pid}} on exit.  This functions at a granularity defined by the trace information in the binary and libraries: each traced function will show up in the output.  See the {{-profile}} compiler option for instrumentation-based profiling.  The {{PROFILE.pid}} format is compatible with the format generated by instrumentation-based profiling.
 
-; {{-:Pfreq}} : Same as {{-:p}} but set the sampling frequency in microseconds (default is 10000 microseconds or every 10 milliseconds).
+; {{-:PFREQUENCY}} : Same as {{-:p}} but set the sampling frequency in microseconds (default is 10000 microseconds or every 10 milliseconds).
 
 ; {{-:r}} : Writes trace output to stderr. This option has no effect with in files compiled with the {{-no-trace}} options.
 
@@ -238,13 +238,15 @@ compiler itself) accept a small set of runtime options:
 
 ; {{-:x}} : Raises uncaught exceptions of separately spawned threads in primordial thread. By default uncaught exceptions in separate threads are not handled, unless the primordial one explicitly joins them. When warnings are enabled (the default) and {{-:x}} is not given, a warning will be shown, though.
 
-The argument values may be given in bytes, in kilobytes (suffixed with
-{{K}} or {{k}}), in megabytes (suffixed with {{M}}
-or {{m}}), or in gigabytes (suffixed with {{G}}
-or {{g}}). Runtime options may be combined, like {{-:dc}},
-but everything following a {{NUMBER}} argument is ignored. So
-{{-:wh64m}} is OK, but {{-:h64mw}} will not enable GC of
-unused symbols.
+Runtime argument values should be given as integers, optionally followed
+by a unit modifier for kilobytes (suffixed with {{K}} or {{k}}),
+megabytes (suffixed with {{M}} or {{m}}), or gigabytes (suffixed with
+{{G}} or {{g}}).
+
+Runtime options may be combined, like {{-:dc}}, but everything following
+an argument is ignored. So {{-:wh64m}} is OK, but {{-:h64mw}} will not
+enable GC of unused symbols.
+
 === Examples
 
 ==== A simple example (with one source file)
diff --git a/runtime.c b/runtime.c
index b4ab27ed..c09f6c9e 100644
--- a/runtime.c
+++ b/runtime.c
@@ -1386,7 +1386,7 @@ void CHICKEN_parse_command_line(int argc, char *argv[], C_word *heap, C_word *st
 		 " -:hSIZE          set fixed heap size\n"
 		 " -:r              write trace output to stderr\n"
 		 " -:p              collect statistical profile and write to file at exit\n"
-		 " -:PFREQ          like -:p, specifying sampling frequency in us (default: 10000)\n"
+		 " -:PFREQUENCY     like -:p, specifying sampling frequency in us (default: 10000)\n"
 		 " -:sSIZE          set nursery (stack) size\n"
 		 " -:tSIZE          set symbol-table size\n"
                  " -:fSIZE          set maximal number of pending finalizers\n"
Trap