Commit ddacc40c authored by simonmar@microsoft.com's avatar simonmar@microsoft.com
Browse files

add GC elapsed time

parent a72c58ad
......@@ -102,7 +102,7 @@ data PerModuleTableSpec =
(a -> Bool) -- Result within reasonable limits?
-- The various per-program aspects of execution that we can generate results for.
size_spec, alloc_spec, runtime_spec, muttime_spec, gctime_spec,
size_spec, alloc_spec, runtime_spec, muttime_spec, gctime_spec, gcelap_spec,
gcwork_spec, instrs_spec, mreads_spec, mwrite_spec, cmiss_spec
:: PerProgTableSpec
size_spec = SpecP "Binary Sizes" "Size" "binary-sizes" binary_size compile_status always_ok
......@@ -110,6 +110,7 @@ alloc_spec = SpecP "Allocations" "Allocs" "allocations" allocs run_status alwa
runtime_spec = SpecP "Run Time" "Runtime" "run-times" (mean run_time) run_status time_ok
muttime_spec = SpecP "Mutator Time" "MutTime" "mutator-time" (mean mut_time) run_status time_ok
gctime_spec = SpecP "GC Time" "GCTime" "gc-time" (mean gc_time) run_status time_ok
gcelap_spec = SpecP "GC Elapsed Time" "GCETime" "gc-elapsed-time" (mean gc_elapsed_time) run_status time_ok
gcwork_spec = SpecP "GC Work" "GCWork" "gc-work" 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
......@@ -123,6 +124,7 @@ all_specs = [
runtime_spec,
muttime_spec,
gctime_spec,
gcelap_spec,
gcwork_spec,
instrs_spec,
mreads_spec,
......@@ -166,6 +168,7 @@ checkTimes prog results = do
per_prog_result_tab :: [PerProgTableSpec]
per_prog_result_tab =
[ size_spec, alloc_spec, runtime_spec, muttime_spec, gctime_spec,
gcelap_spec,
gcwork_spec, instrs_spec, mreads_spec, mwrite_spec, cmiss_spec ]
-- A single summary table, giving comparison figures for a number of
......
......@@ -40,6 +40,7 @@ data Results = Results {
cache_misses :: Maybe Integer,
gc_work :: Maybe Integer,
gc_time :: [Float],
gc_elapsed_time :: [Float],
allocs :: Maybe Integer,
run_status :: Status,
compile_status :: Status
......@@ -58,6 +59,7 @@ emptyResults = Results {
mem_writes = Nothing,
cache_misses = Nothing,
gc_time = [],
gc_elapsed_time = [],
gc_work = Nothing,
allocs = Nothing,
compile_status = NotDone,
......@@ -183,7 +185,7 @@ combine2Results
run_time = rt1, mut_time = mt1,
instrs = is1, mem_reads = mr1, mem_writes = mw1,
cache_misses = cm1,
gc_time = gt1, gc_work = gw1,
gc_time = gt1, gc_elapsed_time = ge1, gc_work = gw1,
binary_size = bs1, allocs = al1,
run_status = rs1, compile_status = cs1 }
Results{ compile_time = ct2, link_time = lt2,
......@@ -191,7 +193,7 @@ combine2Results
run_time = rt2, mut_time = mt2,
instrs = is2, mem_reads = mr2, mem_writes = mw2,
cache_misses = cm2,
gc_time = gt2, gc_work = gw2,
gc_time = gt2, gc_elapsed_time = ge2, gc_work = gw2,
binary_size = bs2, allocs = al2,
run_status = rs2, compile_status = cs2 }
= Results{ compile_time = Map.unionWith (flip const) ct1 ct2,
......@@ -204,6 +206,7 @@ combine2Results
mem_writes = mw1 `mplus` mw2,
cache_misses = cm1 `mplus` cm2,
gc_time = gt1 ++ gt2,
gc_elapsed_time= ge1 ++ ge2,
gc_work = gw1 `mplus` gw2,
binary_size = bs1 `mplus` bs2,
allocs = al1 `mplus` al2,
......@@ -310,28 +313,28 @@ parse_run_time _ [] _ NotDone = []
parse_run_time prog [] res ex = [(prog, res{run_status=ex})]
parse_run_time prog (l:ls) res ex =
case ghc1_re l of {
Just (allocations, _, _, _, _, _, initialisation, _, mut, _, gc, _) ->
got_run_result allocations initialisation mut gc Nothing
Nothing Nothing Nothing Nothing;
Just (allocations, _, _, _, _, _, initialisation, _, mut, _, gc, gc_elapsed) ->
got_run_result allocations initialisation mut gc gc_elapsed
Nothing Nothing Nothing Nothing Nothing;
Nothing ->
case ghc2_re l of {
Just (allocations, _, _, _, _, _, initialisation, _, mut, _, gc, _) ->
got_run_result allocations initialisation mut gc Nothing
Nothing Nothing Nothing Nothing;
Just (allocations, _, _, _, _, _, initialisation, _, mut, _, gc, gc_elapsed) ->
got_run_result allocations initialisation mut gc gc_elapsed
Nothing Nothing Nothing Nothing Nothing;
Nothing ->
case ghc3_re l of {
Just (allocations, _, _, _, _, gc_work', _, initialisation, _, mut, _, gc, _) ->
got_run_result allocations initialisation mut gc
Just (allocations, _, _, _, _, gc_work', _, initialisation, _, mut, _, gc, gc_elapsed) ->
got_run_result allocations initialisation mut gc gc_elapsed
(Just gc_work') Nothing Nothing Nothing Nothing;
Nothing ->
case ghc4_re l of {
Just (allocations, _, _, _, _, gc_work', _, initialisation, _, mut, _, gc, _, is, mem_rs, mem_ws, cache_misses') ->
got_run_result allocations initialisation mut gc
Just (allocations, _, _, _, _, gc_work', _, initialisation, _, mut, _, gc, gc_elapsed, is, mem_rs, mem_ws, cache_misses') ->
got_run_result allocations initialisation mut gc gc_elapsed
(Just gc_work') (Just is) (Just mem_rs)
(Just mem_ws) (Just cache_misses');
......@@ -364,7 +367,7 @@ parse_run_time prog (l:ls) res ex =
}}}}}}}}
where
got_run_result allocations initialisation mut gc gc_work' instrs' mem_rs mem_ws cache_misses'
got_run_result allocations initialisation mut gc gc_elapsed gc_work' instrs' mem_rs mem_ws cache_misses'
= -- trace ("got_run_result: " ++ initialisation ++ ", " ++ mut ++ ", " ++ gc) $
let
time = initialisation + mut + gc
......@@ -372,6 +375,7 @@ parse_run_time prog (l:ls) res ex =
emptyResults{ run_time = [time],
mut_time = [mut],
gc_time = [gc],
gc_elapsed_time = [gc_elapsed],
gc_work = gc_work',
allocs = Just allocations,
instrs = instrs',
......
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