Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[shake-bench] collect eventlogs #1324

Merged
merged 4 commits into from Feb 9, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions ghcide/bench/hist/Main.hs
Expand Up @@ -141,6 +141,7 @@ buildGhcide Cabal args out = do
,"--install-method=copy"
,"--overwrite-policy=always"
,"--ghc-options=-rtsopts"
,"--ghc-options=-eventlog"
]

buildGhcide Stack args out =
Expand All @@ -150,6 +151,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
Expand Up @@ -267,8 +267,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 @@ -279,6 +280,7 @@ benchRules build MkBenchRules{..} = do
let exePath = build </> "binaries" </> ver </> executableName
exeExtraArgs =
[ "+RTS"
, "-l-au"
, "-S" <> outGc]
++ concat
[[ "-h"
Expand All @@ -299,6 +301,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