0.8.13.6:
authorChristophe Rhodes <csr21@cam.ac.uk>
Tue, 27 Jul 2004 11:49:33 +0000 (11:49 +0000)
committerChristophe Rhodes <csr21@cam.ac.uk>
Tue, 27 Jul 2004 11:49:33 +0000 (11:49 +0000)
Merge disassembly integration in sb-sprof (Juho Snellman
26-07-2004 sbcl-devel)
... deeply cute.

CREDITS
contrib/sb-sprof/sb-sprof.lisp
contrib/sb-sprof/sb-sprof.texinfo
version.lisp-expr

diff --git a/CREDITS b/CREDITS
index cef5117..0a2fc39 100644 (file)
--- a/CREDITS
+++ b/CREDITS
@@ -549,7 +549,9 @@ Paul Dietz:
   analysis phase in the compiler.
 
 Brian Downing:
-  He fixed the linker problems for building SBCL on Mac OS X.
+  He fixed the linker problems for building SBCL on Mac OS X.  He
+  found and fixed the cause of backtraces failing for undefined
+  functions and assembly routines.
 
 Miles Egan:
   He creates binary packages of SBCL releases for Red Hat and other
@@ -673,7 +675,9 @@ Nikodemus Siivola:
 
 Juho Snellman:
   He provided several performance enhancements, including a better hash
-  function on strings, and removal of unneccessary bounds checks.
+  function on strings, and removal of unneccessary bounds checks.  He
+  ported and enhanced the statistical profiler written by Gerd
+  Moellmann for CMU CL.
 
 Brian Spilsbury:
   He wrote Unicode-capable versions of SBCL's character, string, and
index 4fa612b..d638443 100644 (file)
@@ -84,9 +84,6 @@
 ;;;
 ;;; Random ideas for implementation: 
 ;;;
-;;; * Show a disassembly of a function annotated with sampling
-;;; information.
-;;;
 ;;; * Space profiler.  Sample when new pages are allocated instead of
 ;;; at SIGPROF.
 ;;;
       ((nil)))
     graph))
 
+;;; Interface to DISASSEMBLE
+
+(defun add-disassembly-profile-note (chunk stream dstate)
+  (declare (ignore chunk stream))
+  (unless (zerop *samples-index*)
+    (let* ((location
+           (+ (sb-disassem::seg-virtual-location
+               (sb-disassem:dstate-segment dstate))
+              (sb-disassem::dstate-cur-offs dstate)))
+          (samples (loop for x from 0 below *samples-index* by +sample-size+
+                         summing (if (= (aref *samples* x) location)
+                                     1
+                                     0))))
+      (unless (zerop samples)
+       (sb-disassem::note (format nil "~A/~A samples"
+                                  samples (/ *samples-index* +sample-size+))
+                          dstate)))))
+
+(pushnew 'add-disassembly-profile-note sb-disassem::*default-dstate-hooks*)
+
 ;;; silly examples
 
 (defun test-0 (n &optional (depth 0))
index 3031d82..063514a 100644 (file)
@@ -30,6 +30,11 @@ and the deficiency on the Alpha will eventually be rectified.
 (sb-sprof:report)
 @end lisp
 
+The profiler hooks into the disassembler such that instructions which
+have been sampled are annotated with their relative frequency of
+sampling.  This information is not stored across different sampling
+runs. @c FIXME: maybe it should be?
+
 @subsection Functions
 
 @include fun-sb-sprof-report.texinfo
@@ -52,5 +57,5 @@ and the deficiency on the Alpha will eventually be rectified.
    
 @subsection Credits
 
-@code{sb-sprof} is an SBCL port of Gerd Moellmann's statistical profiler
-for CMUCL.
+@code{sb-sprof} is an SBCL port, with enhancements, of Gerd
+Moellmann's statistical profiler for CMUCL.
index df5aec8..03dc130 100644 (file)
@@ -17,4 +17,4 @@
 ;;; checkins which aren't released. (And occasionally for internal
 ;;; versions, especially for internal versions off the main CVS
 ;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".)
-"0.8.13.5"
+"0.8.13.6"