LCOV - code coverage report
Current view: top level - kernel/gcov - gcc_base.c (source / functions) Hit Total Coverage
Test: landlock.info Lines: 10 27 37.0 %
Date: 2021-04-22 12:43:58 Functions: 1 9 11.1 %

          Line data    Source code
       1             : // SPDX-License-Identifier: GPL-2.0
       2             : 
       3             : #include <linux/export.h>
       4             : #include <linux/kernel.h>
       5             : #include <linux/mutex.h>
       6             : #include "gcov.h"
       7             : 
       8             : /*
       9             :  * __gcov_init is called by gcc-generated constructor code for each object
      10             :  * file compiled with -fprofile-arcs.
      11             :  */
      12         955 : void __gcov_init(struct gcov_info *info)
      13             : {
      14         955 :         static unsigned int gcov_version;
      15             : 
      16         955 :         mutex_lock(&gcov_lock);
      17         955 :         if (gcov_version == 0) {
      18           1 :                 gcov_version = gcov_info_version(info);
      19             :                 /*
      20             :                  * Printing gcc's version magic may prove useful for debugging
      21             :                  * incompatibility reports.
      22             :                  */
      23           1 :                 pr_info("version magic: 0x%x\n", gcov_version);
      24             :         }
      25             :         /*
      26             :          * Add new profiling data structure to list and inform event
      27             :          * listener.
      28             :          */
      29         955 :         gcov_info_link(info);
      30         955 :         if (gcov_events_enabled)
      31           0 :                 gcov_event(GCOV_ADD, info);
      32         955 :         mutex_unlock(&gcov_lock);
      33         955 : }
      34             : EXPORT_SYMBOL(__gcov_init);
      35             : 
      36             : /*
      37             :  * These functions may be referenced by gcc-generated profiling code but serve
      38             :  * no function for kernel profiling.
      39             :  */
      40           0 : void __gcov_flush(void)
      41             : {
      42             :         /* Unused. */
      43           0 : }
      44             : EXPORT_SYMBOL(__gcov_flush);
      45             : 
      46           0 : void __gcov_merge_add(gcov_type *counters, unsigned int n_counters)
      47             : {
      48             :         /* Unused. */
      49           0 : }
      50             : EXPORT_SYMBOL(__gcov_merge_add);
      51             : 
      52           0 : void __gcov_merge_single(gcov_type *counters, unsigned int n_counters)
      53             : {
      54             :         /* Unused. */
      55           0 : }
      56             : EXPORT_SYMBOL(__gcov_merge_single);
      57             : 
      58           0 : void __gcov_merge_delta(gcov_type *counters, unsigned int n_counters)
      59             : {
      60             :         /* Unused. */
      61           0 : }
      62             : EXPORT_SYMBOL(__gcov_merge_delta);
      63             : 
      64           0 : void __gcov_merge_ior(gcov_type *counters, unsigned int n_counters)
      65             : {
      66             :         /* Unused. */
      67           0 : }
      68             : EXPORT_SYMBOL(__gcov_merge_ior);
      69             : 
      70           0 : void __gcov_merge_time_profile(gcov_type *counters, unsigned int n_counters)
      71             : {
      72             :         /* Unused. */
      73           0 : }
      74             : EXPORT_SYMBOL(__gcov_merge_time_profile);
      75             : 
      76           0 : void __gcov_merge_icall_topn(gcov_type *counters, unsigned int n_counters)
      77             : {
      78             :         /* Unused. */
      79           0 : }
      80             : EXPORT_SYMBOL(__gcov_merge_icall_topn);
      81             : 
      82           0 : void __gcov_exit(void)
      83             : {
      84             :         /* Unused. */
      85           0 : }
      86             : EXPORT_SYMBOL(__gcov_exit);

Generated by: LCOV version 1.14