Lines Matching +full:buffer +full:- +full:size

4  * SPDX-License-Identifier: Apache-2.0
19 * Is called by gcc-generated constructor code for each object file compiled
20 * with -fprofile-arcs.
24 info->next = gcov_info_head; in __gcov_init()
39 * print_u8 - Print 8 bit of gcov data
47 * print_u32 - Print 32 bit of gcov data
60 * write_u64 - Store 64 bit data on a buffer and return the size
63 static inline void write_u64(void *buffer, size_t *off, uint64_t v) in write_u64() argument
65 if (buffer != NULL) { in write_u64()
66 memcpy((uint8_t *)buffer + *off, (uint8_t *)&v, sizeof(v)); in write_u64()
75 * write_u32 - Store 32 bit data on a buffer and return the size
77 static inline void write_u32(void *buffer, size_t *off, uint32_t v) in write_u32() argument
79 if (buffer != NULL) { in write_u32()
80 memcpy((uint8_t *)buffer + *off, (uint8_t *)&v, sizeof(v)); in write_u32()
97 uint32_t size = sizeof(uint32_t) * 4; in gcov_calculate_buff_size() local
99 uint32_t size = sizeof(uint32_t) * 3; in gcov_calculate_buff_size() local
102 for (iter = 0U; iter < info->n_functions; iter++) { in gcov_calculate_buff_size()
108 size += (sizeof(uint32_t) * 5); in gcov_calculate_buff_size()
111 if (!info->merge[iter_1]) { in gcov_calculate_buff_size()
116 size += (sizeof(uint32_t) * 2); in gcov_calculate_buff_size()
119 iter_2 < info->functions[iter]->ctrs->num; in gcov_calculate_buff_size()
123 size += (sizeof(uint64_t)); in gcov_calculate_buff_size()
131 return size; in gcov_calculate_buff_size()
135 * gcov_populate_buffer - convert from gcov data set (info) to
137 * This buffer will now have info similar to a regular gcda
140 size_t gcov_populate_buffer(uint8_t *buffer, struct gcov_info *info) in gcov_populate_buffer() argument
150 write_u32(buffer, in gcov_populate_buffer()
154 write_u32(buffer, in gcov_populate_buffer()
156 info->version); in gcov_populate_buffer()
158 write_u32(buffer, in gcov_populate_buffer()
160 info->stamp); in gcov_populate_buffer()
163 write_u32(buffer, in gcov_populate_buffer()
165 info->checksum); in gcov_populate_buffer()
169 iter_functions < info->n_functions; in gcov_populate_buffer()
172 functions = info->functions[iter_functions]; in gcov_populate_buffer()
175 write_u32(buffer, in gcov_populate_buffer()
179 write_u32(buffer, in gcov_populate_buffer()
183 write_u32(buffer, in gcov_populate_buffer()
185 functions->ident); in gcov_populate_buffer()
187 write_u32(buffer, in gcov_populate_buffer()
189 functions->lineno_checksum); in gcov_populate_buffer()
191 write_u32(buffer, in gcov_populate_buffer()
193 functions->cfg_checksum); in gcov_populate_buffer()
195 counters_per_func = functions->ctrs; in gcov_populate_buffer()
201 if (!info->merge[iter_counts]) { in gcov_populate_buffer()
205 write_u32(buffer, in gcov_populate_buffer()
211 write_u32(buffer, in gcov_populate_buffer()
213 counters_per_func->num * 2U * 4); in gcov_populate_buffer()
215 write_u32(buffer, in gcov_populate_buffer()
217 counters_per_func->num * 2U); in gcov_populate_buffer()
221 iter_counter_values < counters_per_func->num; in gcov_populate_buffer()
224 write_u64(buffer, in gcov_populate_buffer()
226 counters_per_func->values[iter_counter_values]); in gcov_populate_buffer()
244 iter_functions < info->n_functions; in gcov_reset_counts()
247 functions = info->functions[iter_functions]; in gcov_reset_counts()
248 counters_per_func = functions->ctrs; in gcov_reset_counts()
254 iter_counter_values < counters_per_func->num; in gcov_reset_counts()
256 counters_per_func->values[iter_counter_values] = 0; in gcov_reset_counts()
274 gcov_list = gcov_list->next; in gcov_reset_all_counts()
305 uint8_t *buffer; in gcov_coverage_dump() local
306 size_t size; in gcov_coverage_dump() local
319 dump_on_console_start(gcov_list->filename); in gcov_coverage_dump()
320 size = gcov_calculate_buff_size(gcov_list); in gcov_coverage_dump()
322 buffer = k_heap_alloc(&gcov_heap, size, K_NO_WAIT); in gcov_coverage_dump()
323 if (CONFIG_COVERAGE_GCOV_HEAP_SIZE > 0 && !buffer) { in gcov_coverage_dump()
328 written_size = gcov_populate_buffer(buffer, gcov_list); in gcov_coverage_dump()
329 if (written_size != size) { in gcov_coverage_dump()
334 dump_on_console_data(buffer, size); in gcov_coverage_dump()
336 k_heap_free(&gcov_heap, buffer); in gcov_coverage_dump()
337 gcov_list = gcov_list->next; in gcov_coverage_dump()