Skip to content

Commit

Permalink
[shake-bench] collect eventlogs (#1324)
Browse files Browse the repository at this point in the history
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
  • Loading branch information
pepeiborra and mergify[bot] authored Feb 9, 2021
1 parent 21cdce2 commit 9bb3bb7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 2 additions & 0 deletions ghcide/bench/hist/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ buildGhcide Cabal args out = do
,"--install-method=copy"
,"--overwrite-policy=always"
,"--ghc-options=-rtsopts"
,"--ghc-options=-eventlog"
]

buildGhcide Stack args out =
Expand All @@ -156,6 +157,7 @@ buildGhcide Stack args out =
,"ghcide:ghcide"
,"--copy-bins"
,"--ghc-options=-rtsopts"
,"--ghc-options=-eventlog"
]

benchGhcide
Expand Down
5 changes: 4 additions & 1 deletion shake-bench/src/Development/Benchmark/Rules.hs
Original file line number Diff line number Diff line change
Expand Up @@ -290,8 +290,9 @@ benchRules build MkBenchRules{..} = do
[ build -/- "*/*/*/*.csv",
build -/- "*/*/*/*.gcStats.log",
build -/- "*/*/*/*.output.log",
build -/- "*/*/*/*.eventlog",
build -/- "*/*/*/*.hp"
] &%> \[outcsv, outGc, outLog, outHp] -> do
] &%> \[outcsv, outGc, outLog, outEventlog, outHp] -> do
let [_, flavour, exampleName, ver, exp] = splitDirectories outcsv
prof = fromMaybe (error $ "Not a valid profiling mode: " <> flavour) $ profilingP flavour
example <- fromMaybe (error $ "Unknown example " <> exampleName)
Expand All @@ -302,6 +303,7 @@ benchRules build MkBenchRules{..} = do
let exePath = build </> "binaries" </> ver </> executableName
exeExtraArgs =
[ "+RTS"
, "-l-au"
, "-S" <> outGc]
++ concat
[[ "-h"
Expand All @@ -323,6 +325,7 @@ benchRules build MkBenchRules{..} = do
AddPath [takeDirectory ghcPath, "."] []
]
BenchProject {..}
liftIO $ renameFile "ghcide.eventlog" outEventlog
liftIO $ case prof of
CheapHeapProfiling{} -> renameFile "ghcide.hp" outHp
NoProfiling -> writeFile outHp dummyHp
Expand Down

0 comments on commit 9bb3bb7

Please sign in to comment.