From c90ba254c42d3046b7a2e53b04e06954621e2713 Mon Sep 17 00:00:00 2001 From: Pepe Iborra Date: Tue, 14 Dec 2021 19:38:51 +0000 Subject: [PATCH] Fix tracing of recordDirtyKeys --- ghcide/src/Development/IDE/Core/Shake.hs | 2 +- ghcide/src/Development/IDE/Core/Tracing.hs | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ghcide/src/Development/IDE/Core/Shake.hs b/ghcide/src/Development/IDE/Core/Shake.hs index da4264f8e7..fa4b18a67b 100644 --- a/ghcide/src/Development/IDE/Core/Shake.hs +++ b/ghcide/src/Development/IDE/Core/Shake.hs @@ -455,7 +455,7 @@ recordDirtyKeys recordDirtyKeys ShakeExtras{dirtyKeys} key file = do modifyTVar' dirtyKeys $ \x -> foldl' (flip HSet.insert) x (toKey key <$> file) return $ withEventTrace "recordDirtyKeys" $ \addEvent -> do - addEvent (fromString $ "dirty " <> show key) (fromString $ unlines $ map fromNormalizedFilePath file) + addEvent (fromString $ unlines $ "dirty " <> show key : map fromNormalizedFilePath file) -- | We return Nothing if the rule has not run and Just Failed if it has failed to produce a value. getValues :: diff --git a/ghcide/src/Development/IDE/Core/Tracing.hs b/ghcide/src/Development/IDE/Core/Tracing.hs index 629e0956b0..60bdc9fec5 100644 --- a/ghcide/src/Development/IDE/Core/Tracing.hs +++ b/ghcide/src/Development/IDE/Core/Tracing.hs @@ -71,11 +71,11 @@ import qualified StmContainers.Map as STM #if MIN_VERSION_ghc(8,8,0) otTracedProvider :: MonadUnliftIO m => PluginId -> ByteString -> m a -> m a otTracedGarbageCollection :: (MonadMask f, MonadIO f, Show a) => ByteString -> f [a] -> f [a] -withEventTrace :: (MonadMask m, MonadIO m) => String -> ((ByteString -> ByteString -> m ()) -> m a) -> m a +withEventTrace :: (MonadMask m, MonadIO m) => String -> ((ByteString -> m ()) -> m a) -> m a #else otTracedProvider :: MonadUnliftIO m => PluginId -> String -> m a -> m a otTracedGarbageCollection :: (MonadMask f, MonadIO f, Show a) => String -> f [a] -> f [a] -withEventTrace :: (MonadMask m, MonadIO m) => String -> ((String -> ByteString -> m ()) -> m a) -> m a +withEventTrace :: (MonadMask m, MonadIO m) => String -> ((ByteString -> m ()) -> m a) -> m a #endif withTrace :: (MonadMask m, MonadIO m) => @@ -90,8 +90,8 @@ withTrace name act withEventTrace name act | userTracingEnabled = withSpan (fromString name) $ \sp -> do - act (addEvent sp) - | otherwise = act (\_ _ -> pure ()) + act (addEvent sp "") + | otherwise = act (\_ -> pure ()) -- | Returns a logger that produces telemetry events in a single span withTelemetryLogger :: (MonadIO m, MonadMask m) => (Logger -> m a) -> m a