
6.5 PC logging
Syntax:summarize-pc-logging data-file-name&key :stream
:stream specifies a stream to which summary output should be written. As a default, the system writes the output to the stream that is the value of*terminal-io*.
summarize-pc-logging terminates it before outputting the summary.
;;; Perfect numbers are equal to the sum of their
;;; proper divisors; i.e., 6 is a perfect number since the
;;; proper divisors of 6 are 1, 2, and 3, and 1 + 2 + 3 = 6.
> (defun find-next-perfect-number (start-number)
(let ((try-number start-number))
(loop
(incf try-number)
(let ((sum 1))
(catch 'sum-too-large
(do ((possible-divisor 2 (1+ possible-divisor)))
((> possible-divisor (floor try-number 2)))
(when (zerop (mod try-number possible-divisor))
(incf sum possible-divisor)
(when (> sum try-number)
(throw 'sum-too-large nil))))
(when (= sum try-number)
(throw 'found-a-perfect-number try-number)))))))
FIND-NEXT-PERFECT-NUMBER
> (defun display-some-perfect-numbers (how-many)
;; Display HOW-MANY perfect numbers.
(loop for i from 1 to how-many
with current-perfect-number = 0
do (setq current-perfect-number
(catch 'found-a-perfect-number
(find-next-perfect-number current-
perfect-number)))
(print current-perfect-number)))
DISPLAY-SOME-PERFECT-NUMBERS
> (start-pc-logging "/u/ted/logfile")
T
> (display-some-perfect-numbers 4)
1
6
28
496
NIL
> (stop-pc-logging)
;;; Finding names for PC ranges...
;;; Reading "/u/ted/logfile"...
;;; Writing "/u/ted/logfile"...
;;; In the following report, the first column gives the number of
;;; "hit counters," the second column gives the percentage of the
;;; total time spent in that function, and the third column gives
;;; the percentage of the total time spent in all functions up to
;;; that point.
Total PC's sampled = 2766
Total PC's out-of-range = 0 (0.00%)
The Equivalence Classes are:
630 22.78% 22.78% #<Compiled-Function LIQUID::LRUN 1293FE>
388 14.03% 36.80% #<Compiled-Function NTH 45C906>
382 13.81% 50.61% #<Compiled-Function LIQUID::LRUN-FUNCALL
129496>
365 13.20% 63.81% #<Compiled-Function LIQUID::LRUN-GLOBAL-
FUNCTION-REF 129B06>
199 7.19% 71.01% LIQUID::SQ-COERCE-TO-PROCEDURE
117 4.23% 75.23% #<Compiled-Function LIQUID::LRUN-TAGBODY
12985E>
106 3.83% 79.07% #<Compiled-Function LIQUID::THROW-RETURN
-FUNCTION 122656>
102 3.69% 82.75% #<Compiled-Function LIQUID::LRUN-IF 1298A6>
90 3.25% 86.01% #<Compiled-Function LIQUID::LRUN-SEQUENCE
1297F6>
71 2.57% 88.58% #<Compiled-Function LIQUID::LRUN-LEXICAL-
VARIABLE-REF 129A46>
44 1.59% 90.17% #<Compiled-Function FLOOR 12D186>
36 1.30% 91.47% #<Compiled-Function SYMBOL-FUNCTION 452FAE>
30 1.08% 92.55% LIQUID::SQ-FLOOR&
24 0.87% 93.42% LIQUID::SQ-MOD&
21 0.76% 94.18% #<Compiled-Function LIQUID::LRUN-LEXICAL-
VARIABLE-SETQ 129A66>
18 0.65% 94.83% #<Compiled-Function LIQUID:SET-CURRENT-AREA
45A206>
18 0.65% 95.48% #<Compiled-Function LIQUID-RUNTIME-SUPPORT:
SET-NTH 45D16E>
13 0.47% 95.95% #<Compiled-Function LIQUID::LRUN-GO 129886>
13 0.47% 96.42% LIQUID::SQ-THROW
12 0.43% 96.85% #<Compiled-Function MOD 12D37E>
9 0.33% 97.18% #<Compiled-Function LIQUID::LRUN-CONSTANT
12947E>
8 0.29% 97.47% #<Compiled-Function > 12D8FE>
8 0.29% 97.76% #<Compiled-Function LIQUID::LRUN-LAMBDA-
FUNCALL 129586>
7 0.25% 98.01% LIQUID::SQ-DEALLOCATE-STACK-LISTS
5 0.18% 98.19% #<Compiled-Function LIQUID::LRUN-INSIDE-
SIMPLE-LAMBDA 129606>
4 0.14% 98.34% LIQUID::SQ-SET-POINTER-REF
3 0.11% 98.45% #<Compiled-Function LIQUID:%ZERO-REGION
45FADE>
3 0.11% 98.55% LIQUID::SQ-CONS
3 0.11% 98.66% #<Compiled-Function 1+ 12DAB6>
3 0.11% 98.77% #<Foreign-Pointer _write 627CE8>
2 0.07% 98.84% #<Compiled-Function LIQUID::%NOT 12107E>
#<Compiled-Function NULL 4546A6>
#<Compiled-Function NOT 452746>
2 0.07% 98.92% #<Compiled-Function TYPEP 124E6E>
2 0.07% 98.99% #<Compiled-Function STREAMP 2F901E>
2 0.07% 99.06% #<Foreign-Pointer _sigsetmask 627C38>
2 0.07% 99.13% #<Compiled-Function LIQUID::LRUN-BLOCK
129816>
2 0.07% 99.20% #<Compiled-Function ZEROP 12D77E>
1 0.04% 99.24% #<Compiled-Function LIQUID::PROCESS-WAIT-1
31D0BE>
1 0.04% 99.28% #<Compiled-Function LIQUID:DECF& 1280C6>
#<Compiled-Function LIQUID:INCF& 12808E>
#<Compiled-Function DECF 128056>
#<Compiled-Function INCF 12801E>
1 0.04% 99.31% #<Compiled-Function MEMBER 45D66E>
1 0.04% 99.35% #<Compiled-Function LIQUID::SWAP-STACK-
SPECIALS 14FFE6>
1 0.04% 99.39% LIQUID::SQ-REM&
1 0.04% 99.42% #<Compiled-Function LIQUID:%READ-BUFFER
45F73E>
1 0.04% 99.46% #<Compiled-Function LIQUID::BUFFER-
TERMINAL-OUTPUT 2F855E>
1 0.04% 99.49% LIQUID::SQ-APPLY-FASTCALL
1 0.04% 99.53% #<Compiled-Function LIQUID::LRUN-CATCH
12997E>
1 0.04% 99.57% #<Compiled-Function LIQUID::SIMPLE-BASE-
STRING-REPLACE-INTERNAL 123D96>
1 0.04% 99.60% #<Compiled-Function LIQUID::LRUN-INSIDE-
LAMBDA 1295B6>
1 0.04% 99.64% #<Compiled-Function SYSTEM:FILE-STREAM-P
2F93BE>
1 0.04% 99.67% #<Compiled-Function LIQUID::SETITIMER 31BD46>
1 0.04% 99.71% LIQUID::SQ-LIST-REST-FINISH
1 0.04% 99.75% #<Compiled-Function MACROEXPAND-1 128646>
1 0.04% 99.78% #<Compiled-Function LIQUID::GETHASH-FOR-ANY
45BAFE>
1 0.04% 99.82% #<Compiled-Function LIQUID::LCOMPILE 1288FE>
1 0.04% 99.86% #<Foreign-Pointer _select 64BAC8>
1 0.04% 99.89% #<Compiled-Function LIQUID::PARSE-HANDLER
12C1E6>
1 0.04% 99.93% LIQUID::SQ-DEINSTALL-FIXED-SPECIALS
1 0.04% 99.96% #<Compiled-Function LIQUID::INTERN-SIMPLE-
STRING 120BB6>
1 0.04% 100.00% #<Foreign-Pointer _OSI_WriteBuffer 60CECC>
>
start-pc-logging, stop-pc-logging
Syntax:start-pc-logging data-file&optional limit time-interval
t. The argument data-file is a simple string naming the file where you want the system to record the results of the logging session. The argument limit is a positive fixnum whose default value is 1000000. It is the maximum number of interrupts the system will take as it collects its samples. Finally, the argument timer-interval is the amount of time that the system will wait between interrupts. You express this number as a multiple of the smallest timer interval on your machine.
summarize-pc-logging.
stop-pc-logging, summarize-pc-logging
Syntax:stop-pc-logging
start-pc-logging. However, this file is not human-readable. To see the results of the PC-logging session, use summarize-pc-logging.
start-pc-logging, summarize-pc-logging

Generated with Harlequin WebMaker