summaryrefslogtreecommitdiff
path: root/rts/eventlog
diff options
context:
space:
mode:
authorDuncan Coutts <duncan@well-typed.com>2011-05-23 00:10:21 +0100
committerDuncan Coutts <duncan@well-typed.com>2011-05-23 00:10:21 +0100
commit96d64fe2175d829f9499656750d51cf577ff9892 (patch)
treed2f784f6086b830d7429e1b77904f5e500e4e95d /rts/eventlog
parente7dcbdc7b68275d23debfec5f17074c55212eeb1 (diff)
downloadhaskell-96d64fe2175d829f9499656750d51cf577ff9892.tar.gz
Revert "Add capability sets to the event system. Contains code from Duncan Coutts."
This reverts commit 58532eb46041aec8d4cbb48b054cb5b001edb43c. Turns out it didn't work on Windows and it'll need some non-trivial changes to make it work on Windows. We'll get it in later once that's sorted out.
Diffstat (limited to 'rts/eventlog')
-rw-r--r--rts/eventlog/EventLog.c149
-rw-r--r--rts/eventlog/EventLog.h29
2 files changed, 1 insertions, 177 deletions
diff --git a/rts/eventlog/EventLog.c b/rts/eventlog/EventLog.c
index d2e3de35ff..a77c257e1b 100644
--- a/rts/eventlog/EventLog.c
+++ b/rts/eventlog/EventLog.c
@@ -75,15 +75,7 @@ char *EventDesc[] = {
[EVENT_GC_IDLE] = "GC idle",
[EVENT_GC_WORK] = "GC working",
[EVENT_GC_DONE] = "GC done",
- [EVENT_BLOCK_MARKER] = "Block marker",
- [EVENT_CAPSET_CREATE] = "Create capability set",
- [EVENT_CAPSET_DELETE] = "Delete capability set",
- [EVENT_CAPSET_ASSIGN_CAP] = "Add capability to capability set",
- [EVENT_CAPSET_REMOVE_CAP] = "Remove capability from capability set",
- [EVENT_RTS_IDENTIFIER] = "Identify the RTS version",
- [EVENT_PROGRAM_ARGS] = "Identify the program arguments",
- [EVENT_PROGRAM_ENV] = "Identify the environment variables",
- [EVENT_OSPROCESS_PID] = "Identify the process ID of a capability set"
+ [EVENT_BLOCK_MARKER] = "Block marker"
};
// Event type.
@@ -154,12 +146,6 @@ static inline void postThreadID(EventsBuf *eb, EventThreadID id)
static inline void postCapNo(EventsBuf *eb, EventCapNo no)
{ postWord16(eb,no); }
-static inline void postCapsetID(EventsBuf *eb, EventCapsetID id)
-{ postWord32(eb,id); }
-
-static inline void postCapsetType(EventsBuf *eb, EventCapsetType type)
-{ postWord16(eb,type); }
-
static inline void postPayloadSize(EventsBuf *eb, EventPayloadSize size)
{ postWord16(eb,size); }
@@ -273,26 +259,6 @@ initEventLogging(void)
eventTypes[t].size = sizeof(EventCapNo);
break;
- case EVENT_CAPSET_CREATE: // (capset, capset_type)
- eventTypes[t].size =
- sizeof(EventCapsetID) + sizeof(EventCapsetType);
- break;
-
- case EVENT_CAPSET_DELETE: // (capset)
- eventTypes[t].size = sizeof(EventCapsetID);
- break;
-
- case EVENT_CAPSET_ASSIGN_CAP: // (capset, cap)
- case EVENT_CAPSET_REMOVE_CAP:
- eventTypes[t].size =
- sizeof(EventCapsetID) + sizeof(EventCapNo);
- break;
-
- case EVENT_OSPROCESS_PID: // (cap, pid, parent pid)
- eventTypes[t].size =
- sizeof(EventCapsetID) + 2*sizeof(StgWord32);
- break;
-
case EVENT_SHUTDOWN: // (cap)
case EVENT_REQUEST_SEQ_GC: // (cap)
case EVENT_REQUEST_PAR_GC: // (cap)
@@ -306,9 +272,6 @@ initEventLogging(void)
case EVENT_LOG_MSG: // (msg)
case EVENT_USER_MSG: // (msg)
- case EVENT_RTS_IDENTIFIER: // (capset, str)
- case EVENT_PROGRAM_ARGS: // (capset, strvec)
- case EVENT_PROGRAM_ENV: // (capset, strvec)
eventTypes[t].size = 0xffff;
break;
@@ -480,116 +443,6 @@ postSchedEvent (Capability *cap,
}
}
-void postCapsetModifyEvent (EventTypeNum tag,
- EventCapsetID capset,
- StgWord32 other,
- StgWord32 other2)
-{
- ACQUIRE_LOCK(&eventBufMutex);
-
- if (!hasRoomForEvent(&eventBuf, tag)) {
- // Flush event buffer to make room for new event.
- printAndClearEventBuf(&eventBuf);
- }
-
- postEventHeader(&eventBuf, tag);
- postCapsetID(&eventBuf, capset);
-
- switch (tag) {
- case EVENT_CAPSET_CREATE: // (capset, capset_type)
- {
- postCapsetType(&eventBuf, other /* capset_type */);
- break;
- }
-
- case EVENT_CAPSET_DELETE: // (capset)
- {
- break;
- }
-
- case EVENT_CAPSET_ASSIGN_CAP: // (capset, capno)
- case EVENT_CAPSET_REMOVE_CAP: // (capset, capno)
- {
- postCapNo(&eventBuf, other /* capno */);
- break;
- }
- case EVENT_OSPROCESS_PID:
- {
- postWord32(&eventBuf, other);
- postWord32(&eventBuf, other2);
- break;
- }
- default:
- barf("postCapsetModifyEvent: unknown event tag %d", tag);
- }
-
- RELEASE_LOCK(&eventBufMutex);
-}
-
-void postCapsetStrEvent (EventTypeNum tag,
- EventCapsetID capset,
- char *msg)
-{
- int strsize = strlen(msg);
- int size = strsize + sizeof(EventCapsetID)
-
- ACQUIRE_LOCK(&eventBufMutex);
-
- if (!hasRoomForVariableEvent(&eventBuf, size)){
- printAndClearEventBuf(&eventBuf);
-
- if (!hasRoomForVariableEvent(&eventBuf, size)){
- // Event size exceeds buffer size, bail out:
- RELEASE_LOCK(&eventBufMutex);
- return;
- }
- }
-
- postEventHeader(&eventBuf, tag);
- postPayloadSize(&eventBuf, size);
- postCapsetID(&eventBuf, capset);
-
- postBuf(&eventBuf, (StgWord8*) msg, strsize);
-
- RELEASE_LOCK(&eventBufMutex);
-}
-
-void postCapsetVecEvent (EventTypeNum tag,
- EventCapsetID capset,
- int argc,
- char *argv[])
-{
- int i, size = sizeof(EventCapsetID);
-
- for (i = 0; i < argc; i++) {
- // 1 + strlen to account for the trailing \0, used as separator
- size += 1 + strlen(argv[i]);
- }
-
- ACQUIRE_LOCK(&eventBufMutex);
-
- if (!hasRoomForVariableEvent(&eventBuf, size)){
- printAndClearEventBuf(&eventBuf);
-
- if(!hasRoomForVariableEvent(&eventBuf, size)){
- // Event size exceeds buffer size, bail out:
- RELEASE_LOCK(&eventBufMutex);
- return;
- }
- }
-
- postEventHeader(&eventBuf, tag);
- postPayloadSize(&eventBuf, size);
- postCapsetID(&eventBuf, capset);
-
- for( i = 0; i < argc; i++ ) {
- // again, 1 + to account for \0
- postBuf(&eventBuf, (StgWord8*) argv[i], 1 + strlen(argv[i]));
- }
-
- RELEASE_LOCK(&eventBufMutex);
-}
-
void
postEvent (Capability *cap, EventTypeNum tag)
{
diff --git a/rts/eventlog/EventLog.h b/rts/eventlog/EventLog.h
index 26a2e944bf..0cfab5c091 100644
--- a/rts/eventlog/EventLog.h
+++ b/rts/eventlog/EventLog.h
@@ -35,29 +35,6 @@ void postSchedEvent(Capability *cap, EventTypeNum tag,
StgThreadID id, StgWord info1, StgWord info2);
/*
- * Post a capability set modification event
- */
-void postCapsetModifyEvent (EventTypeNum tag,
- EventCapsetID capset,
- StgWord32 other,
- StgWord32 other2);
-
-/*
- * Post a capability set event with a string payload
- */
-void postCapsetStrEvent (EventTypeNum tag,
- EventCapsetID capset,
- char *msg);
-
-/*
- * Post a capability set event with several strings payload
- */
-void postCapsetVecEvent (EventTypeNum tag,
- EventCapsetID capset,
- int argc,
- char *msg[]);
-
-/*
* Post a nullary event.
*/
void postEvent(Capability *cap, EventTypeNum tag);
@@ -77,12 +54,6 @@ INLINE_HEADER void postSchedEvent (Capability *cap STG_UNUSED,
StgWord info2 STG_UNUSED)
{ /* nothing */ }
-INLINE_HEADER void postCapsetModifyEvent (EventTypeNum tag STG_UNUSED,
- EventCapsetID capset STG_UNUSED,
- StgWord32 other STG_UNUSED,
- StgWord32 other2 STG_UNUSED)
-{ /* nothing */ }
-
INLINE_HEADER void postEvent (Capability *cap STG_UNUSED,
EventTypeNum tag STG_UNUSED)
{ /* nothing */ }