The unpac monorepo manager self-hosting as a monorepo using unpac
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge pull request #14189 from tmcgilchrist/patch-1

Report EV_C_MINOR_PROMOTED counter as words promoted.

authored by

Gabriel Scherer and committed by
GitHub
94d408c9 e6231db0

+50 -14
+9
Changes
··· 39 39 `live_stacks_words` field tracking the total size in words of live stacks. 40 40 (Florian Angeletti, review by Gabriel Scherer) 41 41 42 + - #14189: Add runtime counters EV_C_MINOR_PROMOTED_WORDS and 43 + EV_C_MINOR_ALLOCATED_WORDS. EV_C_MINOR_PROMOTED_WORDS reports words promoted 44 + by minor GC and EV_C_MINOR_ALLOCATED_WORDS reports words allocated by minor 45 + GC. Both have equivalent bytes counters. Also updated the documentation for 46 + EV_C_MINOR_PROMOTED and EV_C_MINOR_ALLOCATED to qualify scope of the values 47 + reported as being per-domain. 48 + (Tim McGilchrist, review by Nick Barnes, Sadiq Jaffer and 49 + Gabriel Scherer) 50 + 42 51 ### Code generation and optimizations: 43 52 44 53 ### Standard library:
+4
otherlibs/runtime_events/runtime_events.ml
··· 42 42 | EV_C_MAJOR_ALLOC_COUNTER 43 43 | EV_C_MAJOR_SLICE_TARGET 44 44 | EV_C_MAJOR_SLICE_BUDGET 45 + | EV_C_MINOR_ALLOCATED_WORDS 46 + | EV_C_MINOR_PROMOTED_WORDS 45 47 46 48 type runtime_phase = 47 49 | EV_EXPLICIT_GC_SET ··· 111 113 | EV_C_FORCE_MINOR_SET_MINOR_HEAP_SIZE -> "force_minor_set_minor_heap_size" 112 114 | EV_C_FORCE_MINOR_MEMPROF -> "force_minor_memprof" 113 115 | EV_C_MINOR_PROMOTED -> "minor_promoted" 116 + | EV_C_MINOR_PROMOTED_WORDS -> "minor_promoted_words" 114 117 | EV_C_MINOR_ALLOCATED -> "minor_allocated" 118 + | EV_C_MINOR_ALLOCATED_WORDS -> "minor_allocated_words" 115 119 | EV_C_REQUEST_MAJOR_ALLOC_SHR -> "request_major_alloc_shr" 116 120 | EV_C_REQUEST_MAJOR_ADJUST_GC_SPEED -> "request_major_adjust_gc_speed" 117 121 | EV_C_REQUEST_MINOR_REALLOC_REF_TABLE -> "request_minor_realloc_ref_table"
+25 -12
otherlibs/runtime_events/runtime_events.mli
··· 72 72 *) 73 73 | EV_C_MINOR_PROMOTED 74 74 (** 75 - Total words promoted from the minor heap to the major in the last minor 76 - collection. 75 + Total {b bytes} promoted from the minor heap of this Domain to the major heap 76 + in the last minor collection. 77 77 @since 5.0 78 78 *) 79 79 | EV_C_MINOR_ALLOCATED 80 80 (** 81 - Total {b bytes} allocated in the minor heap in the last minor collection. 81 + Total {b bytes} allocated in the minor heap of this Domain in the 82 + last minor collection. 82 83 @since 5.0 83 84 *) 84 85 | EV_C_REQUEST_MAJOR_ALLOC_SHR ··· 108 109 *) 109 110 | EV_C_MAJOR_HEAP_POOL_WORDS 110 111 (** 111 - Total words in a Domain's major heap pools. This is the sum of unallocated and 112 - live words in each pool. 112 + Total {b words} in a Domain's major heap pools. This is the sum of 113 + unallocated and live words in each pool. 113 114 @since 5.1 *) 114 115 | EV_C_MAJOR_HEAP_POOL_LIVE_WORDS 115 116 (** 116 - Current live words in a Domain's major heap pools. 117 + Current live {b words} in a Domain's major heap pools. 117 118 @since 5.1 *) 118 119 | EV_C_MAJOR_HEAP_LARGE_WORDS 119 120 (** 120 - Total words of a Domain's major heap large allocations. 121 + Total {b words} of a Domain's major heap large allocations. 121 122 A large allocation is an allocation larger than the largest sized pool. 122 123 @since 5.1 *) 123 124 | EV_C_MAJOR_HEAP_POOL_FRAG_WORDS ··· 136 137 @since 5.1 *) 137 138 | EV_C_MAJOR_HEAP_WORDS 138 139 (** 139 - Major heap size in words of a Domain. 140 + Major heap size in {b words} of a Domain. 140 141 @since 5.3 *) 141 142 | EV_C_MAJOR_ALLOCATED_WORDS 142 143 (** 143 - Allocations to the major heap of this Domain in words, since the last major 144 + Allocations to the major heap of this Domain in {b words}, since the last major 144 145 slice. 145 146 @since 5.3 146 147 *) 147 148 | EV_C_MAJOR_ALLOCATED_WORK 148 149 (** 149 150 The amount of major GC 'work' needing to be done as a result of allocations to 150 - the major heap of this Domain in words, since the last major slice. 151 + the major heap of this Domain in {b words}, since the last major slice. 151 152 @since 5.3 152 153 *) 153 154 | EV_C_MAJOR_DEPENDENT_WORK ··· 173 174 *) 174 175 | EV_C_MAJOR_ALLOC_COUNTER 175 176 (** 176 - The global words of major GC allocations done by all domains since the program 177 - began. 177 + The global {b words} of major GC allocations done by all domains since the 178 + program began. 178 179 @since 5.3 179 180 *) 180 181 | EV_C_MAJOR_SLICE_TARGET ··· 187 188 (** 188 189 The budget in 'work' that a domain has to do during the major slice. 189 190 @since 5.3 191 + *) 192 + | EV_C_MINOR_ALLOCATED_WORDS 193 + (** 194 + Total {b words} allocated in the minor heap of this Domain in the 195 + last minor collection. 196 + @since 5.4 197 + *) 198 + | EV_C_MINOR_PROMOTED_WORDS 199 + (** 200 + Total {b words} promoted from the minor heap of this Domain to the major heap 201 + in the last minor collection. 202 + @since 5.4 190 203 *) 191 204 192 205 (** The type for span events emitted by the runtime. *)
+5 -1
runtime/caml/runtime_events.h
··· 154 154 EV_C_MAJOR_WORK_COUNTER, 155 155 EV_C_MAJOR_ALLOC_COUNTER, 156 156 EV_C_MAJOR_SLICE_TARGET, 157 - EV_C_MAJOR_SLICE_BUDGET 157 + EV_C_MAJOR_SLICE_BUDGET, 158 + 159 + EV_C_MINOR_ALLOCATED_WORDS, 160 + EV_C_MINOR_PROMOTED_WORDS 161 + 158 162 } ev_runtime_counter; 159 163 160 164 typedef enum {
+4
runtime/minor_gc.c
··· 706 706 call_timing_hook(&caml_minor_gc_end_hook); 707 707 CAML_EV_COUNTER(EV_C_MINOR_PROMOTED, 708 708 Bsize_wsize(domain->allocated_words - prev_alloc_words)); 709 + CAML_EV_COUNTER(EV_C_MINOR_PROMOTED_WORDS, 710 + domain->allocated_words - prev_alloc_words); 709 711 710 712 CAML_EV_COUNTER(EV_C_MINOR_ALLOCATED, minor_allocated_bytes); 713 + CAML_EV_COUNTER(EV_C_MINOR_ALLOCATED_WORDS, 714 + Whsize_wosize(minor_allocated_bytes)); 711 715 712 716 CAML_EV_END(EV_MINOR); 713 717 if (minor_allocated_bytes == 0)
+3 -1
testsuite/tests/lib-runtime-events/test_caml_counters.ml
··· 27 27 assert(received EV_C_MAJOR_HEAP_LARGE_BLOCKS); 28 28 (* Finally the minor heap counters *) 29 29 assert(received EV_C_MINOR_ALLOCATED); 30 - assert(received EV_C_MINOR_PROMOTED) 30 + assert(received EV_C_MINOR_ALLOCATED_WORDS); 31 + assert(received EV_C_MINOR_PROMOTED); 32 + assert(received EV_C_MINOR_PROMOTED_WORDS)