X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=rts%2Feventlog%2FEventLog.c;h=341123530c20d7c3ca0a285d4b852c00e9b568e3;hb=e8d7985d56595f6b8004546bedc41627ca70c528;hp=8e74215dbb04539c7c2a6d27784fa50fc17298c4;hpb=8b18faef8aeaf40150c208272a2fc117611e8ae8;p=ghc-hetmet.git diff --git a/rts/eventlog/EventLog.c b/rts/eventlog/EventLog.c index 8e74215..3411235 100644 --- a/rts/eventlog/EventLog.c +++ b/rts/eventlog/EventLog.c @@ -48,7 +48,8 @@ char *EventDesc[] = { "Request sequential GC", "Request parallel GC", "Starting GC", - "Finished GC" + "Finished GC", + "Create spark" }; // Event type. @@ -78,17 +79,50 @@ static void postEventType(EventsBuf *eb, EventType *et); static StgBool hasRoomForEvent(EventsBuf *eb, EventTypeNum eNum); -static inline void postInt8(EventsBuf *eb, StgInt8 i); -static inline void postInt16(EventsBuf *eb, StgInt16 i); -static inline void postInt32(EventsBuf *eb, StgInt32 i); -static inline void postInt64(EventsBuf *eb, StgInt64 i); -static inline void postWord8(EventsBuf *eb, StgWord8 i); -static inline void postWord16(EventsBuf *eb, StgWord16 i); -static inline void postWord32(EventsBuf *eb, StgWord32 i); -static inline void postWord64(EventsBuf *eb, StgWord64 i); +static inline void postWord8(EventsBuf *eb, StgWord8 i) +{ + *(eb->pos++) = i; +} + +static inline void postWord16(EventsBuf *eb, StgWord16 i) +{ + postWord8(eb, (StgWord8)(i >> 8)); + postWord8(eb, (StgWord8)i); +} + +static inline void postWord32(EventsBuf *eb, StgWord32 i) +{ + postWord16(eb, (StgWord16)(i >> 16)); + postWord16(eb, (StgWord16)i); +} + +static inline void postWord64(EventsBuf *eb, StgWord64 i) +{ + postWord32(eb, (StgWord32)(i >> 32)); + postWord32(eb, (StgWord32)i); +} + +static inline void postEventTypeNum(EventsBuf *eb, EventTypeNum etNum) +{ postWord16(eb, etNum); } + +static inline void postEventTypeID(EventsBuf *eb, StgWord16 etID) +{ postWord16(eb, etID); } + +static inline void postTimestamp(EventsBuf *eb, Timestamp t) +{ postWord64(eb,t); } + +static inline void postInt8(EventsBuf *eb, StgInt8 i) +{ postWord8(eb, (StgWord8)i); } + +static inline void postInt16(EventsBuf *eb, StgInt16 i) +{ postWord16(eb, (StgWord16)i); } + +static inline void postInt32(EventsBuf *eb, StgInt32 i) +{ postWord32(eb, (StgWord32)i); } + +static inline void postInt64(EventsBuf *eb, StgInt64 i) +{ postWord64(eb, (StgWord64)i); } -static inline void postEventTypeNum(EventsBuf *eb, EventTypeNum etNum); -static inline void postTimestamp(EventsBuf *eb, Timestamp t); void initEventLogging(void) @@ -143,6 +177,7 @@ initEventLogging(void) case EVENT_CREATE_THREAD: // (cap, thread) case EVENT_RUN_THREAD: // (cap, thread) case EVENT_THREAD_RUNNABLE: // (cap, thread) + case EVENT_CREATE_SPARK: // (cap, thread) case EVENT_RUN_SPARK: // (cap, thread) eventTypes[t].size = sizeof(CapabilityNum) + sizeof(ThreadID); break; @@ -265,6 +300,7 @@ postEvent_(Capability *cap, EventTypeNum tag, StgThreadID thread, nat other_cap) case EVENT_CREATE_THREAD: // (cap, thread) case EVENT_RUN_THREAD: // (cap, thread) case EVENT_THREAD_RUNNABLE: // (cap, thread) + case EVENT_CREATE_SPARK: // (cap, thread) case EVENT_RUN_SPARK: // (cap, thread) { postWord64(eb,thread); @@ -420,48 +456,4 @@ static void postEventType(EventsBuf *eb, EventType *et) postInt32(eb, EVENT_ET_END); } -static inline void postEventTypeNum(EventsBuf *eb, EventTypeNum etNum) -{ postWord16(eb, etNum); } - -static inline void postEventTypeID(EventsBuf *eb, StgWord16 etID) -{ postWord16(eb, etID); } - -static inline void postTimestamp(EventsBuf *eb, Timestamp t) -{ postWord64(eb,t); } - -static inline void postInt8(EventsBuf *eb, StgInt8 i) -{ postWord8(eb, (StgWord8)i); } - -static inline void postInt16(EventsBuf *eb, StgInt16 i) -{ postWord16(eb, (StgWord16)i); } - -static inline void postInt32(EventsBuf *eb, StgInt32 i) -{ postWord32(eb, (StgWord32)i); } - -static inline void postInt64(EventsBuf *eb, StgInt64 i) -{ postWord64(eb, (StgWord64)i); } - -static inline void postWord8(EventsBuf *eb, StgWord8 i) -{ - *(eb->pos++) = i; -} - -static inline void postWord16(EventsBuf *eb, StgWord16 i) -{ - postWord8(eb, (StgWord8)(i >> 8)); - postWord8(eb, (StgWord8)i); -} - -static inline void postWord32(EventsBuf *eb, StgWord32 i) -{ - postWord16(eb, (StgWord16)(i >> 16)); - postWord16(eb, (StgWord16)i); -} - -static inline void postWord64(EventsBuf *eb, StgWord64 i) -{ - postWord32(eb, (StgWord32)(i >> 32)); - postWord32(eb, (StgWord32)i); -} - #endif /* EVENTLOG */