|
|
1.1 root 1: #ifndef lint
2: static char *rcsid =
3: "$Header: /na/franz/franz/RCS/lamp.c,v 1.2 83/03/23 22:17:52 jkf Exp $";
4: #endif
5:
6: /* -[Tue Mar 22 15:17:09 1983 by jkf]-
7: * lamp.c $Locker: $
8: * interface with unix profiling
9: *
10: * (c) copyright 1982, Regents of the University of California
11: */
12:
13: #include "global.h"
14:
15: #ifdef PROF
16:
17: #define PBUFSZ 500000
18: short pbuf[PBUFSZ];
19:
20: /* data space for fasl to put counters */
21: int mcounts[NMCOUNT];
22: int mcountp = (int) mcounts;
23: int doprof = TRUE;
24:
25: lispval
26: Lmonitor()
27: {
28: extern etext, countbase;
29:
30: if (np==lbot) { monitor((int(*)())0); countbase = 0; }
31: else if (TYPE(lbot->val)==INT)
32: { monitor((int (*)())2, (int (*)())lbot->val->i, pbuf,
33: PBUFSZ*(sizeof(short)), 7000);
34: countbase = ((int)pbuf) +12;
35: }
36: else {
37: monitor((int (*)())2, (int (*)())sbrk(0), pbuf,
38: PBUFSZ*(sizeof(short)), 7000);
39: countbase = ((int)pbuf) + 12; }
40: return(tatom);
41: }
42:
43:
44: #else
45:
46: /* if prof is not defined, create a dummy Lmonitor */
47:
48: short pbuf[8];
49:
50: /* data space for fasl to put counters */
51: int mcounts[1];
52: int mcountp = (int) mcounts;
53: int doprof = FALSE;
54:
55: Lmonitor()
56: {
57: error("Profiling not enabled",FALSE);
58: }
59:
60:
61: #endif
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.