~ubuntu-branches/ubuntu/quantal/gclcvs/quantal

« back to all changes in this revision

Viewing changes to doc/profile

  • Committer: Bazaar Package Importer
  • Author(s): Camm Maguire
  • Date: 2004-06-24 15:13:46 UTC
  • Revision ID: james.westby@ubuntu.com-20040624151346-xh0xaaktyyp7aorc
Tags: 2.7.0-26
C_GC_OFFSET is 2 on m68k-linux

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 
 
2
We have added a facility for determining the proportional amount of
 
3
time spent executing compiled lisp defined functions, as well as
 
4
internal c defined functions.
 
5
 
 
6
This system works under Unix BSD or System V.
 
7
 
 
8
To use this code load the file lsp/profile.o.
 
9
 
 
10
SET-UP-PROFILE &optional (array-size 100000)(max-funs 6000)
 
11
 
 
12
 
 
13
must be called to allocate space for storing the profile information
 
14
as it is collected, and also to build a list of the functions from
 
15
the symbol table of the executable (defaults to "saved_kcl").
 
16
 
 
17
Once this has been done a call to
 
18
 
 
19
PROF (start scale)
 
20
 
 
21
START will correspond to the beginning of the profile array, and
 
22
the SCALE will mean that 256 bytes of code correspond to SCALE bytes in the
 
23
profile array.
 
24
 
 
25
Thus if the profile array is 1,000,000  bytes long and the code segment is 
 
26
5 megabytes long you can profile the whole thing using a scale of 50
 
27
Note that long runs may result in overflow, and so an understating of the
 
28
time in a function.
 
29
 
 
30
With a scale of 128 a sample loop overflowed some slots at 6,000,000
 
31
times through the loop.
 
32
 
 
33
There is very little slowdown in execution during profiling.  No special
 
34
compilation is necessary.
 
35
 
 
36
To display the result do
 
37
 
 
38
(si::display-profile)
 
39
 
 
40
To turn off profiling use (si::prof 0 0).
 
41
 
 
42
(si::clear-profile)
 
43
clears the profile array for a new run.
 
44
 
 
45