diff options
author | Ivan Maidanski <ivmai@mail.ru> | 2023-05-04 07:39:02 +0300 |
---|---|---|
committer | Ivan Maidanski <ivmai@mail.ru> | 2023-05-04 07:39:02 +0300 |
commit | 53f132650ac49289c4a8e2b0cebbfab5e08a205b (patch) | |
tree | 6703e550923585662f7a36416de64599f57c6774 /tests | |
parent | 33776199da186407dac0109e9097884d0b755722 (diff) | |
download | bdwgc-53f132650ac49289c4a8e2b0cebbfab5e08a205b.tar.gz |
Add API to get total stopped-world marking time
New public function is GC_get_stopped_mark_total_time().
* alloc.c [!NO_CLOCK] (stopped_mark_total_time,
stopped_mark_total_ns_frac): New static variable.
* alloc.c [!NO_CLOCK] (GC_get_stopped_mark_total_time): New API
function definition.
* alloc.c [!NO_CLOCK] (GC_stopped_mark): Define start_time_valid,
ns_frac_diff local variables; call GET_TIME() also if
measure_performance; add TODO item (about code duplication); update
stopped_mark_total_time and stopped_mark_total_ns_frac values.
* alloc.c (GC_stopped_mark): Move logging of "Marking for collection"
upper to be before GET_TIME(start_time).
* include/gc/gc.h (GC_get_full_gc_total_time): Refine documentation.
* include/gc/gc.h (GC_get_stopped_mark_total_time): New API prototype.
* tests/gctest.c [!NO_CLOCK] (check_heap_stats): Call
GC_get_stopped_mark_total_time() to report total stopped-world marking
time.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/gctest.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/tests/gctest.c b/tests/gctest.c index 7b00f834..ebacf1da 100644 --- a/tests/gctest.c +++ b/tests/gctest.c @@ -2125,7 +2125,8 @@ void check_heap_stats(void) # endif # ifndef NO_CLOCK - GC_printf("Full collections took %lu ms\n", GC_get_full_gc_total_time()); + GC_printf("Full/world-stopped collections took %lu/%lu ms\n", + GC_get_full_gc_total_time(), GC_get_stopped_mark_total_time()); # endif # ifdef PARALLEL_MARK GC_printf("Completed %u collections (using %d marker threads)\n", |