Linux 5.6.13
[linux/fpc-iii.git] / kernel / gcov / gcc_base.c
blob3cf736b9f880e5a17223ff71130367ec7b9db119
1 // SPDX-License-Identifier: GPL-2.0
3 #include <linux/export.h>
4 #include <linux/kernel.h>
5 #include <linux/mutex.h>
6 #include "gcov.h"
8 /*
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
27 * listener.
29 gcov_info_link(info);
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)
42 /* Unused. */
44 EXPORT_SYMBOL(__gcov_flush);
46 void __gcov_merge_add(gcov_type *counters, unsigned int n_counters)
48 /* Unused. */
50 EXPORT_SYMBOL(__gcov_merge_add);
52 void __gcov_merge_single(gcov_type *counters, unsigned int n_counters)
54 /* Unused. */
56 EXPORT_SYMBOL(__gcov_merge_single);
58 void __gcov_merge_delta(gcov_type *counters, unsigned int n_counters)
60 /* Unused. */
62 EXPORT_SYMBOL(__gcov_merge_delta);
64 void __gcov_merge_ior(gcov_type *counters, unsigned int n_counters)
66 /* Unused. */
68 EXPORT_SYMBOL(__gcov_merge_ior);
70 void __gcov_merge_time_profile(gcov_type *counters, unsigned int n_counters)
72 /* Unused. */
74 EXPORT_SYMBOL(__gcov_merge_time_profile);
76 void __gcov_merge_icall_topn(gcov_type *counters, unsigned int n_counters)
78 /* Unused. */
80 EXPORT_SYMBOL(__gcov_merge_icall_topn);
82 void __gcov_exit(void)
84 /* Unused. */
86 EXPORT_SYMBOL(__gcov_exit);