From: Christophe Rhodes Date: Tue, 27 Jul 2004 11:49:33 +0000 (+0000) Subject: 0.8.13.6: X-Git-Url: http://repo.macrolet.net/gitweb/?a=commitdiff_plain;h=6a1dcd75ab524a0a3239e1f660a463f384aef33b;p=sbcl.git 0.8.13.6: Merge disassembly integration in sb-sprof (Juho Snellman 26-07-2004 sbcl-devel) ... deeply cute. --- diff --git a/CREDITS b/CREDITS index cef5117..0a2fc39 100644 --- 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 diff --git a/contrib/sb-sprof/sb-sprof.lisp b/contrib/sb-sprof/sb-sprof.lisp index 4fa612b..d638443 100644 --- a/contrib/sb-sprof/sb-sprof.lisp +++ b/contrib/sb-sprof/sb-sprof.lisp @@ -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. ;;; @@ -1123,6 +1120,26 @@ ((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)) diff --git a/contrib/sb-sprof/sb-sprof.texinfo b/contrib/sb-sprof/sb-sprof.texinfo index 3031d82..063514a 100644 --- a/contrib/sb-sprof/sb-sprof.texinfo +++ b/contrib/sb-sprof/sb-sprof.texinfo @@ -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. diff --git a/version.lisp-expr b/version.lisp-expr index df5aec8..03dc130 100644 --- a/version.lisp-expr +++ b/version.lisp-expr @@ -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"