@ -12,12 +12,11 @@ let read filename =
List . iter ( Sexp . load_sexps filename ) ~ f : ( fun sexp ->
List . iter ( Sexp . load_sexps filename ) ~ f : ( fun sexp ->
let { Report . name ; entry } = Report . t_of_sexp sexp in
let { Report . name ; entry } = Report . t_of_sexp sexp in
match ( Tbl . find_opt tbl name , entry ) with
match ( Tbl . find_opt tbl name , entry ) with
| None , ProcessTimes ( etime , ptimes ) ->
| None , ProcessTimes ptimes -> Tbl . replace tbl name ( [ ptimes ] , [] , [] )
Tbl . replace tbl name ( [ ( etime , ptimes ) ] , [] , [] )
| None , GcStats gc -> Tbl . replace tbl name ( [] , [ gc ] , [] )
| None , GcStats gc -> Tbl . replace tbl name ( [] , [ gc ] , [] )
| None , Status status -> Tbl . replace tbl name ( [] , [] , [ status ] )
| None , Status status -> Tbl . replace tbl name ( [] , [] , [ status ] )
| Some ( times , gcs , statuses ) , ProcessTimes ( etime , ptimes ) ->
| Some ( times , gcs , statuses ) , ProcessTimes ptimes ->
Tbl . replace tbl name ( ( etime , ptimes ) :: times , gcs , statuses )
Tbl . replace tbl name ( ptimes :: times , gcs , statuses )
| Some ( times , gcs , statuses ) , GcStats gc ->
| Some ( times , gcs , statuses ) , GcStats gc ->
Tbl . replace tbl name ( times , gc :: gcs , statuses )
Tbl . replace tbl name ( times , gc :: gcs , statuses )
| Some ( times , gc , statuses ) , Status status ->
| Some ( times , gc , statuses ) , Status status ->
@ -35,10 +34,9 @@ type ('t, 'g) row =
; status : Report . status list
; status : Report . status list
; status_deltas : Report . status list option }
; status_deltas : Report . status list option }
let times_of_raw ( etime , ptimes ) =
let times_of_raw { Report . etime ; utime ; stime ; cutime ; cstime } =
let { Unix . tms_utime ; tms_cutime ; tms_stime ; tms_cstime } = ptimes in
let utime = utime + . cutime in
let utime = tms_utime + . tms_cutime in
let stime = stime + . cstime in
let stime = tms_stime + . tms_cstime in
let etime = etime in
let etime = etime in
{ etime ; utime ; stime }
{ etime ; utime ; stime }
@ -117,22 +115,21 @@ let combine name b_result c_result =
, Iter . empty
, Iter . empty
, Iter . empty )
, Iter . empty )
~ f : ( fun ( etimes , utimes , stimes , cutimes , cstimes )
~ f : ( fun ( etimes , utimes , stimes , cutimes , cstimes )
( etime
{ Report . etime ; utime ; stime ; cutime ; cstime }
, { Unix . tms_utime ; tms_cutime ; tms_stime ; tms_cstime } )
->
->
( Iter . cons etime etimes
( Iter . cons etime etimes
, Iter . cons tms_ utime utimes
, Iter . cons utime utimes
, Iter . cons tms_ stime stimes
, Iter . cons stime stimes
, Iter . cons tms_ cutime cutimes
, Iter . cons cutime cutimes
, Iter . cons tms_ cstime cstimes ) )
, Iter . cons cstime cstimes ) )
in
in
Some
Some
( times_of_raw
( times_of_raw
( ave_floats etimes
{ etime = ave_floats etimes
, { tms_ utime= ave_floats utimes
; utime= ave_floats utimes
; tms_ stime= ave_floats stimes
; stime= ave_floats stimes
; tms_ cutime= ave_floats cutimes
; cutime= ave_floats cutimes
; tms_ cstime= ave_floats cstimes } ) )
; cstime= ave_floats cstimes } )
in
in
let gcs =
let gcs =
if List . is_empty gcs then None
if List . is_empty gcs then None