Skip to content

Commit 4de57bb

Browse files
authored
Merge pull request #18 from talex5/domain-condition-wait
Ignore EV_DOMAIN_CONDITION_WAIT
2 parents 8323ef3 + 3ed8810 commit 4de57bb

File tree

2 files changed

+20
-13
lines changed

2 files changed

+20
-13
lines changed

lib/trace.ml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,13 @@ module Ring = struct
5252
t.events <- (ts, e :: stack) :: t.events
5353

5454
let pop t ts =
55-
let stack =
55+
let tail =
5656
match t.events with
57+
| (_, (_ :: x)) :: _ -> x
5758
| [] -> []
58-
| (_, s) :: _ -> s
59+
| _ :: _ -> print_endline "warning: unmatched pop!"; []
5960
in
60-
t.events <- (ts, List.tl stack) :: t.events
61+
t.events <- (ts, tail) :: t.events
6162
end
6263

6364
type t = {

src/record.ml

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -41,21 +41,27 @@ let get_fiber t id =
4141
t.fibers <- Fibers.add id x t.fibers;
4242
x
4343

44+
let phase_useful = function
45+
| Runtime_events.EV_DOMAIN_CONDITION_WAIT -> false (* We don't know what systhread it came from *)
46+
| _ -> true
47+
4448
let callbacks t =
4549
Runtime_events.Callbacks.create ()
4650
~runtime_begin:(fun ring ts phase ->
47-
Write.duration_begin t.fxt
48-
~thread:(ring_thread t ring)
49-
~name:(Runtime_events.runtime_phase_name phase)
50-
~category:"gc"
51-
~ts:(Runtime_events.Timestamp.to_int64 ts)
51+
if phase_useful phase then
52+
Write.duration_begin t.fxt
53+
~thread:(ring_thread t ring)
54+
~name:(Runtime_events.runtime_phase_name phase)
55+
~category:"gc"
56+
~ts:(Runtime_events.Timestamp.to_int64 ts)
5257
)
5358
~runtime_end:(fun ring ts phase ->
54-
Write.duration_end t.fxt
55-
~thread:(ring_thread t ring)
56-
~name:(Runtime_events.runtime_phase_name phase)
57-
~category:"gc"
58-
~ts:(Runtime_events.Timestamp.to_int64 ts)
59+
if phase_useful phase then
60+
Write.duration_end t.fxt
61+
~thread:(ring_thread t ring)
62+
~name:(Runtime_events.runtime_phase_name phase)
63+
~category:"gc"
64+
~ts:(Runtime_events.Timestamp.to_int64 ts)
5965
)
6066
~lost_events:(fun ring n -> traceln "Warning: ring %d lost %d events" ring n)
6167
|> Eio_runtime_events.add_callbacks

0 commit comments

Comments
 (0)