packages feed

ghc-events 0.1.0.2 → 0.2

raw patch · 4 files changed

+24/−10 lines, 4 files

Files

GHC/RTS/EventLogFormat.h view
@@ -117,8 +117,11 @@ #define EVENT_STARTUP             17 /* (num_capabilities)     */ #define EVENT_BLOCK_MARKER        18 /* (size, end_time, capability) */ #define EVENT_USER_MSG            19 /* (message ...)          */+#define EVENT_GC_IDLE             20 /* () */+#define EVENT_GC_WORK             21 /* () */+#define EVENT_GC_DONE             22 /* () */ -#define NUM_EVENT_TAGS            20+#define NUM_EVENT_TAGS            23  #if 0  /* DEPRECATED EVENTS: */ #define EVENT_CREATE_SPARK        13 /* (cap, thread) */
GHC/RTS/Events.hs view
@@ -92,7 +92,6 @@  data Event =    Event {-    ref  :: {-# UNPACK #-}!EventTypeNum,     time :: {-# UNPACK #-}!Timestamp,     spec :: EventTypeSpecificInfo   } deriving Show@@ -130,10 +129,14 @@   | RequestSeqGC       { }   | RequestParGC       { }   | StartGC            { }+  | GCWork             { }+  | GCIdle             { }+  | GCDone             { }   | EndGC              { }   | Message            { msg :: String }   | UserMessage        { msg :: String }-  | UnknownEvent+  | UnknownEvent       { ref  :: {-# UNPACK #-}!EventTypeNum }+   deriving Show  --sync with ghc/includes/Constants.h@@ -213,7 +216,7 @@      then return Nothing      else do !ts   <- getE              spec <- getEvSpecInfo etRef-             return (Just (Event etRef ts spec))+             return (Just (Event ts spec))             getEvSpecInfo :: EventTypeNum -> GetEvents EventTypeSpecificInfo getEvSpecInfo num = case fromIntegral num :: Int of@@ -282,8 +285,10 @@  EVENT_REQUEST_PAR_GC -> return RequestParGC   EVENT_GC_START -> return StartGC-- EVENT_GC_END -> return EndGC+ EVENT_GC_WORK  -> return GCWork+ EVENT_GC_IDLE  -> return GCIdle+ EVENT_GC_DONE  -> return GCDone+ EVENT_GC_END   -> return EndGC   EVENT_LOG_MSG -> do -- (msg)   num <- getE :: GetEvents Word16@@ -304,7 +309,7 @@                  Just n  -> return n                  Nothing -> getE :: GetEvents Word16       skip  <- lift . lift $ replicateM_ (fromIntegral bytes) getWord8-      return UnknownEvent+      return UnknownEvent{ ref = num }   getData :: GetEvents Data@@ -450,6 +455,12 @@           printf "starting GC"         EndGC ->           printf "finished GC"+        GCWork ->+          printf "GC working"+        GCIdle ->+          printf "GC idle"+        GCDone ->+          printf "GC done" 	_ ->           printf "unknown event type" 
ShowGhcEvents.hs view
@@ -47,13 +47,13 @@    (case Log.size et of Nothing -> "variable"; Just x -> show x)  ppEvent :: IntMap EventType -> CapEvent -> String-ppEvent imap (CapEvent cap (Event ref time spec)) =+ppEvent imap (CapEvent cap (Event time spec)) =   printf "%9d: " time ++   (case cap of     Nothing -> ""     Just c  -> printf "cap %d: " c) ++   case spec of-    UnknownEvent ->+    UnknownEvent{ ref=ref } ->       printf (Log.desc (fromJust (M.lookup (fromIntegral ref) imap)))      Message msg -> msg
ghc-events.cabal view
@@ -1,5 +1,5 @@ name:             ghc-events-version:          0.1.0.2+version:          0.2 synopsis:         Library and tool for parsing .eventlog files from GHC description:      Parses .eventlog files emitted by GHC 6.12.1 and later.                   Includes the show-ghc-events tool to dump an event