aboutsummaryrefslogtreecommitdiffstats
path: root/mps/code
diff options
context:
space:
mode:
authorRichard Brooksby2012-08-21 16:29:19 +0100
committerRichard Brooksby2012-08-21 16:29:19 +0100
commitab85e6ff329c0237cbe3160f2e10b70ab9c0a182 (patch)
tree5bbbb9febce0131059907140f9b0cccb66d0ac01 /mps/code
parent39bdab4ca5d00570eb84613764f906244d361588 (diff)
downloademacs-ab85e6ff329c0237cbe3160f2e10b70ab9c0a182.tar.gz
emacs-ab85e6ff329c0237cbe3160f2e10b70ab9c0a182.zip
Replacing "relation" style event definition header with single higher-order macro that can be applied more flexibly.
Copied from Perforce Change: 178997 ServerID: perforce.ravenbrook.com
Diffstat (limited to 'mps/code')
-rw-r--r--mps/code/dumper.c14
-rw-r--r--mps/code/event.h7
-rw-r--r--mps/code/eventcnv.c18
-rw-r--r--mps/code/eventdef.h219
-rw-r--r--mps/code/eventgen.pl2
-rw-r--r--mps/code/eventpro.c6
6 files changed, 126 insertions, 140 deletions
diff --git a/mps/code/dumper.c b/mps/code/dumper.c
index 2c87a5d9b53..b34fd02fb99 100644
--- a/mps/code/dumper.c
+++ b/mps/code/dumper.c
@@ -21,6 +21,7 @@ typedef MPS_T_WORD Word;
21typedef struct AddrStruct *Addr; 21typedef struct AddrStruct *Addr;
22 22
23#include "eventcom.h" 23#include "eventcom.h"
24#include "eventdef.h"
24 25
25 26
26#ifdef MPS_PF_W3I6MV 27#ifdef MPS_PF_W3I6MV
@@ -34,12 +35,6 @@ typedef unsigned long ulongest_t;
34#endif 35#endif
35 36
36 37
37#define RELATION(type, code, always, kind, format) \
38 case Event ## type: \
39 readEvent(#type, #format, header[0], header[1], header[2]); \
40 break;
41
42
43#define AVER(test) \ 38#define AVER(test) \
44 if(test) do {} while(0); else error("AVER: " #test) 39 if(test) do {} while(0); else error("AVER: " #test)
45 40
@@ -141,7 +136,12 @@ int main(int argc, char *argv[]) {
141 } 136 }
142 137
143 switch(header[0]) { 138 switch(header[0]) {
144#include "eventdef.h" 139#define EVENT_CASE(X, type, code, always, kind, format) \
140 case Event ## type: \
141 readEvent(#type, #format, header[0], header[1], header[2]); \
142 break;
143 EVENT_LIST(EVENT_CASE, X)
144
145 default: 145 default:
146 error("Unknown event code %"PRIXPTR, (ulongest_t)header[0]); 146 error("Unknown event code %"PRIXPTR, (ulongest_t)header[0]);
147 } 147 }
diff --git a/mps/code/event.h b/mps/code/event.h
index a8bd82e3979..d2740e9d8b4 100644
--- a/mps/code/event.h
+++ b/mps/code/event.h
@@ -17,6 +17,7 @@
17 17
18#include "eventcom.h" 18#include "eventcom.h"
19#include "mpm.h" 19#include "mpm.h"
20#include "eventdef.h"
20 21
21 22
22extern Res EventSync(void); 23extern Res EventSync(void);
@@ -57,7 +58,7 @@ extern Res EventFlush(void);
57 */ 58 */
58 59
59/* Note that enum values can be up to fifteen bits long portably. */ 60/* Note that enum values can be up to fifteen bits long portably. */
60#define RELATION(type, code, always, kind, format) \ 61#define EVENT_ENUM(X, type, code, always, kind, format) \
61 enum { \ 62 enum { \
62 Event##type##High = ((code >> 8) & 0xFF), \ 63 Event##type##High = ((code >> 8) & 0xFF), \
63 Event##type##Low = (code & 0xFF), \ 64 Event##type##Low = (code & 0xFF), \
@@ -65,10 +66,8 @@ extern Res EventFlush(void);
65 Event##type##Kind = EventKind##kind, \ 66 Event##type##Kind = EventKind##kind, \
66 Event##type##Format = EventFormat##format \ 67 Event##type##Format = EventFormat##format \
67 }; 68 };
68
69#include "eventdef.h"
70 69
71#undef RELATION 70EVENT_LIST(EVENT_ENUM, X)
72 71
73 72
74/* Event writing support */ 73/* Event writing support */
diff --git a/mps/code/eventcnv.c b/mps/code/eventcnv.c
index 2b98b4b7e01..ca51cf9022b 100644
--- a/mps/code/eventcnv.c
+++ b/mps/code/eventcnv.c
@@ -8,6 +8,7 @@
8/* override variety setting for EVENT */ 8/* override variety setting for EVENT */
9#define EVENT 9#define EVENT
10 10
11#include "eventdef.h"
11#include "eventcom.h" 12#include "eventcom.h"
12#include "eventpro.h" 13#include "eventpro.h"
13#include "mpmtypes.h" 14#include "mpmtypes.h"
@@ -367,13 +368,6 @@ static void printArg(EventProc proc,
367} 368}
368 369
369 370
370#define RELATION(name, code, always, kind, format) \
371 case code: { \
372 printArg(proc, EVENT_##format##_FIELD_PTR(event, i), \
373 eventFormat[i], styleConv); \
374 } break;
375
376
377static void readLog(EventProc proc) 371static void readLog(EventProc proc)
378{ 372{
379 EventCode c; 373 EventCode c;
@@ -535,8 +529,12 @@ static void readLog(EventProc proc)
535 default: 529 default:
536 for (i = 0; i < argCount; ++i) { 530 for (i = 0; i < argCount; ++i) {
537 switch(code) { 531 switch(code) {
538#include "eventdef.h" 532#define EVENT_CASE(X, name, code, always, kind, format) \
539#undef RELATION 533 case code: { \
534 printArg(proc, EVENT_##format##_FIELD_PTR(event, i), \
535 eventFormat[i], styleConv); \
536 } break;
537 EVENT_LIST(EVENT_CASE, X)
540 } 538 }
541 } 539 }
542 } 540 }
@@ -615,7 +613,7 @@ int main(int argc, char *argv[])
615 assert(CHECKCONV(ulongest_t, Word)); 613 assert(CHECKCONV(ulongest_t, Word));
616 assert(CHECKCONV(ulongest_t, Addr)); 614 assert(CHECKCONV(ulongest_t, Addr));
617 assert(CHECKCONV(ulongest_t, void *)); 615 assert(CHECKCONV(ulongest_t, void *));
618 assert(CHECKCONV(unsigned, EventCode)); 616 assert(CHECKCONV(ulongest_t, EventCode));
619 assert(CHECKCONV(Addr, void *)); /* for labelled pointers */ 617 assert(CHECKCONV(Addr, void *)); /* for labelled pointers */
620#endif 618#endif
621 619
diff --git a/mps/code/eventdef.h b/mps/code/eventdef.h
index c8c1d41495d..a9903e5dbea 100644
--- a/mps/code/eventdef.h
+++ b/mps/code/eventdef.h
@@ -11,12 +11,6 @@
11 * 11 *
12 * TRANSGRESSIONS 12 * TRANSGRESSIONS
13 * 13 *
14 * .trans.nocppguard: This file has no #ifdef guard around the entire file.
15 * This is so that the file can be included multiple times. This is
16 * useful because each inclusion can use a different definition of
17 * RELATION. However this may be slightly shot by having the version
18 * defined here.
19 *
20 * .kind.abuse: A few events have a kind which is not obvious from the 14 * .kind.abuse: A few events have a kind which is not obvious from the
21 * type of the objects that the event relates to. They are given the 15 * type of the objects that the event relates to. They are given the
22 * kind that that have on the grounds of expected use. The kinds are 16 * kind that that have on the grounds of expected use. The kinds are
@@ -28,7 +22,8 @@
28 * amount of data). 22 * amount of data).
29 */ 23 */
30 24
31/* No #ifndef eventdef_h, see .trans.nocppguard. */ 25#ifndef eventdef_h
26#define eventdef_h
32 27
33 28
34/* EVENT_VERSION_* -- three part version number 29/* EVENT_VERSION_* -- three part version number
@@ -57,119 +52,113 @@
57 * parameters, similar to writef (Pointer, Addr, Word, Unsigned, 52 * parameters, similar to writef (Pointer, Addr, Word, Unsigned,
58 * String, Double). 53 * String, Double).
59 */ 54 */
55
56/* FIXME: Work out why not-in-use events were not in use and restore or delete them. */
60 57
61RELATION(AMCGenCreate , 0x0001, TRUE, Pool, PP) 58#define EVENT_LIST(EVENT, X) \
62RELATION(AMCGenDestroy , 0x0002, TRUE, Pool, P) 59 EVENT(X, AMCGenCreate , 0x0001, TRUE, Pool, PP) \
63RELATION(AMCInit , 0x0003, TRUE, Pool, PP) 60 EVENT(X, AMCGenDestroy , 0x0002, TRUE, Pool, P) \
64RELATION(AMCFinish , 0x0004, TRUE, Pool, P) 61 EVENT(X, AMCInit , 0x0003, TRUE, Pool, PP) \
65RELATION(ArenaCreateVM , 0x0005, TRUE, Arena, PWW) 62 EVENT(X, AMCFinish , 0x0004, TRUE, Pool, P) \
66RELATION(ArenaCreateVMNZ , 0x0006, TRUE, Arena, PWW) 63 EVENT(X, ArenaCreateVM , 0x0005, TRUE, Arena, PWW) \
67RELATION(ArenaWriteFaults , 0x0007, TRUE, Trace, PW) 64 EVENT(X, ArenaCreateVMNZ , 0x0006, TRUE, Arena, PWW) \
68RELATION(MeterInit , 0x0008, TRUE, Pool, PP) 65 EVENT(X, ArenaWriteFaults , 0x0007, TRUE, Trace, PW) \
69RELATION(MeterValues , 0x0009, TRUE, Pool, PDDWWW) 66 EVENT(X, MeterInit , 0x0008, TRUE, Pool, PP) \
70RELATION(AMCScanBegin , 0x000a, TRUE, Seg, PPP) 67 EVENT(X, MeterValues , 0x0009, TRUE, Pool, PDDWWW) \
71RELATION(AMCScanEnd , 0x000b, TRUE, Seg, PPP) 68 EVENT(X, AMCScanBegin , 0x000a, TRUE, Seg, PPP) \
72RELATION(AMCFix , 0x000c, TRUE, Ref, 0) 69 EVENT(X, AMCScanEnd , 0x000b, TRUE, Seg, PPP) \
73RELATION(AMCFixInPlace , 0x000d, TRUE, Ref, 0) 70 EVENT(X, AMCFix , 0x000c, TRUE, Ref, 0) \
74RELATION(AMCFixForward , 0x000e, TRUE, Ref, A) 71 EVENT(X, AMCFixInPlace , 0x000d, TRUE, Ref, 0) \
75RELATION(AMCReclaim , 0x000f, TRUE, Seg, PPP) 72 EVENT(X, AMCFixForward , 0x000e, TRUE, Ref, A) \
76#if 0 /* Not in use */ 73 EVENT(X, AMCReclaim , 0x000f, TRUE, Seg, PPP) \
77RELATION(AMCTraceEnd , 0x0010, TRUE, Trace, PPP) 74 /* EVENT(X, AMCTraceEnd , 0x0010, TRUE, Trace, PPP) */ \
78#endif 75 EVENT(X, ArenaCreateCL , 0x0011, TRUE, Arena, PWA) \
79RELATION(ArenaCreateCL , 0x0011, TRUE, Arena, PWA) 76 EVENT(X, ArenaDestroy , 0x0012, TRUE, Arena, P) \
80RELATION(ArenaDestroy , 0x0012, TRUE, Arena, P) 77 EVENT(X, SegAlloc , 0x0013, TRUE, Seg, PPAWP) \
81RELATION(SegAlloc , 0x0013, TRUE, Seg, PPAWP) 78 EVENT(X, SegFree , 0x0014, TRUE, Seg, PP) \
82RELATION(SegFree , 0x0014, TRUE, Seg, PP) 79 EVENT(X, PoolInit , 0x0015, TRUE, Pool, PPP) \
83RELATION(PoolInit , 0x0015, TRUE, Pool, PPP) 80 EVENT(X, PoolFinish , 0x0016, TRUE, Pool, P) \
84RELATION(PoolFinish , 0x0016, TRUE, Pool, P) 81 EVENT(X, PoolAlloc , 0x0017, TRUE, Object, PAW) \
85RELATION(PoolAlloc , 0x0017, TRUE, Object, PAW) 82 EVENT(X, PoolFree , 0x0018, TRUE, Object, PAW) \
86RELATION(PoolFree , 0x0018, TRUE, Object, PAW) 83 EVENT(X, CBSInit , 0x0019, TRUE, Pool, PP) \
87RELATION(CBSInit , 0x0019, TRUE, Pool, PP) 84 EVENT(X, Intern , 0x001a, TRUE, User, WS) \
88RELATION(Intern , 0x001a, TRUE, User, WS) 85 EVENT(X, Label , 0x001b, TRUE, User, AW) \
89RELATION(Label , 0x001b, TRUE, User, AW) 86 EVENT(X, TraceStart , 0x001c, TRUE, Trace, PPP) \
90RELATION(TraceStart , 0x001c, TRUE, Trace, PPP) 87 EVENT(X, TraceCreate , 0x001d, TRUE, Trace, PPPU) \
91#if 0 /* Not in use */ 88 EVENT(X, TraceDestroy , 0x001e, TRUE, Trace, P) \
92RELATION(TraceCreate , 0x001d, TRUE, Trace, PPPU) 89 EVENT(X, SegSetGrey , 0x001f, TRUE, Seg, PPU) \
93#endif 90 EVENT(X, TraceFlipBegin , 0x0020, TRUE, Trace, PP) \
94RELATION(TraceDestroy , 0x001e, TRUE, Trace, P) 91 EVENT(X, TraceFlipEnd , 0x0021, TRUE, Trace, PP) \
95RELATION(SegSetGrey , 0x001f, TRUE, Seg, PPU) 92 EVENT(X, TraceReclaim , 0x0022, TRUE, Seg, P) \
96RELATION(TraceFlipBegin , 0x0020, TRUE, Trace, PP) 93 /* EVENT(X, TraceScan , 0x0023, TRUE, Seg, UUPPP) */ \
97RELATION(TraceFlipEnd , 0x0021, TRUE, Trace, PP) 94 EVENT(X, TraceAccess , 0x0024, TRUE, Seg, PPU) \
98RELATION(TraceReclaim , 0x0022, TRUE, Seg, P) 95 /* TracePoll's kind isn't really Trace, but then it isn't Seg either */ \
99#if 0 /* not in use */ 96 EVENT(X, TracePoll , 0x0025, TRUE, Trace, PP) \
100RELATION(TraceScan , 0x0023, TRUE, Seg, UUPPP) 97 EVENT(X, TraceFix , 0x0026, TRUE, Ref, PPAU) \
101#endif 98 EVENT(X, TraceFixSeg , 0x0027, TRUE, Ref, P) \
102RELATION(TraceAccess , 0x0024, TRUE, Seg, PPU) 99 EVENT(X, TraceFixWhite , 0x0028, TRUE, Ref, 0) \
103/* TracePoll's kind isn't really Trace, but then it isn't Seg either */ 100 /* TraceScanArea{Tagged} abuses kind, see .kind.abuse */ \
104RELATION(TracePoll , 0x0025, TRUE, Trace, PP) 101 EVENT(X, TraceScanArea , 0x0029, TRUE, Seg, PPP) \
105RELATION(TraceFix , 0x0026, TRUE, Ref, PPAU) 102 EVENT(X, TraceScanAreaTagged , 0x002a, TRUE, Seg, PPP) \
106RELATION(TraceFixSeg , 0x0027, TRUE, Ref, P) 103 EVENT(X, VMCreate , 0x002b, TRUE, Arena, PAA) \
107RELATION(TraceFixWhite , 0x0028, TRUE, Ref, 0) 104 EVENT(X, VMDestroy , 0x002c, TRUE, Arena, P) \
108/* TraceScanArea{Tagged} abuses kind, see .kind.abuse */ 105 EVENT(X, VMMap , 0x002d, TRUE, Seg, PAA) \
109RELATION(TraceScanArea , 0x0029, TRUE, Seg, PPP) 106 EVENT(X, VMUnmap , 0x002e, TRUE, Seg, PAA) \
110RELATION(TraceScanAreaTagged , 0x002a, TRUE, Seg, PPP) 107 EVENT(X, ArenaExtend , 0x002f, TRUE, Arena, PAW) \
111RELATION(VMCreate , 0x002b, TRUE, Arena, PAA) 108 EVENT(X, ArenaRetract , 0x0030, TRUE, Arena, PAW) \
112RELATION(VMDestroy , 0x002c, TRUE, Arena, P) 109 EVENT(X, TraceSegGreyen , 0x0031, TRUE, Seg, PPU) \
113RELATION(VMMap , 0x002d, TRUE, Seg, PAA) 110 /* RootScanned abuses kind, see .kind.abuse */ \
114RELATION(VMUnmap , 0x002e, TRUE, Seg, PAA) 111 EVENT(X, RootScan , 0x0032, TRUE, Seg, PWW) \
115RELATION(ArenaExtend , 0x002f, TRUE, Arena, PAW) 112 /* TraceStep abuses kind, see .kind.abuse */ \
116RELATION(ArenaRetract , 0x0030, TRUE, Arena, PAW) 113 EVENT(X, TraceStep , 0x0033, TRUE, Seg, PP) \
117RELATION(TraceSegGreyen , 0x0031, TRUE, Seg, PPU) 114 EVENT(X, BufferReserve , 0x0034, TRUE, Object, PAW) \
118/* RootScanned abuses kind, see .kind.abuse */ 115 EVENT(X, BufferCommit , 0x0035, TRUE, Object, PAWA) \
119RELATION(RootScan , 0x0032, TRUE, Seg, PWW) 116 /* BufferInit/Finish abuse kind, see .kind.abuse */ \
120/* TraceStep abuses kind, see .kind.abuse */ 117 EVENT(X, BufferInit , 0x0036, TRUE, Pool, PPU) \
121RELATION(TraceStep , 0x0033, TRUE, Seg, PP) 118 EVENT(X, BufferFinish , 0x0037, TRUE, Pool, P) \
122RELATION(BufferReserve , 0x0034, TRUE, Object, PAW) 119 /* EVENT(X, MVTFinish , 0x0038, TRUE, Pool, P) */ \
123RELATION(BufferCommit , 0x0035, TRUE, Object, PAWA) 120 EVENT(X, BufferFill , 0x0039, TRUE, Seg, PWAW) \
124/* BufferInit/Finish abuse kind, see .kind.abuse */ 121 EVENT(X, BufferEmpty , 0x003A, TRUE, Seg, PW) \
125RELATION(BufferInit , 0x0036, TRUE, Pool, PPU) 122 EVENT(X, SegAllocFail , 0x003B, TRUE, Seg, PWP) \
126RELATION(BufferFinish , 0x0037, TRUE, Pool, P) 123 EVENT(X, TraceScanSeg , 0x003C, TRUE, Seg, UUPP) \
127#if 0 /* not in use */ 124 /* TraceScanSingleRef abuses kind, see .kind.abuse */ \
128RELATION(MVTFinish , 0x0038, TRUE, Pool, P) 125 EVENT(X, TraceScanSingleRef , 0x003D, TRUE, Seg, UUPA) \
129#endif 126 EVENT(X, TraceStatCondemn , 0x003E, TRUE, Trace, PWWWWDD) \
130RELATION(BufferFill , 0x0039, TRUE, Seg, PWAW) 127 EVENT(X, TraceStatScan , 0x003F, TRUE, Trace, PWWWWWWWWWWWW) \
131RELATION(BufferEmpty , 0x003A, TRUE, Seg, PW) 128 EVENT(X, TraceStatFix , 0x0040, TRUE, Trace, PWWWWWWWWW) \
132RELATION(SegAllocFail , 0x003B, TRUE, Seg, PWP) 129 EVENT(X, TraceStatReclaim , 0x0041, TRUE, Trace, PWW) \
133RELATION(TraceScanSeg , 0x003C, TRUE, Seg, UUPP) 130 EVENT(X, PoolInitMVFF , 0x0042, TRUE, Pool, PPWWWUUU) \
134/* TraceScanSingleRef abuses kind, see .kind.abuse */ 131 EVENT(X, PoolInitMV , 0x0043, TRUE, Pool, PPWWW) \
135RELATION(TraceScanSingleRef , 0x003D, TRUE, Seg, UUPA) 132 EVENT(X, PoolInitMFS , 0x0044, TRUE, Pool, PPWW) \
136RELATION(TraceStatCondemn , 0x003E, TRUE, Trace, PWWWWDD) 133 EVENT(X, PoolInitEPVM , 0x0045, TRUE, Pool, PPPUU) \
137RELATION(TraceStatScan , 0x003F, TRUE, Trace, PWWWWWWWWWWWW) 134 EVENT(X, PoolInitEPDL , 0x0046, TRUE, Pool, PPUWWW) \
138RELATION(TraceStatFix , 0x0040, TRUE, Trace, PWWWWWWWWW) 135 EVENT(X, PoolInitAMS , 0x0047, TRUE, Pool, PPP) \
139RELATION(TraceStatReclaim , 0x0041, TRUE, Trace, PWW) 136 EVENT(X, PoolInitAMC , 0x0048, TRUE, Pool, PP) \
140 137 EVENT(X, PoolInitAMCZ , 0x0049, TRUE, Pool, PP) \
141RELATION(PoolInitMVFF , 0x0042, TRUE, Pool, PPWWWUUU) 138 EVENT(X, PoolInitAWL , 0x004A, TRUE, Pool, PP) \
142RELATION(PoolInitMV , 0x0043, TRUE, Pool, PPWWW) 139 EVENT(X, PoolInitLO , 0x004B, TRUE, Pool, PP) \
143RELATION(PoolInitMFS , 0x0044, TRUE, Pool, PPWW) 140 EVENT(X, PoolInitSNC , 0x004C, TRUE, Pool, PP) \
144RELATION(PoolInitEPVM , 0x0045, TRUE, Pool, PPPUU) 141 EVENT(X, PoolInitMVT , 0x004D, TRUE, Pool, PWWWWW) \
145RELATION(PoolInitEPDL , 0x0046, TRUE, Pool, PPUWWW) 142 EVENT(X, BufferInitEPVM , 0x0050, TRUE, Pool, PPU) \
146RELATION(PoolInitAMS , 0x0047, TRUE, Pool, PPP) 143 EVENT(X, BufferInitSeg , 0x0051, TRUE, Pool, PPU) \
147RELATION(PoolInitAMC , 0x0048, TRUE, Pool, PP) 144 EVENT(X, BufferInitRank , 0x0052, TRUE, Pool, PPUU) \
148RELATION(PoolInitAMCZ , 0x0049, TRUE, Pool, PP) 145 /* PoolPush/Pop go under Object, because they're user ops. */ \
149RELATION(PoolInitAWL , 0x004A, TRUE, Pool, PP) 146 EVENT(X, PoolPush , 0x0060, TRUE, Object, P) \
150RELATION(PoolInitLO , 0x004B, TRUE, Pool, PP) 147 EVENT(X, PoolPop , 0x0061, TRUE, Object, PU) \
151RELATION(PoolInitSNC , 0x004C, TRUE, Pool, PP) 148 EVENT(X, ReservoirLimitSet , 0x0062, TRUE, Arena, PW) \
152RELATION(PoolInitMVT , 0x004D, TRUE, Pool, PWWWWW) 149 EVENT(X, CommitLimitSet , 0x0063, TRUE, Arena, PWU) \
153 150 EVENT(X, SpareCommitLimitSet , 0x0064, TRUE, Arena, PW) \
154RELATION(BufferInitEPVM , 0x0050, TRUE, Pool, PPU) 151 EVENT(X, ArenaAlloc , 0x0065, TRUE, Arena, PPAWP) \
155RELATION(BufferInitSeg , 0x0051, TRUE, Pool, PPU) 152 EVENT(X, ArenaFree , 0x0066, TRUE, Arena, PAW) \
156RELATION(BufferInitRank , 0x0052, TRUE, Pool, PPUU) 153 EVENT(X, ArenaAllocFail , 0x0067, TRUE, Arena, PWP) \
157 154 EVENT(X, SegMerge , 0x0068, TRUE, Seg, PPP) \
158/* PoolPush/Pop go under Object, because they're user ops. */ 155 EVENT(X, SegSplit , 0x0069, TRUE, Seg, PPPA)
159RELATION(PoolPush , 0x0060, TRUE, Object, P)
160RELATION(PoolPop , 0x0061, TRUE, Object, PU)
161RELATION(ReservoirLimitSet , 0x0062, TRUE, Arena, PW)
162RELATION(CommitLimitSet , 0x0063, TRUE, Arena, PWU)
163RELATION(SpareCommitLimitSet , 0x0064, TRUE, Arena, PW)
164RELATION(ArenaAlloc , 0x0065, TRUE, Arena, PPAWP)
165RELATION(ArenaFree , 0x0066, TRUE, Arena, PAW)
166RELATION(ArenaAllocFail , 0x0067, TRUE, Arena, PWP)
167RELATION(SegMerge , 0x0068, TRUE, Seg, PPP)
168RELATION(SegSplit , 0x0069, TRUE, Seg, PPPA)
169 156
170/* Remember to update EventNameMAX and EventCodeMAX in eventcom.h! */ 157/* Remember to update EventNameMAX and EventCodeMAX in eventcom.h! */
171 158
172 159
160#endif /* eventdef_h */
161
173/* C. COPYRIGHT AND LICENSE 162/* C. COPYRIGHT AND LICENSE
174 * 163 *
175 * Copyright (C) 2001-2002 Ravenbrook Limited <http://www.ravenbrook.com/>. 164 * Copyright (C) 2001-2002 Ravenbrook Limited <http://www.ravenbrook.com/>.
diff --git a/mps/code/eventgen.pl b/mps/code/eventgen.pl
index 82a71de500e..48fba15f9af 100644
--- a/mps/code/eventgen.pl
+++ b/mps/code/eventgen.pl
@@ -30,7 +30,7 @@ $ID = substr(q$Id$, 4, -1);
30 30
31open(C, "<eventdef.h") || die "Can't open $_"; 31open(C, "<eventdef.h") || die "Can't open $_";
32while(<C>) { 32while(<C>) {
33 if(/RELATION\([^,]*,[^,]*,[^,]*,[^,]*, ([A-Z]+)\)/) { 33 if(/EVENT\(X,[^,]*,[^,]*,[^,]*,[^,]*, ([A-Z]+)\)/) {
34 $Formats{$1} = 1 if(!defined($Formats{$1})); 34 $Formats{$1} = 1 if(!defined($Formats{$1}));
35 } 35 }
36} 36}
diff --git a/mps/code/eventpro.c b/mps/code/eventpro.c
index 5655d35171b..b9926034632 100644
--- a/mps/code/eventpro.c
+++ b/mps/code/eventpro.c
@@ -10,6 +10,7 @@
10 10
11#include "table.h" 11#include "table.h"
12 12
13#include "eventdef.h"
13#include "eventcom.h" 14#include "eventcom.h"
14#include "eventpro.h" 15#include "eventpro.h"
15#include "misc.h" 16#include "misc.h"
@@ -76,11 +77,10 @@ typedef struct {
76 77
77static eventRecord eventTypes[] = { 78static eventRecord eventTypes[] = {
78 {0, "(unused)", 0, 0, "0"}, 79 {0, "(unused)", 0, 0, "0"},
79#define RELATION(name, code, always, kind, format) \ 80#define EVENT_INIT(X, name, code, always, kind, format) \
80 {Event##name, #name, code, \ 81 {Event##name, #name, code, \
81 EventSizeAlign(sizeof(Event##format##Struct)), #format}, 82 EventSizeAlign(sizeof(Event##format##Struct)), #format},
82#include "eventdef.h" 83 EVENT_LIST(EVENT_INIT, X)
83#undef RELATION
84}; 84};
85 85
86#define eventTypeCount (sizeof(eventTypes) / sizeof(eventRecord)) 86#define eventTypeCount (sizeof(eventTypes) / sizeof(eventRecord))