From 7d8c903b5ca7a6a5a6b250e52036d7ba32048647 Mon Sep 17 00:00:00 2001 From: Marty Stumpf Date: Fri, 24 Sep 2021 11:24:49 -0700 Subject: [PATCH] Output to framegraph stack format. --- plutus-tx-plugin/executables/profile/Main.hs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/plutus-tx-plugin/executables/profile/Main.hs b/plutus-tx-plugin/executables/profile/Main.hs index bb1e1bc88ee..7fa89f2ad7b 100644 --- a/plutus-tx-plugin/executables/profile/Main.hs +++ b/plutus-tx-plugin/executables/profile/Main.hs @@ -104,7 +104,7 @@ writeLogToFile fileName values = do WriteMode (\h -> hPutDoc h log) processed <- processLog filePath - writeFile (filePath<>".stacks") $ show processed + writeFile (filePath<>".stacks") processed pure () data Stacks @@ -134,7 +134,11 @@ processLog file = do lVar = map (!! 4) lEvents lTripleTimeVar = zip3 (lUTC lTime) lEnterOrExit lVar stacks = getStacks [] lTripleTimeVar - pure $ map (intercalate "; " . fst) stacks + fnsStacks = map (intercalate "; " . fst) stacks + stacksFgFormat (hdf:tlf) (hdt:tlt)= + hdf<>" "<>show hdt<>"\n":stacksFgFormat tlf tlt + stacksFgFormat _ _ = [] + pure $ concat $ stacksFgFormat fnsStacks (map snd stacks) lUTC :: [String] -> [UTCTime] lUTC = map (read :: String -> UTCTime)