summaryrefslogtreecommitdiff
path: root/rts/Schedule.c
diff options
context:
space:
mode:
authorDuncan Coutts <duncan@well-typed.com>2012-02-03 12:20:36 +0000
committerDuncan Coutts <duncan@well-typed.com>2012-04-04 19:10:44 +0100
commitf9c2e8543cabd6661eec17d5be31469455a64e05 (patch)
tree3275bbb0e2bbcd4d8bd003584d478c0ad1e4c107 /rts/Schedule.c
parent4caef1c42dd5b6e4982e7f07162c9a7edc5a1b0b (diff)
downloadhaskell-f9c2e8543cabd6661eec17d5be31469455a64e05.tar.gz
Add eventlog/trace stuff for capabilities: create/delete/enable/disable
Now that we can adjust the number of capabilities on the fly, we need this reflected in the eventlog. Previously the eventlog had a single startup event that declared a static number of capabilities. Obviously that's no good anymore. For compatability we're keeping the EVENT_STARTUP but adding new EVENT_CAP_CREATE/DELETE. The EVENT_CAP_DELETE is actually just the old EVENT_SHUTDOWN but renamed and extended (using the existing mechanism to extend eventlog events in a compatible way). So we now emit both EVENT_STARTUP and EVENT_CAP_CREATE. One day we will drop EVENT_STARTUP. Since reducing the number of capabilities at runtime does not really delete them, it just disables them, then we also have new events for disable/enable. The old EVENT_SHUTDOWN was in the scheduler class of events. The new EVENT_CAP_* events are in the unconditional class, along with the EVENT_CAPSET_* ones. Knowing when capabilities are created and deleted is crucial to making sense of eventlogs, you always want those events. In any case, they're extremely low volume.
Diffstat (limited to 'rts/Schedule.c')
-rw-r--r--rts/Schedule.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/rts/Schedule.c b/rts/Schedule.c
index 7dca76438b..f3ab30b4b4 100644
--- a/rts/Schedule.c
+++ b/rts/Schedule.c
@@ -1985,6 +1985,7 @@ setNumCapabilities (nat new_n_capabilities USED_IF_THREADS)
//
for (n = new_n_capabilities; n < enabled_capabilities; n++) {
capabilities[n].disabled = rtsTrue;
+ traceCapDisable(&capabilities[n]);
}
enabled_capabilities = new_n_capabilities;
}
@@ -1996,6 +1997,7 @@ setNumCapabilities (nat new_n_capabilities USED_IF_THREADS)
for (n = enabled_capabilities;
n < new_n_capabilities && n < n_capabilities; n++) {
capabilities[n].disabled = rtsFalse;
+ traceCapEnable(&capabilities[n]);
}
enabled_capabilities = n;
@@ -2003,7 +2005,8 @@ setNumCapabilities (nat new_n_capabilities USED_IF_THREADS)
#if defined(TRACING)
// Allocate eventlog buffers for the new capabilities. Note this
// must be done before calling moreCapabilities(), because that
- // will emit events to add the new capabilities to capsets.
+ // will emit events about creating the new capabilities and adding
+ // them to existing capsets.
tracingAddCapapilities(n_capabilities, new_n_capabilities);
#endif