4646
4747type event =
4848 | Log of string
49+ | Error of string
4950 | Create_cc of string * item
5051 | Add_fiber of { parent : int ; child : item }
5152and item = {
@@ -87,6 +88,7 @@ let get t id = Ids.find_opt id t.items
8788
8889let map_event f : Trace.event -> event = function
8990 | Log x -> Log x
91+ | Error x -> Error x
9092 | Create_cc (ty , x ) -> Create_cc (ty, f x)
9193 | Add_fiber { parent; child } -> Add_fiber { parent; child = f child }
9294
@@ -112,7 +114,7 @@ let layout ~duration (ring : Ring.t) =
112114 let intervals = ref [] in
113115 i.events |> Array. iter (fun (ts , e ) ->
114116 match e with
115- | Log _ ->
117+ | Log _ | Error _ ->
116118 if i.end_cc_label = None then (
117119 i.end_cc_label < - Some ts;
118120 )
@@ -131,7 +133,7 @@ let layout ~duration (ring : Ring.t) =
131133 let start_fibers = List. length ! intervals in
132134 i.events |> Array. iter (fun (ts , e ) ->
133135 match e with
134- | Log _ | Create_cc _ -> ()
136+ | Log _ | Error _ | Create_cc _ -> ()
135137 | Add_fiber { parent; child } ->
136138 if debug_layout then Fmt. epr " %d gets fiber %d, created by %d@." i.id child.id parent;
137139 let stop = Option. value child.end_time ~default: duration in
@@ -161,7 +163,7 @@ let layout ~duration (ring : Ring.t) =
161163 i.end_cc_label < - None ;
162164 i.events |> Array. iter (fun (_ts , e ) ->
163165 match e with
164- | Log _ | Create_cc _ -> ()
166+ | Log _ | Error _ | Create_cc _ -> ()
165167 | Add_fiber { parent = _ ; child } ->
166168 visit ~y: (ring.y + i.height) child;
167169 i.height < - child.y - ring.y + child.height;
0 commit comments