BSD 4_4 development
authorCSRG <csrg@ucbvax.Berkeley.EDU>
Fri, 9 Dec 1983 09:51:54 +0000 (01:51 -0800)
committerCSRG <csrg@ucbvax.Berkeley.EDU>
Fri, 9 Dec 1983 09:51:54 +0000 (01:51 -0800)
Work on file usr/src/old/lisp/franz/lamp.c

Synthesized-from: CSRG/cd3/4.4

usr/src/old/lisp/franz/lamp.c [new file with mode: 0644]

diff --git a/usr/src/old/lisp/franz/lamp.c b/usr/src/old/lisp/franz/lamp.c
new file mode 100644 (file)
index 0000000..1b7c535
--- /dev/null
@@ -0,0 +1,61 @@
+#ifndef lint
+static char *rcsid =
+   "$Header: lamp.c,v 1.3 83/12/09 16:51:36 sklower Exp $";
+#endif
+
+/*                                     -[Tue Mar 22 15:17:09 1983 by jkf]-
+ *     lamp.c                          $Locker:  $
+ * interface with unix profiling
+ *
+ * (c) copyright 1982, Regents of the University of California
+ */
+
+#include "global.h"
+
+#ifdef PROF
+
+#define PBUFSZ 500000
+short pbuf[PBUFSZ];
+
+/* data space for fasl to put counters */
+int mcnts[NMCOUNT];
+int mcntp = (int) mcnts;
+int doprof = TRUE;
+
+lispval
+Lmonitor()
+{
+       extern etext, countbase;
+
+       if (np==lbot) { monitor((int(*)())0); countbase = 0; }
+       else if (TYPE(lbot->val)==INT) 
+        { monitor((int (*)())2, (int (*)())lbot->val->i, pbuf,
+                                       PBUFSZ*(sizeof(short)), 7000); 
+          countbase = ((int)pbuf) +12; 
+       }
+       else {
+          monitor((int (*)())2, (int (*)())sbrk(0), pbuf,
+                                       PBUFSZ*(sizeof(short)), 7000); 
+          countbase = ((int)pbuf) + 12; }
+       return(tatom);
+}
+
+
+#else
+
+/* if prof is not defined, create a dummy Lmonitor */
+
+short  pbuf[8];
+
+/* data space for fasl to put counters */
+int mcnts[1];
+int mcntp = (int) mcnts;
+int doprof = FALSE;
+
+Lmonitor()
+{
+       error("Profiling not enabled",FALSE);
+}
+
+
+#endif