From 2639ed35b398060e16d2b7e64eda58bab691cc8b Mon Sep 17 00:00:00 2001 From: Nikodemus Siivola Date: Tue, 15 Jan 2008 18:25:55 +0000 Subject: [PATCH] 1.0.13.41: SB-SPROF:REPORT when there are no samples * Used to signal an error -- report lack of samples, and return NIL instead. Reported by Andy Hefner on sbcl-devel 2008-01-06. --- NEWS | 2 ++ contrib/sb-sprof/sb-sprof.lisp | 25 +++++++++++++++---------- version.lisp-expr | 2 +- 3 files changed, 18 insertions(+), 11 deletions(-) diff --git a/NEWS b/NEWS index 74b5bbd..4c7081b 100644 --- a/NEWS +++ b/NEWS @@ -3,6 +3,8 @@ changes in sbcl-1.0.14 relative to sbcl-1.0.13: * new feature: SB-EXT:*EXIT-HOOKS* are called when the process exits (see documentation for details.) * revived support for OpenBSD (contributed by Josh Elsasser) + * bug fix: SB-SPROF:REPORT no longer signals an error if there are + no samples. (reported by Andy Hefner) * bug fix: functions compiled using (COMPILE NIL '(LAMBDA ...)) no longer appear as (NIL ...) frames in backtraces. * bug fix: ROOM no longer suffers from occasional (AVER (SAP= diff --git a/contrib/sb-sprof/sb-sprof.lisp b/contrib/sb-sprof/sb-sprof.lisp index ff0f4b9..73b6a5b 100644 --- a/contrib/sb-sprof/sb-sprof.lisp +++ b/contrib/sb-sprof/sb-sprof.lisp @@ -1083,16 +1083,21 @@ e Print a report from instead of the latest profiling results. - Value of this function is a CALL-GRAPH object representing the - resulting call-graph." - (let ((graph (or call-graph (make-call-graph most-positive-fixnum)))) - (ecase type - (:flat - (print-flat graph :stream stream :max max :min-percent min-percent)) - (:graph - (print-graph graph :stream stream :max max :min-percent min-percent)) - ((nil))) - graph)) +Value of this function is a CALL-GRAPH object representing the +resulting call-graph, or NIL if there are no samples (eg. right after +calling RESET.)" + (cond (*samples* + (let ((graph (or call-graph (make-call-graph most-positive-fixnum)))) + (ecase type + (:flat + (print-flat graph :stream stream :max max :min-percent min-percent)) + (:graph + (print-graph graph :stream stream :max max :min-percent min-percent)) + ((nil))) + graph)) + (t + (format stream "~&; No samples to report.~%") + nil))) ;;; Interface to DISASSEMBLE diff --git a/version.lisp-expr b/version.lisp-expr index a731868..84df7f1 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".) -"1.0.13.40" +"1.0.13.41" -- 1.7.10.4