LCOV - code coverage report
Current view: top level - fs/proc - cpuinfo.c (source / functions) Hit Total Coverage
Test: landlock.info Lines: 3 8 37.5 %
Date: 2021-04-22 12:43:58 Functions: 1 3 33.3 %

          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           0 : __weak void arch_freq_prepare_all(void)
       9             : {
      10           0 : }
      11             : 
      12             : extern const struct seq_operations cpuinfo_op;
      13           0 : static int cpuinfo_open(struct inode *inode, struct file *file)
      14             : {
      15           0 :         arch_freq_prepare_all();
      16           0 :         return seq_open(file, &cpuinfo_op);
      17             : }
      18             : 
      19             : static const struct proc_ops cpuinfo_proc_ops = {
      20             :         .proc_flags     = PROC_ENTRY_PERMANENT,
      21             :         .proc_open      = cpuinfo_open,
      22             :         .proc_read_iter = seq_read_iter,
      23             :         .proc_lseek     = seq_lseek,
      24             :         .proc_release   = seq_release,
      25             : };
      26             : 
      27           1 : static int __init proc_cpuinfo_init(void)
      28             : {
      29           1 :         proc_create("cpuinfo", 0, NULL, &cpuinfo_proc_ops);
      30           1 :         return 0;
      31             : }
      32             : fs_initcall(proc_cpuinfo_init);

Generated by: LCOV version 1.14