aboutsummaryrefslogtreecommitdiffstats
path: root/mps/code
diff options
context:
space:
mode:
authorRichard Brooksby2012-08-31 21:39:56 +0100
committerRichard Brooksby2012-08-31 21:39:56 +0100
commite06c189c251d96d692d8fdb7dfe3af6a897fa813 (patch)
treeca960a594b32237c6f253b7778fa0be8ddba0208 /mps/code
parentfbe459531958e13de85a0fefd97aa8a8b6ef9892 (diff)
downloademacs-e06c189c251d96d692d8fdb7dfe3af6a897fa813.tar.gz
emacs-e06c189c251d96d692d8fdb7dfe3af6a897fa813.zip
Fixing remaining fixmes.
Eliminating the flag for partial log, since this only affects the assumption that the log is in order, which it isn't any more. Copied from Perforce Change: 179150 ServerID: perforce.ravenbrook.com
Diffstat (limited to 'mps/code')
-rw-r--r--mps/code/eventcnv.c6
-rw-r--r--mps/code/eventdef.h2
-rw-r--r--mps/code/eventpro.c15
-rw-r--r--mps/code/eventpro.h5
-rw-r--r--mps/code/eventrep.c4
-rw-r--r--mps/code/replay.c9
6 files changed, 15 insertions, 26 deletions
diff --git a/mps/code/eventcnv.c b/mps/code/eventcnv.c
index f52ab854641..ece05330777 100644
--- a/mps/code/eventcnv.c
+++ b/mps/code/eventcnv.c
@@ -55,7 +55,6 @@ static Bool verbose = FALSE;
55static char style = '\0'; 55static char style = '\0';
56static Bool reportEvents = FALSE; 56static Bool reportEvents = FALSE;
57static Bool eventEnabled[EventCodeMAX+1]; 57static Bool eventEnabled[EventCodeMAX+1];
58static Bool partialLog = FALSE; /* FIXME: can't read out-of-order labels */
59static Word bucketSize = 0; 58static Word bucketSize = 0;
60 59
61 60
@@ -147,9 +146,6 @@ static char *parseArgs(int argc, char *argv[])
147 else 146 else
148 name = argv[i]; 147 name = argv[i];
149 break; 148 break;
150 case 'p': /* partial log */
151 partialLog = TRUE;
152 break;
153 case 'v': /* verbosity */ 149 case 'v': /* verbosity */
154 verbose = TRUE; 150 verbose = TRUE;
155 break; 151 break;
@@ -644,7 +640,7 @@ int main(int argc, char *argv[])
644 everror("unable to open \"%s\"\n", filename); 640 everror("unable to open \"%s\"\n", filename);
645 } 641 }
646 642
647 res = EventProcCreate(&proc, partialLog, logReader, (void *)input); 643 res = EventProcCreate(&proc, logReader, (void *)input);
648 if (res != ResOK) 644 if (res != ResOK)
649 everror("Can't init EventProc module: error %d.", res); 645 everror("Can't init EventProc module: error %d.", res);
650 646
diff --git a/mps/code/eventdef.h b/mps/code/eventdef.h
index 004ee6d9668..d8edc6a2bee 100644
--- a/mps/code/eventdef.h
+++ b/mps/code/eventdef.h
@@ -55,7 +55,7 @@
55#define EventNameMAX ((size_t)19) 55#define EventNameMAX ((size_t)19)
56#define EventCodeMAX ((EventCode)0x0071) 56#define EventCodeMAX ((EventCode)0x0071)
57 57
58/* FIXME: Work out why not-in-use events were not in use and restore or delete them. */ 58/* TODO: Work out why not-in-use events were not in use and restore or delete them. */
59 59
60#define EVENT_LIST(EVENT, X) \ 60#define EVENT_LIST(EVENT, X) \
61 /* 0123456789012345678 <- don't exceed without changing EventNameMAX */ \ 61 /* 0123456789012345678 <- don't exceed without changing EventNameMAX */ \
diff --git a/mps/code/eventpro.c b/mps/code/eventpro.c
index 0fce7d44633..439746bf950 100644
--- a/mps/code/eventpro.c
+++ b/mps/code/eventpro.c
@@ -22,7 +22,6 @@
22#include <string.h> /* strcmp */ 22#include <string.h> /* strcmp */
23 23
24struct EventProcStruct { 24struct EventProcStruct {
25 Bool partialLog; /* Is this a partial log? */
26 EventProcReader reader; /* reader fn */ 25 EventProcReader reader; /* reader fn */
27 void *readerP; /* closure pointer for reader fn */ 26 void *readerP; /* closure pointer for reader fn */
28 Table internTable; /* dictionary of intern ids to symbols */ 27 Table internTable; /* dictionary of intern ids to symbols */
@@ -58,7 +57,8 @@ struct EventProcStruct {
58 * of the structure. This has to agree with the writing (EVENT_END). 57 * of the structure. This has to agree with the writing (EVENT_END).
59 */ 58 */
60 59
61/* FIXME: MPS_PF_ALIGN should be read from event file header? */ 60/* TODO: Should read this and other layout information from an event file
61 header in order to be able to process events from other architectures. */
62 62
63#define EventSizeAlign(size) sizeAlignUp(size, MPS_PF_ALIGN) 63#define EventSizeAlign(size) sizeAlignUp(size, MPS_PF_ALIGN)
64 64
@@ -293,9 +293,8 @@ Res EventRecord(EventProc proc, Event event, EventClock etime)
293 293
294 if (label == NULL) return ResMEMORY; 294 if (label == NULL) return ResMEMORY;
295 label->id = event->Label.f1; 295 label->id = event->Label.f1;
296 if (!proc->partialLog) { 296 /* If events were in time order we'd be able to assert that
297 assert(TableLookup(&entry, proc->internTable, label->id)); 297 TableLookup(&entry, proc->internTable, label->id) */
298 }
299 label->time = etime; 298 label->time = etime;
300 label->addr = event->Label.f0; 299 label->addr = event->Label.f0;
301 if (TableLookup(&entry, proc->labelTable, (Word)label->addr)) 300 if (TableLookup(&entry, proc->labelTable, (Word)label->addr))
@@ -345,8 +344,9 @@ void EventDestroy(EventProc proc, Event event)
345 344
346/* EventProcCreate -- initialize the module */ 345/* EventProcCreate -- initialize the module */
347 346
348Res EventProcCreate(EventProc *procReturn, Bool partial, 347Res EventProcCreate(EventProc *procReturn,
349 EventProcReader reader, void *readerP) 348 EventProcReader reader,
349 void *readerP)
350{ 350{
351 Res res; 351 Res res;
352 EventProc proc = malloc(sizeof(struct EventProcStruct)); 352 EventProc proc = malloc(sizeof(struct EventProcStruct));
@@ -359,7 +359,6 @@ Res EventProcCreate(EventProc *procReturn, Bool partial,
359 /* check use of labelTable */ 359 /* check use of labelTable */
360 assert(sizeof(Word) >= sizeof(Addr)); 360 assert(sizeof(Word) >= sizeof(Addr));
361 361
362 proc->partialLog = partial;
363 proc->reader = reader; proc->readerP = readerP; 362 proc->reader = reader; proc->readerP = readerP;
364 res = TableCreate(&proc->internTable, (size_t)1<<4); 363 res = TableCreate(&proc->internTable, (size_t)1<<4);
365 if (res != ResOK) goto failIntern; 364 if (res != ResOK) goto failIntern;
diff --git a/mps/code/eventpro.h b/mps/code/eventpro.h
index 375eaec19c2..a4a7d34e780 100644
--- a/mps/code/eventpro.h
+++ b/mps/code/eventpro.h
@@ -32,8 +32,9 @@ extern void EventDestroy(EventProc proc, Event event);
32 32
33extern Res EventRecord(EventProc proc, Event event, EventClock etime); 33extern Res EventRecord(EventProc proc, Event event, EventClock etime);
34 34
35extern Res EventProcCreate(EventProc *procReturn, Bool partial, 35extern Res EventProcCreate(EventProc *procReturn,
36 EventProcReader reader, void *readerP); 36 EventProcReader reader,
37 void *readerP);
37extern void EventProcDestroy(EventProc proc); 38extern void EventProcDestroy(EventProc proc);
38 39
39 40
diff --git a/mps/code/eventrep.c b/mps/code/eventrep.c
index 7bbf2828eb2..d135c4fc122 100644
--- a/mps/code/eventrep.c
+++ b/mps/code/eventrep.c
@@ -51,7 +51,6 @@ static ulong totalEvents; /* count of events */
51static ulong discardedEvents; /* count of ignored events */ 51static ulong discardedEvents; /* count of ignored events */
52static ulong unknownEvents; /* count of unknown events */ 52static ulong unknownEvents; /* count of unknown events */
53 53
54static Bool partialLog;
55static Word eventTime; 54static Word eventTime;
56 55
57/* Dictionaries for translating from log to replay values */ 56/* Dictionaries for translating from log to replay values */
@@ -698,7 +697,7 @@ void EventReplay(Event event, Word etime)
698 697
699/* EventRepInit -- initialize the module */ 698/* EventRepInit -- initialize the module */
700 699
701Res EventRepInit(Bool partial) 700Res EventRepInit(void)
702{ 701{
703 Res res; 702 Res res;
704 703
@@ -711,7 +710,6 @@ Res EventRepInit(Bool partial)
711 /* by the MPS functions is justified by the reverse conversion */ 710 /* by the MPS functions is justified by the reverse conversion */
712 /* being acceptable (which is upto the event log generator). */ 711 /* being acceptable (which is upto the event log generator). */
713 712
714 partialLog = partial;
715 totalEvents = 0; discardedEvents = 0; unknownEvents = 0; 713 totalEvents = 0; discardedEvents = 0; unknownEvents = 0;
716 714
717 res = TableCreate(&arenaTable, (size_t)1); 715 res = TableCreate(&arenaTable, (size_t)1);
diff --git a/mps/code/replay.c b/mps/code/replay.c
index 9dd34557d10..974ce5dcd07 100644
--- a/mps/code/replay.c
+++ b/mps/code/replay.c
@@ -37,8 +37,6 @@ typedef unsigned long ulong;
37 37
38/* command-line arguments */ 38/* command-line arguments */
39 39
40static Bool partialLog = FALSE;
41
42static char *prog; /* program name */ 40static char *prog; /* program name */
43 41
44 42
@@ -105,9 +103,6 @@ static char *parseArgs(int argc, char *argv[])
105 else 103 else
106 name = argv[i]; 104 name = argv[i];
107 break; 105 break;
108 case 'p': /* partial log */
109 partialLog = TRUE;
110 break;
111 case '?': case 'h': /* help */ 106 case '?': case 'h': /* help */
112 usage(); 107 usage();
113 break; 108 break;
@@ -172,11 +167,11 @@ int main(int argc, char *argv[])
172 error("unable to open \"%s\"\n", filename); 167 error("unable to open \"%s\"\n", filename);
173 } 168 }
174 169
175 res = EventProcCreate(&proc, partialLog, logReader, (void *)input); 170 res = EventProcCreate(&proc, logReader, (void *)input);
176 if (res != ResOK) 171 if (res != ResOK)
177 error("Can't init EventProc module: error %d.", res); 172 error("Can't init EventProc module: error %d.", res);
178 173
179 res = EventRepInit(partialLog); 174 res = EventRepInit();
180 if (res != ResOK) 175 if (res != ResOK)
181 error("Can't init EventRep module: error %d.", res); 176 error("Can't init EventRep module: error %d.", res);
182 177