diff options
| author | Richard Brooksby | 2012-08-21 16:29:19 +0100 |
|---|---|---|
| committer | Richard Brooksby | 2012-08-21 16:29:19 +0100 |
| commit | ab85e6ff329c0237cbe3160f2e10b70ab9c0a182 (patch) | |
| tree | 5bbbb9febce0131059907140f9b0cccb66d0ac01 /mps/code | |
| parent | 39bdab4ca5d00570eb84613764f906244d361588 (diff) | |
| download | emacs-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.c | 14 | ||||
| -rw-r--r-- | mps/code/event.h | 7 | ||||
| -rw-r--r-- | mps/code/eventcnv.c | 18 | ||||
| -rw-r--r-- | mps/code/eventdef.h | 219 | ||||
| -rw-r--r-- | mps/code/eventgen.pl | 2 | ||||
| -rw-r--r-- | mps/code/eventpro.c | 6 |
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; | |||
| 21 | typedef struct AddrStruct *Addr; | 21 | typedef 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 | ||
| 22 | extern Res EventSync(void); | 23 | extern 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 | 70 | EVENT_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 | |||
| 377 | static void readLog(EventProc proc) | 371 | static 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 | ||
| 61 | RELATION(AMCGenCreate , 0x0001, TRUE, Pool, PP) | 58 | #define EVENT_LIST(EVENT, X) \ |
| 62 | RELATION(AMCGenDestroy , 0x0002, TRUE, Pool, P) | 59 | EVENT(X, AMCGenCreate , 0x0001, TRUE, Pool, PP) \ |
| 63 | RELATION(AMCInit , 0x0003, TRUE, Pool, PP) | 60 | EVENT(X, AMCGenDestroy , 0x0002, TRUE, Pool, P) \ |
| 64 | RELATION(AMCFinish , 0x0004, TRUE, Pool, P) | 61 | EVENT(X, AMCInit , 0x0003, TRUE, Pool, PP) \ |
| 65 | RELATION(ArenaCreateVM , 0x0005, TRUE, Arena, PWW) | 62 | EVENT(X, AMCFinish , 0x0004, TRUE, Pool, P) \ |
| 66 | RELATION(ArenaCreateVMNZ , 0x0006, TRUE, Arena, PWW) | 63 | EVENT(X, ArenaCreateVM , 0x0005, TRUE, Arena, PWW) \ |
| 67 | RELATION(ArenaWriteFaults , 0x0007, TRUE, Trace, PW) | 64 | EVENT(X, ArenaCreateVMNZ , 0x0006, TRUE, Arena, PWW) \ |
| 68 | RELATION(MeterInit , 0x0008, TRUE, Pool, PP) | 65 | EVENT(X, ArenaWriteFaults , 0x0007, TRUE, Trace, PW) \ |
| 69 | RELATION(MeterValues , 0x0009, TRUE, Pool, PDDWWW) | 66 | EVENT(X, MeterInit , 0x0008, TRUE, Pool, PP) \ |
| 70 | RELATION(AMCScanBegin , 0x000a, TRUE, Seg, PPP) | 67 | EVENT(X, MeterValues , 0x0009, TRUE, Pool, PDDWWW) \ |
| 71 | RELATION(AMCScanEnd , 0x000b, TRUE, Seg, PPP) | 68 | EVENT(X, AMCScanBegin , 0x000a, TRUE, Seg, PPP) \ |
| 72 | RELATION(AMCFix , 0x000c, TRUE, Ref, 0) | 69 | EVENT(X, AMCScanEnd , 0x000b, TRUE, Seg, PPP) \ |
| 73 | RELATION(AMCFixInPlace , 0x000d, TRUE, Ref, 0) | 70 | EVENT(X, AMCFix , 0x000c, TRUE, Ref, 0) \ |
| 74 | RELATION(AMCFixForward , 0x000e, TRUE, Ref, A) | 71 | EVENT(X, AMCFixInPlace , 0x000d, TRUE, Ref, 0) \ |
| 75 | RELATION(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) \ |
| 77 | RELATION(AMCTraceEnd , 0x0010, TRUE, Trace, PPP) | 74 | /* EVENT(X, AMCTraceEnd , 0x0010, TRUE, Trace, PPP) */ \ |
| 78 | #endif | 75 | EVENT(X, ArenaCreateCL , 0x0011, TRUE, Arena, PWA) \ |
| 79 | RELATION(ArenaCreateCL , 0x0011, TRUE, Arena, PWA) | 76 | EVENT(X, ArenaDestroy , 0x0012, TRUE, Arena, P) \ |
| 80 | RELATION(ArenaDestroy , 0x0012, TRUE, Arena, P) | 77 | EVENT(X, SegAlloc , 0x0013, TRUE, Seg, PPAWP) \ |
| 81 | RELATION(SegAlloc , 0x0013, TRUE, Seg, PPAWP) | 78 | EVENT(X, SegFree , 0x0014, TRUE, Seg, PP) \ |
| 82 | RELATION(SegFree , 0x0014, TRUE, Seg, PP) | 79 | EVENT(X, PoolInit , 0x0015, TRUE, Pool, PPP) \ |
| 83 | RELATION(PoolInit , 0x0015, TRUE, Pool, PPP) | 80 | EVENT(X, PoolFinish , 0x0016, TRUE, Pool, P) \ |
| 84 | RELATION(PoolFinish , 0x0016, TRUE, Pool, P) | 81 | EVENT(X, PoolAlloc , 0x0017, TRUE, Object, PAW) \ |
| 85 | RELATION(PoolAlloc , 0x0017, TRUE, Object, PAW) | 82 | EVENT(X, PoolFree , 0x0018, TRUE, Object, PAW) \ |
| 86 | RELATION(PoolFree , 0x0018, TRUE, Object, PAW) | 83 | EVENT(X, CBSInit , 0x0019, TRUE, Pool, PP) \ |
| 87 | RELATION(CBSInit , 0x0019, TRUE, Pool, PP) | 84 | EVENT(X, Intern , 0x001a, TRUE, User, WS) \ |
| 88 | RELATION(Intern , 0x001a, TRUE, User, WS) | 85 | EVENT(X, Label , 0x001b, TRUE, User, AW) \ |
| 89 | RELATION(Label , 0x001b, TRUE, User, AW) | 86 | EVENT(X, TraceStart , 0x001c, TRUE, Trace, PPP) \ |
| 90 | RELATION(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) \ |
| 92 | RELATION(TraceCreate , 0x001d, TRUE, Trace, PPPU) | 89 | EVENT(X, SegSetGrey , 0x001f, TRUE, Seg, PPU) \ |
| 93 | #endif | 90 | EVENT(X, TraceFlipBegin , 0x0020, TRUE, Trace, PP) \ |
| 94 | RELATION(TraceDestroy , 0x001e, TRUE, Trace, P) | 91 | EVENT(X, TraceFlipEnd , 0x0021, TRUE, Trace, PP) \ |
| 95 | RELATION(SegSetGrey , 0x001f, TRUE, Seg, PPU) | 92 | EVENT(X, TraceReclaim , 0x0022, TRUE, Seg, P) \ |
| 96 | RELATION(TraceFlipBegin , 0x0020, TRUE, Trace, PP) | 93 | /* EVENT(X, TraceScan , 0x0023, TRUE, Seg, UUPPP) */ \ |
| 97 | RELATION(TraceFlipEnd , 0x0021, TRUE, Trace, PP) | 94 | EVENT(X, TraceAccess , 0x0024, TRUE, Seg, PPU) \ |
| 98 | RELATION(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) \ |
| 100 | RELATION(TraceScan , 0x0023, TRUE, Seg, UUPPP) | 97 | EVENT(X, TraceFix , 0x0026, TRUE, Ref, PPAU) \ |
| 101 | #endif | 98 | EVENT(X, TraceFixSeg , 0x0027, TRUE, Ref, P) \ |
| 102 | RELATION(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 */ \ |
| 104 | RELATION(TracePoll , 0x0025, TRUE, Trace, PP) | 101 | EVENT(X, TraceScanArea , 0x0029, TRUE, Seg, PPP) \ |
| 105 | RELATION(TraceFix , 0x0026, TRUE, Ref, PPAU) | 102 | EVENT(X, TraceScanAreaTagged , 0x002a, TRUE, Seg, PPP) \ |
| 106 | RELATION(TraceFixSeg , 0x0027, TRUE, Ref, P) | 103 | EVENT(X, VMCreate , 0x002b, TRUE, Arena, PAA) \ |
| 107 | RELATION(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) \ |
| 109 | RELATION(TraceScanArea , 0x0029, TRUE, Seg, PPP) | 106 | EVENT(X, VMUnmap , 0x002e, TRUE, Seg, PAA) \ |
| 110 | RELATION(TraceScanAreaTagged , 0x002a, TRUE, Seg, PPP) | 107 | EVENT(X, ArenaExtend , 0x002f, TRUE, Arena, PAW) \ |
| 111 | RELATION(VMCreate , 0x002b, TRUE, Arena, PAA) | 108 | EVENT(X, ArenaRetract , 0x0030, TRUE, Arena, PAW) \ |
| 112 | RELATION(VMDestroy , 0x002c, TRUE, Arena, P) | 109 | EVENT(X, TraceSegGreyen , 0x0031, TRUE, Seg, PPU) \ |
| 113 | RELATION(VMMap , 0x002d, TRUE, Seg, PAA) | 110 | /* RootScanned abuses kind, see .kind.abuse */ \ |
| 114 | RELATION(VMUnmap , 0x002e, TRUE, Seg, PAA) | 111 | EVENT(X, RootScan , 0x0032, TRUE, Seg, PWW) \ |
| 115 | RELATION(ArenaExtend , 0x002f, TRUE, Arena, PAW) | 112 | /* TraceStep abuses kind, see .kind.abuse */ \ |
| 116 | RELATION(ArenaRetract , 0x0030, TRUE, Arena, PAW) | 113 | EVENT(X, TraceStep , 0x0033, TRUE, Seg, PP) \ |
| 117 | RELATION(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) \ |
| 119 | RELATION(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) \ |
| 121 | RELATION(TraceStep , 0x0033, TRUE, Seg, PP) | 118 | EVENT(X, BufferFinish , 0x0037, TRUE, Pool, P) \ |
| 122 | RELATION(BufferReserve , 0x0034, TRUE, Object, PAW) | 119 | /* EVENT(X, MVTFinish , 0x0038, TRUE, Pool, P) */ \ |
| 123 | RELATION(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) \ |
| 125 | RELATION(BufferInit , 0x0036, TRUE, Pool, PPU) | 122 | EVENT(X, SegAllocFail , 0x003B, TRUE, Seg, PWP) \ |
| 126 | RELATION(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 */ \ |
| 128 | RELATION(MVTFinish , 0x0038, TRUE, Pool, P) | 125 | EVENT(X, TraceScanSingleRef , 0x003D, TRUE, Seg, UUPA) \ |
| 129 | #endif | 126 | EVENT(X, TraceStatCondemn , 0x003E, TRUE, Trace, PWWWWDD) \ |
| 130 | RELATION(BufferFill , 0x0039, TRUE, Seg, PWAW) | 127 | EVENT(X, TraceStatScan , 0x003F, TRUE, Trace, PWWWWWWWWWWWW) \ |
| 131 | RELATION(BufferEmpty , 0x003A, TRUE, Seg, PW) | 128 | EVENT(X, TraceStatFix , 0x0040, TRUE, Trace, PWWWWWWWWW) \ |
| 132 | RELATION(SegAllocFail , 0x003B, TRUE, Seg, PWP) | 129 | EVENT(X, TraceStatReclaim , 0x0041, TRUE, Trace, PWW) \ |
| 133 | RELATION(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) \ |
| 135 | RELATION(TraceScanSingleRef , 0x003D, TRUE, Seg, UUPA) | 132 | EVENT(X, PoolInitMFS , 0x0044, TRUE, Pool, PPWW) \ |
| 136 | RELATION(TraceStatCondemn , 0x003E, TRUE, Trace, PWWWWDD) | 133 | EVENT(X, PoolInitEPVM , 0x0045, TRUE, Pool, PPPUU) \ |
| 137 | RELATION(TraceStatScan , 0x003F, TRUE, Trace, PWWWWWWWWWWWW) | 134 | EVENT(X, PoolInitEPDL , 0x0046, TRUE, Pool, PPUWWW) \ |
| 138 | RELATION(TraceStatFix , 0x0040, TRUE, Trace, PWWWWWWWWW) | 135 | EVENT(X, PoolInitAMS , 0x0047, TRUE, Pool, PPP) \ |
| 139 | RELATION(TraceStatReclaim , 0x0041, TRUE, Trace, PWW) | 136 | EVENT(X, PoolInitAMC , 0x0048, TRUE, Pool, PP) \ |
| 140 | 137 | EVENT(X, PoolInitAMCZ , 0x0049, TRUE, Pool, PP) \ | |
| 141 | RELATION(PoolInitMVFF , 0x0042, TRUE, Pool, PPWWWUUU) | 138 | EVENT(X, PoolInitAWL , 0x004A, TRUE, Pool, PP) \ |
| 142 | RELATION(PoolInitMV , 0x0043, TRUE, Pool, PPWWW) | 139 | EVENT(X, PoolInitLO , 0x004B, TRUE, Pool, PP) \ |
| 143 | RELATION(PoolInitMFS , 0x0044, TRUE, Pool, PPWW) | 140 | EVENT(X, PoolInitSNC , 0x004C, TRUE, Pool, PP) \ |
| 144 | RELATION(PoolInitEPVM , 0x0045, TRUE, Pool, PPPUU) | 141 | EVENT(X, PoolInitMVT , 0x004D, TRUE, Pool, PWWWWW) \ |
| 145 | RELATION(PoolInitEPDL , 0x0046, TRUE, Pool, PPUWWW) | 142 | EVENT(X, BufferInitEPVM , 0x0050, TRUE, Pool, PPU) \ |
| 146 | RELATION(PoolInitAMS , 0x0047, TRUE, Pool, PPP) | 143 | EVENT(X, BufferInitSeg , 0x0051, TRUE, Pool, PPU) \ |
| 147 | RELATION(PoolInitAMC , 0x0048, TRUE, Pool, PP) | 144 | EVENT(X, BufferInitRank , 0x0052, TRUE, Pool, PPUU) \ |
| 148 | RELATION(PoolInitAMCZ , 0x0049, TRUE, Pool, PP) | 145 | /* PoolPush/Pop go under Object, because they're user ops. */ \ |
| 149 | RELATION(PoolInitAWL , 0x004A, TRUE, Pool, PP) | 146 | EVENT(X, PoolPush , 0x0060, TRUE, Object, P) \ |
| 150 | RELATION(PoolInitLO , 0x004B, TRUE, Pool, PP) | 147 | EVENT(X, PoolPop , 0x0061, TRUE, Object, PU) \ |
| 151 | RELATION(PoolInitSNC , 0x004C, TRUE, Pool, PP) | 148 | EVENT(X, ReservoirLimitSet , 0x0062, TRUE, Arena, PW) \ |
| 152 | RELATION(PoolInitMVT , 0x004D, TRUE, Pool, PWWWWW) | 149 | EVENT(X, CommitLimitSet , 0x0063, TRUE, Arena, PWU) \ |
| 153 | 150 | EVENT(X, SpareCommitLimitSet , 0x0064, TRUE, Arena, PW) \ | |
| 154 | RELATION(BufferInitEPVM , 0x0050, TRUE, Pool, PPU) | 151 | EVENT(X, ArenaAlloc , 0x0065, TRUE, Arena, PPAWP) \ |
| 155 | RELATION(BufferInitSeg , 0x0051, TRUE, Pool, PPU) | 152 | EVENT(X, ArenaFree , 0x0066, TRUE, Arena, PAW) \ |
| 156 | RELATION(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) |
| 159 | RELATION(PoolPush , 0x0060, TRUE, Object, P) | ||
| 160 | RELATION(PoolPop , 0x0061, TRUE, Object, PU) | ||
| 161 | RELATION(ReservoirLimitSet , 0x0062, TRUE, Arena, PW) | ||
| 162 | RELATION(CommitLimitSet , 0x0063, TRUE, Arena, PWU) | ||
| 163 | RELATION(SpareCommitLimitSet , 0x0064, TRUE, Arena, PW) | ||
| 164 | RELATION(ArenaAlloc , 0x0065, TRUE, Arena, PPAWP) | ||
| 165 | RELATION(ArenaFree , 0x0066, TRUE, Arena, PAW) | ||
| 166 | RELATION(ArenaAllocFail , 0x0067, TRUE, Arena, PWP) | ||
| 167 | RELATION(SegMerge , 0x0068, TRUE, Seg, PPP) | ||
| 168 | RELATION(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 | ||
| 31 | open(C, "<eventdef.h") || die "Can't open $_"; | 31 | open(C, "<eventdef.h") || die "Can't open $_"; |
| 32 | while(<C>) { | 32 | while(<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 | ||
| 77 | static eventRecord eventTypes[] = { | 78 | static 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)) |