Skip to content

Commit 32731ba

Browse files
committed
Do not log live_words and free_words in trace file
This allows using `Gc.quick_stat` which does not scan the heap. Signed-off-by: Etienne Millon <me@emillon.org>
1 parent 4226f7a commit 32731ba

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

CHANGES.md

+3
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,9 @@ Unreleased
144144
- Make Dune display the progress indicator in all output modes except quiet
145145
(#4618, @aalekseyev)
146146

147+
- Do not log `live_words` and `free_words` in trace file. This allows using
148+
`Gc.quick_stat` which does not scan the heap. (#...., @emillon)
149+
147150
2.9.0 (unreleased)
148151
------------------
149152

src/dune_stats/dune_stats.ml

+2-4
Original file line numberDiff line numberDiff line change
@@ -141,10 +141,8 @@ let record_gc_and_fd stats =
141141
let () =
142142
let common = Event.common_fields ~name:"gc" ~ts () in
143143
let args =
144-
let stat = Gc.stat () in
145-
[ ("live_words", `Int stat.live_words)
146-
; ("free_words", `Int stat.free_words)
147-
; ("stack_size", `Int stat.stack_size)
144+
let stat = Gc.quick_stat () in
145+
[ ("stack_size", `Int stat.stack_size)
148146
; ("heap_words", `Int stat.heap_words)
149147
; ("top_heap_words", `Int stat.top_heap_words)
150148
; ("minor_words", `Float stat.minor_words)

test/blackbox-tests/test-cases/trace-file.t/run.t

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@ This captures the commands that are being run:
1212
As well as data about the garbage collector:
1313

1414
$ <trace.json grep '"C"' | cut -c 2- | sed -E 's/([^0-9])[0-9]+/\1.../g' | sort -u
15-
{"ph":"C","args":{"live_words":...,"free_words":...,"stack_size":...,"heap_words":...,"top_heap_words":...,"minor_words":...,"major_words":...,"promoted_words":...,"compactions":...,"major_collections":...,"minor_collections":...},"name":"gc","cat":"","ts":...,"pid":...,"tid":...}
15+
{"ph":"C","args":{"stack_size":...,"heap_words":...,"top_heap_words":...,"minor_words":...,"major_words":...,"promoted_words":...,"compactions":...,"major_collections":...,"minor_collections":...},"name":"gc","cat":"","ts":...,"pid":...,"tid":...}
1616
{"ph":"C","args":{"value":...},"name":"evaluated_rules","cat":"","ts":...,"pid":...,"tid":...}
1717
{"ph":"C","args":{"value":...},"name":"fds","cat":"","ts":...,"pid":...,"tid":...}

0 commit comments

Comments
 (0)