LCOV - code coverage report
Current view: top level - fs/proc - cpuinfo.c (source / functions) Hit Total Coverage
Test: gcov_data_raspi2_real_modules_combined.info Lines: 8 8 100.0 %
Date: 2020-09-30 20:25:40 Functions: 3 3 100.0 %
Branches: 0 0 -

           Branch data     Line data    Source code
       1                 :            : // SPDX-License-Identifier: GPL-2.0
       2                 :            : #include <linux/cpufreq.h>
       3                 :            : #include <linux/fs.h>
       4                 :            : #include <linux/init.h>
       5                 :            : #include <linux/proc_fs.h>
       6                 :            : #include <linux/seq_file.h>
       7                 :            : 
       8                 :       3105 : __weak void arch_freq_prepare_all(void)
       9                 :            : {
      10                 :       3105 : }
      11                 :            : 
      12                 :            : extern const struct seq_operations cpuinfo_op;
      13                 :       3105 : static int cpuinfo_open(struct inode *inode, struct file *file)
      14                 :            : {
      15                 :       3105 :         arch_freq_prepare_all();
      16                 :       3105 :         return seq_open(file, &cpuinfo_op);
      17                 :            : }
      18                 :            : 
      19                 :            : static const struct file_operations proc_cpuinfo_operations = {
      20                 :            :         .open           = cpuinfo_open,
      21                 :            :         .read           = seq_read,
      22                 :            :         .llseek         = seq_lseek,
      23                 :            :         .release        = seq_release,
      24                 :            : };
      25                 :            : 
      26                 :        207 : static int __init proc_cpuinfo_init(void)
      27                 :            : {
      28                 :        207 :         proc_create("cpuinfo", 0, NULL, &proc_cpuinfo_operations);
      29                 :        207 :         return 0;
      30                 :            : }
      31                 :            : fs_initcall(proc_cpuinfo_init);

Generated by: LCOV version 1.14