sb-sprof fails with :loop T
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
SBCL |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
===== Description =====
I try to use the statistical profiler with :loop T (to get sufficient samples). This results in an error unless I first run the statistical profiler without :loop T.
===== Repeatable test case =====
Below are 2 testfiles based on the manual's examples. Loading the first gives an error, loading the second returns profiles as expected. The output is shown after the files' contents.
-------
(in-package :cl-user)
(require :sb-sprof)
(declaim (optimize speed))
(defun cpu-test-inner (a i)
(logxor a (* i 5) (+ a i)))
(defun cpu-test (n)
(let ((a 0))
(dotimes (i (expt 2 n) a)
(setf a (cpu-test-inner a i)))))
(sb-sprof:
(cpu-test 26))
-------
-------
(in-package :cl-user)
(require :sb-sprof)
(declaim (optimize speed))
(defun cpu-test-inner (a i)
(logxor a (* i 5) (+ a i)))
(defun cpu-test (n)
(let ((a 0))
(dotimes (i (expt 2 n) a)
(setf a (cpu-test-inner a i)))))
(sb-sprof:
(cpu-test 26))
(sb-sprof:
(cpu-test 26))
-------
$ sbcl --load sprof1.lisp
This is SBCL 1.1.17, an implementation of ANSI Common Lisp.
More information about SBCL is available at <http://
SBCL is free software, provided as is, with absolutely no warranty.
It is mostly in the public domain; some portions are provided under
BSD-style licenses. See the CREDITS and COPYING files in the
distribution for more information.
debugger invoked on a TYPE-ERROR in thread
#<THREAD "main thread" RUNNING {1002D45473}>:
The value NIL is not of type SB-SPROF::SAMPLES.
Type HELP for debugger help, or (SB-EXT:EXIT) to exit from SBCL.
restarts (invokable by number or by possibly-
0: [RETRY ] Retry EVAL of current toplevel form.
1: [CONTINUE] Ignore error and continue loading file "/Users/
2: [ABORT ] Abort loading file "/Users/
3: Ignore runtime option --load "sprof1.lisp".
4: Skip rest of --eval and --load options.
5: Skip to toplevel READ/EVAL/PRINT loop.
6: [EXIT ] Exit SBCL (calling #'EXIT, killing the process).
((DEFMACRO SB-SPROF:
0]
$ sbcl --load sprof2.lisp
This is SBCL 1.1.17, an implementation of ANSI Common Lisp.
More information about SBCL is available at <http://
SBCL is free software, provided as is, with absolutely no warranty.
It is mostly in the public domain; some portions are provided under
BSD-style licenses. See the CREDITS and COPYING files in the
distribution for more information.
Number of samples: 61
Sample interval: 0.01 seconds
Total sampling time: 0.61 seconds
Number of cycles: 0
Sampled threads:
#<SB-THREAD:THREAD "main thread" RUNNING {1002D45473}>
Self Total Cumul
Nr Count % Count % Count % Calls Function
-------
1 21 34.4 57 93.4 21 34.4 - CPU-TEST
2 19 31.1 27 44.3 40 65.6 - CPU-TEST-INNER
3 13 21.3 13 21.3 53 86.9 - SB-VM::GENERIC-+
4 8 13.1 8 13.1 61 100.0 - SB-KERNEL:
5 0 0.0 61 100.0 61 100.0 - (LAMBDA NIL :IN "/Users/
6 0 0.0 61 100.0 61 100.0 - SB-INT:
7 0 0.0 61 100.0 61 100.0 - EVAL-TLF
8 0 0.0 61 100.0 61 100.0 - (FLET SB-FASL::EVAL-FORM :IN SB-INT:
9 0 0.0 61 100.0 61 100.0 - SB-INT:
10 0 0.0 61 100.0 61 100.0 - (FLET SB-FASL:
11 0 0.0 61 100.0 61 100.0 - LOAD
12 0 0.0 61 100.0 61 100.0 - SB-IMPL:
13 0 0.0 61 100.0 61 100.0 - SB-IMPL:
14 0 0.0 61 100.0 61 100.0 - (FLET #:WITHOUT-
15 0 0.0 61 100.0 61 100.0 - (LABELS SB-IMPL:
-------
0 0.0 elsewhere
Profiler sample vector full (723 traces / 10000 samples), doubling the size
Number of samples: 1000
Sample interval: 0.01 seconds
Total sampling time: 10.0 seconds
Number of cycles: 0
Sampled threads:
#<SB-THREAD:THREAD "main thread" RUNNING {1002D45473}>
Self Total Cumul
Nr Count % Count % Count % Calls Function
-------
1 298 29.8 933 93.3 298 29.8 - CPU-TEST
2 291 29.1 485 48.5 589 58.9 - CPU-TEST-INNER
3 212 21.2 212 21.2 801 80.1 - SB-VM::GENERIC-+
4 199 19.9 199 19.9 1000 100.0 - SB-KERNEL:
5 0 0.0 1000 100.0 1000 100.0 - (LAMBDA NIL :IN "/Users/
6 0 0.0 1000 100.0 1000 100.0 - SB-INT:
7 0 0.0 1000 100.0 1000 100.0 - EVAL-TLF
8 0 0.0 1000 100.0 1000 100.0 - (FLET SB-FASL::EVAL-FORM :IN SB-INT:
9 0 0.0 1000 100.0 1000 100.0 - SB-INT:
10 0 0.0 1000 100.0 1000 100.0 - (FLET SB-FASL:
11 0 0.0 1000 100.0 1000 100.0 - LOAD
12 0 0.0 1000 100.0 1000 100.0 - SB-IMPL:
13 0 0.0 1000 100.0 1000 100.0 - SB-IMPL:
14 0 0.0 1000 100.0 1000 100.0 - (FLET #:WITHOUT-
15 0 0.0 1000 100.0 1000 100.0 - (LABELS SB-IMPL:
-------
0 0.0 elsewhere
*
===== Version =====
SBCL 1.1.17
===== uname -a =====
Darwin 178-119-
===== *FEATURES* =====
(:QUICKLISP :ASDF3 :ASDF2 :ASDF :OS-UNIX :NON-BASE-
:ALIEN-CALLBACKS :ANSI-CL :ASH-RIGHT-VOPS :BSD :C-STACK-
:COMMON-LISP :COMPARE-
:DARWIN :DARWIN9-OR-BETTER :FLOAT-EQL-VOPS :GENCGC :IEEE-FLOATING-
:INLINE-CONSTANTS :INODE64 :LINKAGE-TABLE :LITTLE-ENDIAN
:MACH-
:OS-PROVIDES-
:OS-PROVIDES-PUTWC :OS-PROVIDES-
:RAW-INSTANCE-
:SB-PACKAGE-LOCKS :SB-SIMD-PACK :SB-SOURCE-
:SB-UNICODE :SBCL :STACK-
:STACK-
:STACK-
:UNWIND-
description: | updated |
tags: | added: profile sb-sprof |
tags: | removed: profile |
Changed in sbcl: | |
status: | New → Fix Released |
The bug still exists in SBCL 1.2.0.