1 // SPDX-License-Identifier: GPL-2.0
3 #include <linux/export.h>
4 #include <linux/kernel.h>
5 #include <linux/mutex.h>
9 * __gcov_init is called by gcc-generated constructor code for each object
10 * file compiled with -fprofile-arcs.
12 void __gcov_init(struct gcov_info
*info
)
14 static unsigned int gcov_version
;
16 mutex_lock(&gcov_lock
);
17 if (gcov_version
== 0) {
18 gcov_version
= gcov_info_version(info
);
20 * Printing gcc's version magic may prove useful for debugging
21 * incompatibility reports.
23 pr_info("version magic: 0x%x\n", gcov_version
);
26 * Add new profiling data structure to list and inform event
30 if (gcov_events_enabled
)
31 gcov_event(GCOV_ADD
, info
);
32 mutex_unlock(&gcov_lock
);
34 EXPORT_SYMBOL(__gcov_init
);
37 * These functions may be referenced by gcc-generated profiling code but serve
38 * no function for kernel profiling.
40 void __gcov_flush(void)
44 EXPORT_SYMBOL(__gcov_flush
);
46 void __gcov_merge_add(gcov_type
*counters
, unsigned int n_counters
)
50 EXPORT_SYMBOL(__gcov_merge_add
);
52 void __gcov_merge_single(gcov_type
*counters
, unsigned int n_counters
)
56 EXPORT_SYMBOL(__gcov_merge_single
);
58 void __gcov_merge_delta(gcov_type
*counters
, unsigned int n_counters
)
62 EXPORT_SYMBOL(__gcov_merge_delta
);
64 void __gcov_merge_ior(gcov_type
*counters
, unsigned int n_counters
)
68 EXPORT_SYMBOL(__gcov_merge_ior
);
70 void __gcov_merge_time_profile(gcov_type
*counters
, unsigned int n_counters
)
74 EXPORT_SYMBOL(__gcov_merge_time_profile
);
76 void __gcov_merge_icall_topn(gcov_type
*counters
, unsigned int n_counters
)
80 EXPORT_SYMBOL(__gcov_merge_icall_topn
);
82 void __gcov_exit(void)
86 EXPORT_SYMBOL(__gcov_exit
);