Commit 396b86c0 authored by Simon Marlow's avatar Simon Marlow

average GC work, and fix a regex

parent 5811e9cb
......@@ -132,7 +132,7 @@ gc1count_spec = SpecP "GC(1) Count" "GC1Count" "gc1-count" (meanInt gc1_count)
gc1time_spec = SpecP "GC(1) Time" "GC1Time" "gc1-time" (mean gc1_time) run_status time_ok
gc1elap_spec = SpecP "GC(1) Elapsed Time" "GC1ETime" "gc1-elapsed-time" (mean gc1_elapsed_time) run_status time_ok
balance_spec = SpecP "GC work balance" "Balance" "balance" (mean balance) run_status time_ok
gcwork_spec = SpecP "GC Work" "GCWork" "gc-work" gc_work run_status always_ok
gcwork_spec = SpecP "GC Work" "GCWork" "gc-work" (meanInt gc_work) run_status always_ok
instrs_spec = SpecP "Instructions" "Instrs" "instrs" instrs run_status always_ok
mreads_spec = SpecP "Memory Reads" "Reads" "mem-reads" mem_reads run_status always_ok
mwrite_spec = SpecP "Memory Writes" "Writes" "mem-writes" mem_writes run_status always_ok
......@@ -205,7 +205,7 @@ checkTimes prog results = do
per_prog_result_tab :: [PerProgTableSpec]
per_prog_result_tab =
[ size_spec, alloc_spec, runtime_spec, elapsedtime_spec, muttime_spec, mutetime_spec, gctime_spec,
gcelap_spec, gc0time_spec, gc0elap_spec, gc1time_spec, gc1elap_spec,
gcelap_spec, gc0count_spec, gc0time_spec, gc0elap_spec, gc1count_spec, gc1time_spec, gc1elap_spec,
gcwork_spec, balance_spec, instrs_spec, mreads_spec, mwrite_spec, cmiss_spec, totmem_spec]
-- A single summary table, giving comparison figures for a number of
......@@ -459,7 +459,7 @@ latex_show_results (r:rs) f stat _result_ok norm
TableRow (BoxString "Geometric Mean" : gms) ]
where
-- results_per_prog :: [ (String,[BoxValue a]) ]
results_per_prog = [ (prog,tail xs) | (prog,xs) <- map calc (Map.toList r) ]
results_per_prog = [ (prog,xs) | (prog,xs) <- map calc (Map.toList r) ]
calc = calc_result rs f stat (const True) (normalise norm)
results_per_run = transpose (map snd results_per_prog)
......@@ -851,8 +851,10 @@ showBox (Percentage f) = case printf "%.1f%%" (f-100) of
xs@('-':_) -> xs
xs -> '+':xs
showBox (BoxFloat f) = printf "%.2f" f
showBox (BoxInt n) = show (n `div` (1024*1024))
showBox (BoxInteger n) = show (n `div` (1024*1024))
showBox (BoxInt n) = show n
showBox (BoxInteger n) = show n
--showBox (BoxInt n) = show (n `div` (1024*1024))
--showBox (BoxInteger n) = show (n `div` (1024*1024))
--showBox (BoxInt n) = show (n `div` 1024) ++ "k"
--showBox (BoxInteger n) = show (n `div` 1024) ++ "k"
showBox (BoxString s) = s
......
......@@ -39,7 +39,7 @@ data Results = Results {
mem_reads :: Maybe Integer,
mem_writes :: Maybe Integer,
cache_misses :: Maybe Integer,
gc_work :: Maybe Integer,
gc_work :: [Integer],
gc_time :: [Float],
gc_elapsed_time :: [Float],
gc0_count :: [Int],
......@@ -78,7 +78,7 @@ emptyResults = Results {
gc1_time = [],
gc1_elapsed_time = [],
balance = [],
gc_work = Nothing,
gc_work = [],
allocs = [],
compile_status = NotDone,
run_status = NotDone,
......@@ -193,7 +193,7 @@ ghc6_re s = case matchRegex re s of
Just (read allocations, read gcs, read avg_residency, read max_residency, read samples, read gc_work', 1048576 * read in_use, read initialisation, read initialisation_elapsed, read mut, read mut_elapsed, read gc, read gc_elapsed, read gc0_count, read gc0, read gc0_elapsed, read gc1_count, read gc1, read gc1_elapsed, read bal)
Just _ -> error "ghc3_re: Can't happen"
Nothing -> Nothing
where re = mkRegex "^<<ghc:[ \t]+([0-9]+)[ \t]+bytes,[ \t]*([0-9]+)[ \t]+GCs\\(([0-9]+)[ \t]*\\+[ \t]*([0-9]+)\\),[ \t]*([0-9]+)/([0-9]+)[ \t]+avg/max bytes residency \\(([0-9]+) samples\\), ([0-9]+) bytes GC work, ([0-9]+)M in use, ([0-9.]+) INIT \\(([0-9.]+) elapsed\\), ([0-9.]+) MUT \\(([0-9.]+) elapsed\\), ([0-9.]+) GC \\(([0-9.]+) elapsed\\), ([0-9.]+) GC\\(0\\) \\(([0-9.]+) elapsed\\), ([0-9.]+) GC\\(1\\) \\(([0-9.]+) elapsed\\), ([0-9.]+) balance :ghc>>"
where re = mkRegex "^<<ghc:[ \t]+([0-9]+)[ \t]+bytes,[ \t]*([0-9]+)[ \t]+GCs[ \t]+\\(([0-9]+)[ \t]*\\+[ \t]*([0-9]+)\\),[ \t]*([0-9]+)/([0-9]+)[ \t]+avg/max bytes residency \\(([0-9]+) samples\\), ([0-9]+) bytes GC work, ([0-9]+)M in use, ([0-9.]+) INIT \\(([0-9.]+) elapsed\\), ([0-9.]+) MUT \\(([0-9.]+) elapsed\\), ([0-9.]+) GC \\(([0-9.]+) elapsed\\), ([0-9.]+) GC\\(0\\) \\(([0-9.]+) elapsed\\), ([0-9.]+) GC\\(1\\) \\(([0-9.]+) elapsed\\), ([0-9.]+) balance :ghc>>"
wrong_exit_status, wrong_output, out_of_heap, out_of_stack :: Regex
wrong_exit_status = mkRegex "^\\**[ \t]*expected exit status ([0-9]+) not seen ; got ([0-9]+)"
......@@ -263,7 +263,7 @@ combine2Results
gc1_time = g1t1 ++ g1t2,
gc1_elapsed_time= g1e1 ++ g1e2,
balance = b1 ++ b2,
gc_work = gw1 `mplus` gw2,
gc_work = gw1 ++ gw2,
binary_size = bs1 `mplus` bs2,
allocs = al1 ++ al2,
run_status = combStatus rs1 rs2,
......@@ -372,27 +372,27 @@ parse_run_time prog (l:ls) res ex =
case ghc1_re l of {
Just (allocations, _, _, _, _, _, initialisation, init_elapsed, mut, mut_elapsed, gc, gc_elapsed) ->
got_run_result allocations initialisation init_elapsed mut mut_elapsed gc gc_elapsed [] [] [] [] [] [] []
Nothing Nothing Nothing Nothing Nothing [];
[] Nothing Nothing Nothing Nothing [];
Nothing ->
case ghc2_re l of {
Just (allocations, _, _, _, _, in_use, initialisation, init_elapsed, mut, mut_elapsed, gc, gc_elapsed) ->
got_run_result allocations initialisation init_elapsed mut mut_elapsed gc gc_elapsed [] [] [] [] [] [] []
Nothing Nothing Nothing Nothing Nothing [in_use];
[] Nothing Nothing Nothing Nothing [in_use];
Nothing ->
case ghc3_re l of {
Just (allocations, _, _, _, _, gc_work', in_use, initialisation, init_elapsed, mut, mut_elapsed, gc, gc_elapsed) ->
got_run_result allocations initialisation init_elapsed mut mut_elapsed gc gc_elapsed [] [] [] [] [] [] []
(Just gc_work') Nothing Nothing Nothing Nothing [in_use];
[gc_work'] Nothing Nothing Nothing Nothing [in_use];
Nothing ->
case ghc4_re l of {
Just (allocations, _, _, _, _, gc_work', in_use, initialisation, init_elapsed, mut, mut_elapsed, gc, gc_elapsed, is, mem_rs, mem_ws, cache_misses') ->
got_run_result allocations initialisation init_elapsed mut mut_elapsed gc gc_elapsed [] [] [] [] [] [] []
(Just gc_work') (Just is) (Just mem_rs)
[gc_work'] (Just is) (Just mem_rs)
(Just mem_ws) (Just cache_misses') [in_use];
Nothing ->
......@@ -401,7 +401,7 @@ parse_run_time prog (l:ls) res ex =
Just (allocations, _, _, _, _, gc_work', in_use, initialisation, init_elapsed, mut, mut_elapsed, gc, gc_elapsed, gc0, gc0_elapsed, gc1, gc1_elapsed, bal) ->
got_run_result allocations initialisation init_elapsed mut mut_elapsed gc gc_elapsed
[] [gc0] [gc0_elapsed] [] [gc1] [gc1_elapsed] [bal]
(Just gc_work') Nothing Nothing Nothing Nothing [in_use];
[gc_work'] Nothing Nothing Nothing Nothing [in_use];
Nothing ->
......@@ -409,7 +409,7 @@ parse_run_time prog (l:ls) res ex =
Just (allocations, _, _, _, _, gc_work', in_use, initialisation, init_elapsed, mut, mut_elapsed, gc, gc_elapsed, gc0_count, gc0, gc0_elapsed, gc1_count, gc1, gc1_elapsed, bal) ->
got_run_result allocations initialisation init_elapsed mut mut_elapsed gc gc_elapsed
[gc0_count] [gc0] [gc0_elapsed] [gc1_count] [gc1] [gc1_elapsed] [bal]
(Just gc_work') Nothing Nothing Nothing Nothing [in_use];
[gc_work'] Nothing Nothing Nothing Nothing [in_use];
Nothing ->
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment