summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorIvan Maidanski <ivmai@mail.ru>2023-05-04 07:39:02 +0300
committerIvan Maidanski <ivmai@mail.ru>2023-05-04 07:39:02 +0300
commit53f132650ac49289c4a8e2b0cebbfab5e08a205b (patch)
tree6703e550923585662f7a36416de64599f57c6774 /include
parent33776199da186407dac0109e9097884d0b755722 (diff)
downloadbdwgc-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 'include')
-rw-r--r--include/gc/gc.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/include/gc/gc.h b/include/gc/gc.h
index 06048c6e..c72a3532 100644
--- a/include/gc/gc.h
+++ b/include/gc/gc.h
@@ -479,12 +479,18 @@ GC_API GC_word GC_CALL GC_get_allocd_bytes_per_finalizer(void);
GC_API void GC_CALL GC_start_performance_measurement(void);
/* Get the total time of all full collections since the start of the */
-/* performance measurements. The measurement unit is one millisecond. */
-/* Note that the returned value wraps around on overflow. */
+/* performance measurements. Includes time spent in the supplementary */
+/* actions like blacklists promotion, marks clearing, free lists */
+/* reconstruction and objects finalization. The measurement unit is a */
+/* millisecond. Note that the returned value wraps around on overflow. */
/* The function does not use any synchronization. Defined only if the */
/* library has been compiled without NO_CLOCK. */
GC_API unsigned long GC_CALL GC_get_full_gc_total_time(void);
+/* Same as GC_get_full_gc_total_time but takes into account all mark */
+/* phases with the world stopped and nothing else. */
+GC_API unsigned long GC_CALL GC_get_stopped_mark_total_time(void);
+
/* Set whether the GC will allocate executable memory pages or not. */
/* A non-zero argument instructs the collector to allocate memory with */
/* the executable flag on. Must be called before the collector is */