@@ -49,6 +49,7 @@ module Development.Benchmark.Rules
49
49
benchRules , MkBenchRules (.. ), BenchProject (.. ),
50
50
csvRules ,
51
51
svgRules ,
52
+ eventlogRules ,
52
53
allTargets ,
53
54
GetExample (.. ), GetExamples (.. ),
54
55
IsExample (.. ), RuleResultForExample ,
@@ -134,11 +135,11 @@ allTargets buildFolder = do
134
135
++ [ buildFolder </>
135
136
getExampleName ex </>
136
137
T. unpack (humanName ver) </>
137
- escaped (escapeExperiment e) <.> mode <.> " svg "
138
+ escaped (escapeExperiment e) <.> mode
138
139
| e <- experiments,
139
140
ex <- examples,
140
141
ver <- versions,
141
- mode <- [" " , " diff" ]
142
+ mode <- [" svg " , " diff.svg " , " eventlog.html " ]
142
143
]
143
144
144
145
--------------------------------------------------------------------------------
@@ -224,17 +225,19 @@ benchRules build benchResource MkBenchRules{..} = do
224
225
priority 0 $
225
226
[ build -/- " */*/*.csv" ,
226
227
build -/- " */*/*.benchmark-gcStats" ,
228
+ build -/- " */*/*.eventlog" ,
229
+ build -/- " */*/*.hp" ,
227
230
build -/- " */*/*.log"
228
231
]
229
- &%> \ [outcsv, outGc, outLog] -> do
232
+ &%> \ [outcsv, outGc, outEventLog, outHp, outLog] -> do
230
233
let [_, exampleName, ver, exp ] = splitDirectories outcsv
231
234
example <- fromMaybe (error $ " Unknown example " <> exampleName)
232
235
<$> askOracle (GetExample exampleName)
233
236
buildSystem <- askOracle $ GetBuildSystem ()
234
237
setupRes <- setupProject
235
238
liftIO $ createDirectoryIfMissing True $ dropFileName outcsv
236
239
let exePath = build </> " binaries" </> ver </> executableName
237
- exeExtraArgs = [" +RTS" , " -I0.5 " , " -S " <> takeFileName outGc, " -RTS" ]
240
+ exeExtraArgs = [" +RTS" , " -l-a " , " -h " , " -ol " <> outEventLog, " -S " <> outGc, " -RTS" ]
238
241
ghcPath = build </> " binaries" </> ver </> " ghc.path"
239
242
experiment = Escaped $ dropExtension exp
240
243
need [exePath, ghcPath]
@@ -247,8 +250,8 @@ benchRules build benchResource MkBenchRules{..} = do
247
250
RemEnv " GHC_PACKAGE_PATH" ,
248
251
AddPath [takeDirectory ghcPath, " ." ] []
249
252
]
250
- BenchProject {.. }
251
- cmd_ Shell $ " mv *.benchmark-gcStats " <> dropFileName outcsv
253
+ BenchProject {.. }
254
+ cmd_ Shell $ " mv ghcide.hp " <> dropFileName outcsv </> dropExtension exp <.> " hp "
252
255
253
256
-- extend csv output with allocation data
254
257
csvContents <- liftIO $ lines <$> readFile outcsv
@@ -378,6 +381,11 @@ svgRules build = do
378
381
title = show (unescapeExperiment exp ) <> " - live bytes over time"
379
382
plotDiagram False diagram out
380
383
384
+ eventlogRules :: FilePattern -> Rules ()
385
+ eventlogRules build = do
386
+ build -/- " */*/*.eventlog.html" %> \ out -> do
387
+ need [dropExtension out]
388
+ cmd_ $ " eventlog2html " <> dropExtension out
381
389
382
390
--------------------------------------------------------------------------------
383
391
--------------------------------------------------------------------------------
0 commit comments