Lines Matching +full:mod +full:- +full:12 +full:b

1 // SPDX-License-Identifier: GPL-2.0
9 * gcc/gcov-io.h
12 * Uses gcc-internal data definitions.
31 /* Since GCC 12.1 sizes are in BYTES and not in WORDS (4B). */
32 #if (__GNUC__ >= 12)
41 * struct gcov_ctr_info - information about counters for a single function
46 * at run-time with the exception of the values array.
54 * struct gcov_fn_info - profiling meta data per function
62 * at run-time.
67 * comdat functions was selected -- it points to the gcov_info object
79 * struct gcov_info - profiling data per object file
81 * @next: list head for a singly-linked list
90 * at run-time with the exception of the next pointer.
97 #if (__GNUC__ >= 12)
107 * gcov_info_filename - return info filename
112 return info->filename; in gcov_info_filename()
116 * gcov_info_version - return info version
121 return info->version; in gcov_info_version()
125 * gcov_info_next - return next profiling data set
136 return info->next; in gcov_info_next()
140 * gcov_info_link - link/add profiling data set to the list
145 info->next = gcov_info_head; in gcov_info_link()
150 * gcov_info_unlink - unlink/remove profiling data set from the list
157 prev->next = info->next; in gcov_info_unlink()
159 gcov_info_head = info->next; in gcov_info_unlink()
163 * gcov_info_within_module - check if a profiling data set belongs to a module
165 * @mod: module
169 bool gcov_info_within_module(struct gcov_info *info, struct module *mod) in gcov_info_within_module() argument
171 return within_module((unsigned long)info, mod); in gcov_info_within_module()
181 * Determine whether a counter is active. Doesn't change at run-time.
185 return info->merge[type] ? 1 : 0; in counter_active()
202 * gcov_info_reset - reset profiling data to zero
211 for (fi_idx = 0; fi_idx < info->n_functions; fi_idx++) { in gcov_info_reset()
212 ci_ptr = info->functions[fi_idx]->ctrs; in gcov_info_reset()
218 memset(ci_ptr->values, 0, in gcov_info_reset()
219 sizeof(gcov_type) * ci_ptr->num); in gcov_info_reset()
226 * gcov_info_is_compatible - check if profiling data can be added
230 * Returns non-zero if profiling data can be added, zero otherwise.
234 return (info1->stamp == info2->stamp); in gcov_info_is_compatible()
238 * gcov_info_add - add up profiling data
252 for (fi_idx = 0; fi_idx < src->n_functions; fi_idx++) { in gcov_info_add()
253 dci_ptr = dst->functions[fi_idx]->ctrs; in gcov_info_add()
254 sci_ptr = src->functions[fi_idx]->ctrs; in gcov_info_add()
260 for (val_idx = 0; val_idx < sci_ptr->num; val_idx++) in gcov_info_add()
261 dci_ptr->values[val_idx] += in gcov_info_add()
262 sci_ptr->values[val_idx]; in gcov_info_add()
271 * gcov_info_dup - duplicate profiling data set
291 dup->next = NULL; in gcov_info_dup()
292 dup->filename = NULL; in gcov_info_dup()
293 dup->functions = NULL; in gcov_info_dup()
295 dup->filename = kstrdup(info->filename, GFP_KERNEL); in gcov_info_dup()
296 if (!dup->filename) in gcov_info_dup()
299 dup->functions = kcalloc(info->n_functions, in gcov_info_dup()
301 if (!dup->functions) in gcov_info_dup()
308 for (fi_idx = 0; fi_idx < info->n_functions; fi_idx++) { in gcov_info_dup()
309 dup->functions[fi_idx] = kzalloc(fi_size, GFP_KERNEL); in gcov_info_dup()
310 if (!dup->functions[fi_idx]) in gcov_info_dup()
313 *(dup->functions[fi_idx]) = *(info->functions[fi_idx]); in gcov_info_dup()
315 sci_ptr = info->functions[fi_idx]->ctrs; in gcov_info_dup()
316 dci_ptr = dup->functions[fi_idx]->ctrs; in gcov_info_dup()
320 cv_size = sizeof(gcov_type) * sci_ptr->num; in gcov_info_dup()
322 dci_ptr->values = kvmalloc(cv_size, GFP_KERNEL); in gcov_info_dup()
324 if (!dci_ptr->values) in gcov_info_dup()
327 dci_ptr->num = sci_ptr->num; in gcov_info_dup()
328 memcpy(dci_ptr->values, sci_ptr->values, cv_size); in gcov_info_dup()
342 * gcov_info_free - release memory for profiling data set duplicate
352 if (!info->functions) in gcov_info_free()
357 for (fi_idx = 0; fi_idx < info->n_functions; fi_idx++) { in gcov_info_free()
358 if (!info->functions[fi_idx]) in gcov_info_free()
361 ci_ptr = info->functions[fi_idx]->ctrs; in gcov_info_free()
364 kvfree(ci_ptr->values); in gcov_info_free()
366 kfree(info->functions[fi_idx]); in gcov_info_free()
370 kfree(info->functions); in gcov_info_free()
371 kfree(info->filename); in gcov_info_free()
376 * convert_to_gcda - convert profiling data set to gcda file format
393 pos += store_gcov_u32(buffer, pos, info->version); in convert_to_gcda()
394 pos += store_gcov_u32(buffer, pos, info->stamp); in convert_to_gcda()
396 #if (__GNUC__ >= 12) in convert_to_gcda()
401 for (fi_idx = 0; fi_idx < info->n_functions; fi_idx++) { in convert_to_gcda()
402 fi_ptr = info->functions[fi_idx]; in convert_to_gcda()
408 pos += store_gcov_u32(buffer, pos, fi_ptr->ident); in convert_to_gcda()
409 pos += store_gcov_u32(buffer, pos, fi_ptr->lineno_checksum); in convert_to_gcda()
410 pos += store_gcov_u32(buffer, pos, fi_ptr->cfg_checksum); in convert_to_gcda()
412 ci_ptr = fi_ptr->ctrs; in convert_to_gcda()
422 ci_ptr->num * 2 * GCOV_UNIT_SIZE); in convert_to_gcda()
424 for (cv_idx = 0; cv_idx < ci_ptr->num; cv_idx++) { in convert_to_gcda()
426 ci_ptr->values[cv_idx]); in convert_to_gcda()