|
|
1.1 root 1: /*
2: * Called from the run-time start-off to enable profiling and to
3: * write out the final profiling information.
4: */
5: #include <stdio.h>
6: #include <sys/types.h>
7:
8:
9: #define STDERR 2
10:
11:
12: _profon()
13: {
14: #ifndef Z8001
15: register unsigned bufl;
16: register short *buf;
17: extern etext();
18: static char emsg[] = "No room for profil buffer\n";
19:
20: bufl = (unsigned)etext / 2;
21: buf = (short *)sbrk(bufl * sizeof (short));
22: if (buf == NULL) {
23: write(STDERR, emsg, sizeof emsg);
24: abort();
25: }
26: monitor((vaddr_t)1, (vaddr_t)etext, buf, bufl);
27: #else
28: monitor((vaddr_t)1); /* dummy call to start things off */
29: #endif
30: }
31:
32:
33: _profoff()
34: {
35: monitor(NULL);
36: }
37:
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.