From 28c9bb13f3ab2336420b2aed345cef034759385e Mon Sep 17 00:00:00 2001 From: Richard Brooksby Date: Fri, 31 Aug 2012 17:26:48 +0100 Subject: [PATCH] Cool varieties now log events on the critical path too, whereas hot varieties only log elsewhere. Copied from Perforce Change: 179140 ServerID: perforce.ravenbrook.com --- mps/code/config.h | 12 ++++++++++-- mps/code/event.h | 2 +- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/mps/code/config.h b/mps/code/config.h index 0685c84fd4b..a6dd9198eb4 100644 --- a/mps/code/config.h +++ b/mps/code/config.h @@ -68,12 +68,14 @@ /* ... let PRODUCT determine CHECKLEVEL_INITIAL */ #define CONFIG_STATS #define CONFIG_LOG +#define CONFIG_LOG_ALL #elif defined(CONFIG_VAR_II) /* Ice, Internal; variety.ii (HotLog) */ #define CONFIG_ASSERT #define CHECKLEVEL_INITIAL CheckLevelMINIMAL /* no statistic meters */ #define CONFIG_LOG + #endif @@ -110,11 +112,17 @@ #if defined(CONFIG_LOG) /* TELEMETRY = LOG = EVENTs */ #define EVENT +#if defined(CONFIG_LOG_ALL) +#define EVENT_ALL 1 /* log events on critical path */ +#define MPS_LOG_STRING "logtastic" +#else /* CONFIG_LOG_ALL, not */ +#define EVENT_ALL 0 /* don't log events on critical path */ #define MPS_LOG_STRING "logging" -#else +#endif /* CONFIG_LOG_ALL */ +#else /* CONFIG_LOG, not */ #define EVENT_NONE #define MPS_LOG_STRING "nonlogging" -#endif +#endif /* CONFIG_LOG */ #define MPS_VARIETY_STRING \ diff --git a/mps/code/event.h b/mps/code/event.h index 4694dc820c0..7734fa8cb9e 100644 --- a/mps/code/event.h +++ b/mps/code/event.h @@ -52,7 +52,7 @@ extern Word EventKindControl; #define EVENT_BEGIN(name, structSize) \ BEGIN \ - if(Event##name##Always) { /* FIXME: depend on variety */ \ + if(EVENT_ALL || Event##name##Always) { /* see config.h */ \ Event##name##Struct *_event; \ size_t _size = size_tAlignUp(structSize, MPS_PF_ALIGN); \ if (_size > (size_t)(EventLast[Event##name##Kind] \