Back to home page

OSCL-LXR

 
 

    


0001 // SPDX-License-Identifier: GPL-2.0
0002 
0003 #include <linux/export.h>
0004 #include <linux/kernel.h>
0005 #include <linux/mutex.h>
0006 #include "gcov.h"
0007 
0008 /*
0009  * __gcov_init is called by gcc-generated constructor code for each object
0010  * file compiled with -fprofile-arcs.
0011  */
0012 void __gcov_init(struct gcov_info *info)
0013 {
0014     static unsigned int gcov_version;
0015 
0016     mutex_lock(&gcov_lock);
0017     if (gcov_version == 0) {
0018         gcov_version = gcov_info_version(info);
0019         /*
0020          * Printing gcc's version magic may prove useful for debugging
0021          * incompatibility reports.
0022          */
0023         pr_info("version magic: 0x%x\n", gcov_version);
0024     }
0025     /*
0026      * Add new profiling data structure to list and inform event
0027      * listener.
0028      */
0029     gcov_info_link(info);
0030     if (gcov_events_enabled)
0031         gcov_event(GCOV_ADD, info);
0032     mutex_unlock(&gcov_lock);
0033 }
0034 EXPORT_SYMBOL(__gcov_init);
0035 
0036 /*
0037  * These functions may be referenced by gcc-generated profiling code but serve
0038  * no function for kernel profiling.
0039  */
0040 void __gcov_flush(void)
0041 {
0042     /* Unused. */
0043 }
0044 EXPORT_SYMBOL(__gcov_flush);
0045 
0046 void __gcov_merge_add(gcov_type *counters, unsigned int n_counters)
0047 {
0048     /* Unused. */
0049 }
0050 EXPORT_SYMBOL(__gcov_merge_add);
0051 
0052 void __gcov_merge_single(gcov_type *counters, unsigned int n_counters)
0053 {
0054     /* Unused. */
0055 }
0056 EXPORT_SYMBOL(__gcov_merge_single);
0057 
0058 void __gcov_merge_delta(gcov_type *counters, unsigned int n_counters)
0059 {
0060     /* Unused. */
0061 }
0062 EXPORT_SYMBOL(__gcov_merge_delta);
0063 
0064 void __gcov_merge_ior(gcov_type *counters, unsigned int n_counters)
0065 {
0066     /* Unused. */
0067 }
0068 EXPORT_SYMBOL(__gcov_merge_ior);
0069 
0070 void __gcov_merge_time_profile(gcov_type *counters, unsigned int n_counters)
0071 {
0072     /* Unused. */
0073 }
0074 EXPORT_SYMBOL(__gcov_merge_time_profile);
0075 
0076 void __gcov_merge_icall_topn(gcov_type *counters, unsigned int n_counters)
0077 {
0078     /* Unused. */
0079 }
0080 EXPORT_SYMBOL(__gcov_merge_icall_topn);
0081 
0082 void __gcov_exit(void)
0083 {
0084     /* Unused. */
0085 }
0086 EXPORT_SYMBOL(__gcov_exit);