Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:arch\x86\kernel\cpu\proc.c Create Date:2022-07-28 07:57:01
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:show_cpuinfo

Proto:static int show_cpuinfo(struct seq_file *m, void *v)

Type:int

Parameter:

TypeParameterName
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  If x86_stepping || Maximum supported CPUID level, -1=no CPUID: >= 0 Then seq_printf(m, "stepping\t: %d\n", x86_stepping)
77  Else seq_puts(m, "stepping\t: unknown\n")
79  If microcode Then seq_printf(m, "microcode\t: 0x%x\n", microcode)
82  If cpu_has(c, Time Stamp Counter ) Then
83  freq = aperfmperf_get_khz(cpu)
85  If Not freq Then freq = cpufreq_quick_get(cpu)
87  If Not freq Then freq = TSC clocks / usec, not used here
89  seq_printf(m, "cpu MHz\t\t: %u.%03u\n", freq / 1000, (freq % 1000))
94  If KB - valid for CPUS which support this call: Then 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  When i < 32 * N 32-bit words worth of info cycle If (cpu_has(c, i) && x86_cap_flags[i] != NULL) Then
103  seq_printf(m, " %s", x86_cap_flags[i])
105  seq_puts(m, "\nbugs\t\t:")
106  When i < 32 * N 32-bit bug flags cycle
107  bug_bit = 32 * N 32-bit words worth of info + i
109  If cpu_has_bug(c, bug_bit) && In order to save room, we index into this array by doing[i] Then seq_printf(m, " %s", In order to save room, we index into this array by doing[i])
113  seq_printf(m, "\nbogomips\t: %lu.%02lu\n", loops_per_jiffy / (500000 / HZ), (loops_per_jiffy / (5000 / HZ)) % 100)
118  If Number of 4K pages in DTLB/ITLB combined(in pages): > 0 Then 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  When i < 32 cycle
128  If x86_power & 1 << i Then
134  Else seq_printf(m, " [%d]", i)
139  seq_puts(m, "\n\n")
141  Return 0