diff options
| author | Richard Brooksby | 2012-09-05 19:02:44 +0100 |
|---|---|---|
| committer | Richard Brooksby | 2012-09-05 19:02:44 +0100 |
| commit | e64cb01f875a3be9962e31662a187a582d412e8d (patch) | |
| tree | edc9e17e7728b5a0c5af3b981339b595c12d1031 /mps/code | |
| parent | 89e1236e4752bd100a6e9b6fbb652c5ba0ee913a (diff) | |
| download | emacs-e64cb01f875a3be9962e31662a187a582d412e8d.tar.gz emacs-e64cb01f875a3be9962e31662a187a582d412e8d.zip | |
Responding to dl's review comments. mostly clarifications.
Copied from Perforce
Change: 179280
ServerID: perforce.ravenbrook.com
Diffstat (limited to 'mps/code')
| -rw-r--r-- | mps/code/eventcnv.c | 2 | ||||
| -rw-r--r-- | mps/code/eventcom.h | 14 | ||||
| -rw-r--r-- | mps/code/eventdef.h | 6 | ||||
| -rw-r--r-- | mps/code/eventpro.c | 4 |
4 files changed, 12 insertions, 14 deletions
diff --git a/mps/code/eventcnv.c b/mps/code/eventcnv.c index 38752a7b9d4..8e1ba9aecb2 100644 --- a/mps/code/eventcnv.c +++ b/mps/code/eventcnv.c | |||
| @@ -95,7 +95,7 @@ static void usage(void) | |||
| 95 | { | 95 | { |
| 96 | fprintf(stderr, | 96 | fprintf(stderr, |
| 97 | "Usage: %s [-f logfile] [-p] [-v] [-e events] [-b size]" | 97 | "Usage: %s [-f logfile] [-p] [-v] [-e events] [-b size]" |
| 98 | " [-S[LC]] [-?]\nSee guide.mps.telemetry for instructions.", | 98 | " [-S[LC]] [-?]\nSee guide.mps.telemetry for instructions.\n", |
| 99 | prog); | 99 | prog); |
| 100 | } | 100 | } |
| 101 | 101 | ||
diff --git a/mps/code/eventcom.h b/mps/code/eventcom.h index d92d22d610f..c0eca4b7b15 100644 --- a/mps/code/eventcom.h +++ b/mps/code/eventcom.h | |||
| @@ -50,7 +50,7 @@ typedef unsigned __int64 EventClock; | |||
| 50 | #if defined(MPS_ARCH_I3) | 50 | #if defined(MPS_ARCH_I3) |
| 51 | #define EVENT_CLOCK_WRITE(stream, clock) \ | 51 | #define EVENT_CLOCK_WRITE(stream, clock) \ |
| 52 | WriteF(stream, "$W$W", (WriteFW)((clock) >> 32), (WriteFW)clock, NULL) | 52 | WriteF(stream, "$W$W", (WriteFW)((clock) >> 32), (WriteFW)clock, NULL) |
| 53 | #else /* I6 */ | 53 | #elif defined(MPS_ARCH_I6) |
| 54 | #define EVENT_CLOCK_WRITE(stream, clock) \ | 54 | #define EVENT_CLOCK_WRITE(stream, clock) \ |
| 55 | WriteF(stream, "$W", (WriteFW)(clock), NULL) | 55 | WriteF(stream, "$W", (WriteFW)(clock), NULL) |
| 56 | #endif | 56 | #endif |
| @@ -153,10 +153,12 @@ typedef unsigned short EventSize; | |||
| 153 | 153 | ||
| 154 | /* Common prefix for all event structures. The size field allows an event | 154 | /* Common prefix for all event structures. The size field allows an event |
| 155 | reader to skip over events whose codes it does not recognise. */ | 155 | reader to skip over events whose codes it does not recognise. */ |
| 156 | typedef struct EventAnyStruct { | 156 | #define EVENT_ANY_FIELDS \ |
| 157 | EventCode code; /* encoding of the event type */ | 157 | EventCode code; /* encoding of the event type */ \ |
| 158 | EventSize size; /* allows reader to skip events of unknown code */ | 158 | EventSize size; /* allows reader to skip events of unknown code */ \ |
| 159 | EventClock clock; /* when the event occurred */ | 159 | EventClock clock; /* when the event occurred */ |
| 160 | typedef struct EventAnyStruct { | ||
| 161 | EVENT_ANY_FIELDS | ||
| 160 | } EventAnyStruct; | 162 | } EventAnyStruct; |
| 161 | 163 | ||
| 162 | /* Event field types, for indexing by macro on the event parameter sort */ | 164 | /* Event field types, for indexing by macro on the event parameter sort */ |
| @@ -182,9 +184,7 @@ typedef int EventFB; /* boolean */ | |||
| 182 | 184 | ||
| 183 | #define EVENT_STRUCT(X, name, _code, always, kind) \ | 185 | #define EVENT_STRUCT(X, name, _code, always, kind) \ |
| 184 | typedef struct Event##name##Struct { \ | 186 | typedef struct Event##name##Struct { \ |
| 185 | EventCode code; /* Must match EventAnyStruct */ \ | 187 | EVENT_ANY_FIELDS \ |
| 186 | EventSize size; /* ditto */ \ | ||
| 187 | EventClock clock; /* ditto */ \ | ||
| 188 | EVENT_##name##_PARAMS(EVENT_STRUCT_FIELD, X) \ | 188 | EVENT_##name##_PARAMS(EVENT_STRUCT_FIELD, X) \ |
| 189 | } Event##name##Struct; | 189 | } Event##name##Struct; |
| 190 | 190 | ||
diff --git a/mps/code/eventdef.h b/mps/code/eventdef.h index 346b61df5ad..83c7a3850f8 100644 --- a/mps/code/eventdef.h +++ b/mps/code/eventdef.h | |||
| @@ -42,8 +42,7 @@ | |||
| 42 | * These specify: | 42 | * These specify: |
| 43 | * - Type: The name of the event type, without the leading "Event"; | 43 | * - Type: The name of the event type, without the leading "Event"; |
| 44 | * - Code: The unique 16-bit code associated with this event type; | 44 | * - Code: The unique 16-bit code associated with this event type; |
| 45 | * - Always: Whether this event type should appear in optimised | 45 | * - Always: Whether this event type should appear in "hot" varieties, |
| 46 | * varieties, not currently used; | ||
| 47 | * - Kind: Category into which this event falls, without the | 46 | * - Kind: Category into which this event falls, without the |
| 48 | * leading "EventKind"; | 47 | * leading "EventKind"; |
| 49 | * | 48 | * |
| @@ -52,6 +51,9 @@ | |||
| 52 | * in older logs, and prevents the codes being re-used. See | 51 | * in older logs, and prevents the codes being re-used. See |
| 53 | * <design/telemetry/#.reg.code>. | 52 | * <design/telemetry/#.reg.code>. |
| 54 | * | 53 | * |
| 54 | * When you add an event type, you must also add an EVENT_*_PARAMS macro | ||
| 55 | * specify its parameters below. | ||
| 56 | * | ||
| 55 | * TODO: Add a doc string to each event type. | 57 | * TODO: Add a doc string to each event type. |
| 56 | * | 58 | * |
| 57 | * See also EVENT_*_PARAMS for definition of event parameters. | 59 | * See also EVENT_*_PARAMS for definition of event parameters. |
diff --git a/mps/code/eventpro.c b/mps/code/eventpro.c index 439746bf950..842ee11b80d 100644 --- a/mps/code/eventpro.c +++ b/mps/code/eventpro.c | |||
| @@ -5,11 +5,7 @@ | |||
| 5 | */ | 5 | */ |
| 6 | 6 | ||
| 7 | #include "config.h" | 7 | #include "config.h" |
| 8 | /* override variety setting for EVENT */ | ||
| 9 | #define EVENT | ||
| 10 | |||
| 11 | #include "table.h" | 8 | #include "table.h" |
| 12 | |||
| 13 | #include "eventdef.h" | 9 | #include "eventdef.h" |
| 14 | #include "eventcom.h" | 10 | #include "eventcom.h" |
| 15 | #include "eventpro.h" | 11 | #include "eventpro.h" |