函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:arch\x86\kernel\cpu\proc.c Create Date:2022-07-27 08:57:21
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:show_cpuinfo

函数原型:static int show_cpuinfo(struct seq_file *m, void *v)

返回类型:int

参数:

类型参数名称
struct seq_file *m
void *v
59  c等于v
63  cpu等于Index into per_cpu list:
64  seq_printf(m, "processor\t: %u\nvendor_id\t: %s\ncpu family\t: %d\nmodel\t\t: %u\nmodel name\t: %s\n", cpu, x86_vendor_id[0] ? x86_vendor_id : "unknown", CPU family , x86_model, x86_model_id[0] ? x86_model_id : "unknown")
75  如果x86_steppingMaximum supported CPUID level, -1=no CPUID: 大于等于0则seq_printf(m, "stepping\t: %d\n", x86_stepping)
77  否则seq_puts(m, "stepping\t: unknown\n")
79  如果microcodeseq_printf(m, "microcode\t: 0x%x\n", microcode)
82  如果cpu_has(c, Time Stamp Counter )则
83  freq等于aperfmperf_get_khz(cpu)
85  如果非freqfreq等于cpufreq_quick_get(cpu)
87  如果非freqfreq等于TSC clocks / usec, not used here
89  seq_printf(m, "cpu MHz\t\t: %u.%03u\n", freq / 1000, (freq % 1000))
94  如果 KB - valid for CPUS which support this call: seq_printf(m, "cache size\t: %u KB\n", KB - valid for CPUS which support this call: )
97  Get CPU information for use by the procfs.
98  show_cpuinfo_misc(m, c)
100  seq_puts(m, "flags\t\t:")
101 i小于32乘N 32-bit words worth of info 循环如果(cpu_has(c, i) && x86_cap_flags[i] != NULL)则
103  seq_printf(m, " %s", x86_cap_flags[i])
105  seq_puts(m, "\nbugs\t\t:")
106 i小于32乘N 32-bit bug flags 循环
107  bug_bit等于32乘N 32-bit words worth of info i
109  如果cpu_has_bug(c, bug_bit)且In order to save room, we index into this array by doing* X86_BUG_ - NCAPINTS*32.[i]则seq_printf(m, " %s", In order to save room, we index into this array by doing* X86_BUG_ - NCAPINTS*32.[i])
113  seq_printf(m, "\nbogomips\t: %lu.%02lu\n", loops_per_jiffy / (500000 / HZ), (loops_per_jiffy / (5000 / HZ)) % 100)
118  如果Number of 4K pages in DTLB/ITLB combined(in pages): 大于0则seq_printf(m, "TLB size\t: %d 4K pages\n", Number of 4K pages in DTLB/ITLB combined(in pages): )
121  seq_printf(m, "clflush size\t: %u\n", x86_clflush_size)
122  seq_printf(m, "cache_alignment\t: %d\n", In bytes )
123  seq_printf(m, "address sizes\t: %u bits physical, %u bits virtual\n", x86_phys_bits, x86_virt_bits)
126  seq_puts(m, "power management:")
127 i小于32循环
128  如果x86_power按位与1左移i位则
134  否则seq_printf(m, " [%d]", i)
139  seq_puts(m, "\n\n")
141  返回:0