X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=GHC%2FExts.hs;h=661f5aa275934b6bb43909afd65606ef6f69d72c;hb=bad25ed6cb9b939d786e53d3074f0cd4f869af28;hp=668d30a2ae4da2d7738c99bf7371f0c4986c8a47;hpb=8afc9fecd586d3c4f7ef9c69fb1686a79e5f441d;p=ghc-base.git diff --git a/GHC/Exts.hs b/GHC/Exts.hs index 668d30a..661f5aa 100644 --- a/GHC/Exts.hs +++ b/GHC/Exts.hs @@ -41,7 +41,10 @@ module GHC.Exts lazy, inline, -- * Transform comprehensions - Down(..), groupWith, sortWith, the + Down(..), groupWith, sortWith, the, + + -- * Event logging + traceEvent ) where @@ -49,12 +52,14 @@ import Prelude import GHC.Prim import GHC.Base +import GHC.Magic import GHC.Word import GHC.Int -- import GHC.Float import GHC.Ptr import Data.String import Data.List +import Foreign.C -- XXX This should really be in Data.Tuple, where the definitions are maxTupleSize :: Int @@ -97,3 +102,11 @@ groupByFB c n eq xs0 = groupByFBCore xs0 groupByFBCore (x:xs) = c (x:ys) (groupByFBCore zs) where (ys, zs) = span (eq x) xs + +-- ----------------------------------------------------------------------------- +-- tracing + +traceEvent :: String -> IO () +traceEvent msg = do + withCString msg $ \(Ptr p) -> IO $ \s -> + case traceEvent# p s of s' -> (# s', () #)