Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC
Commits:
-
3d6492ce
by Wen Kokke at 2026-03-26T03:57:53-04:00
1 changed file:
Changes:
| ... | ... | @@ -161,6 +161,8 @@ static void freeEventLoggingBuffer(void); |
| 161 | 161 | static void ensureRoomForEvent(EventsBuf *eb, EventTypeNum tag);
|
| 162 | 162 | static int ensureRoomForVariableEvent(EventsBuf *eb, StgWord size);
|
| 163 | 163 | |
| 164 | +static void flushEventLog_(Capability **cap USED_IF_THREADS);
|
|
| 165 | + |
|
| 164 | 166 | static inline void postWord8(EventsBuf *eb, StgWord8 i)
|
| 165 | 167 | {
|
| 166 | 168 | *(eb->pos++) = i;
|
| ... | ... | @@ -491,7 +493,7 @@ endEventLogging(void) |
| 491 | 493 | |
| 492 | 494 | eventlog_enabled = false;
|
| 493 | 495 | |
| 494 | - flushEventLog(NULL);
|
|
| 496 | + flushEventLog_(NULL);
|
|
| 495 | 497 | |
| 496 | 498 | ACQUIRE_LOCK(&eventBufMutex);
|
| 497 | 499 | |
| ... | ... | @@ -1615,6 +1617,17 @@ void flushAllCapsEventsBufs(void) |
| 1615 | 1617 | }
|
| 1616 | 1618 | |
| 1617 | 1619 | void flushEventLog(Capability **cap USED_IF_THREADS)
|
| 1620 | +{
|
|
| 1621 | + ACQUIRE_LOCK(&state_change_mutex);
|
|
| 1622 | + flushEventLog_(cap);
|
|
| 1623 | + RELEASE_LOCK(&state_change_mutex);
|
|
| 1624 | +}
|
|
| 1625 | + |
|
| 1626 | +// This is an unsafe version of flushEventLog that does not acquire/release the
|
|
| 1627 | +// state_change mutex. It is for internal use only and should only be used when
|
|
| 1628 | +// (1) you're sure that there's no chance of racing with start/endEventLogging,
|
|
| 1629 | +// and (2) there is an event_log_writer.
|
|
| 1630 | +static void flushEventLog_(Capability **cap USED_IF_THREADS)
|
|
| 1618 | 1631 | {
|
| 1619 | 1632 | if (!event_log_writer) {
|
| 1620 | 1633 | return;
|
| ... | ... | @@ -1644,7 +1657,7 @@ void flushEventLog(Capability **cap USED_IF_THREADS) |
| 1644 | 1657 | flushEventLogWriter();
|
| 1645 | 1658 | }
|
| 1646 | 1659 | |
| 1647 | -#else
|
|
| 1660 | +#else /*!TRACING*/
|
|
| 1648 | 1661 | |
| 1649 | 1662 | enum EventLogStatus eventLogStatus(void)
|
| 1650 | 1663 | {
|