Skip to content

Commit

Permalink
0.8.13.6:
Browse files Browse the repository at this point in the history
	Merge disassembly integration in sb-sprof (Juho Snellman
	26-07-2004 sbcl-devel)
	... deeply cute.
  • Loading branch information
csrhodes committed Jul 27, 2004
1 parent a87f7ec commit 6a1dcd7
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 8 deletions.
8 changes: 6 additions & 2 deletions CREDITS
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
23 changes: 20 additions & 3 deletions contrib/sb-sprof/sb-sprof.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -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.
;;;
Expand Down Expand Up @@ -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))
Expand Down
9 changes: 7 additions & 2 deletions contrib/sb-sprof/sb-sprof.texinfo
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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.
2 changes: 1 addition & 1 deletion version.lisp-expr
Original file line number Diff line number Diff line change
Expand Up @@ -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"

0 comments on commit 6a1dcd7

Please sign in to comment.