Skip to content

Commit 0cd00f7

Browse files
committed
Record domains starting and stopping
1 parent 148692a commit 0cd00f7

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

src/gc_stats.ml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,7 @@ let analyse reader =
8181
match r with
8282
| Event e -> process_event stats e
8383
| User _ -> ()
84-
| Scheduling Thread_wakeup { cpu; timestamp; id; args = _ } -> ignore (cpu, timestamp, id)
85-
| Scheduling Unknown _ -> ()
84+
| Scheduling _ -> ()
8685
| Metadata -> ()
8786
| Kernel _ -> ()
8887
| Unknown _ -> ()

src/record.ml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,16 @@ let callbacks t =
6363
~category:"gc"
6464
~ts:(Runtime_events.Timestamp.to_int64 ts)
6565
)
66+
~lifecycle:(fun ring_id ts event _data ->
67+
let ts = Runtime_events.Timestamp.to_int64 ts in
68+
let thread = ring_thread t ring_id in
69+
match event with
70+
| EV_DOMAIN_SPAWN ->
71+
Write.instant_event t.fxt ~thread ~ts ~name:"domain-spawn" ~category:"ocaml"
72+
| EV_DOMAIN_TERMINATE ->
73+
Write.instant_event t.fxt ~thread ~ts ~name:"domain-terminate" ~category:"ocaml"
74+
| _ -> ()
75+
)
6676
~lost_events:(fun ring n -> traceln "Warning: ring %d lost %d events" ring n)
6777
|> Eio_runtime_events.add_callbacks
6878
(fun ring_id ts e ->

0 commit comments

Comments
 (0)