Function report |
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 activity | Download SCCT | Chinese |
Name:show_cpuinfo
Proto:static int show_cpuinfo(struct seq_file *m, void *v)
Type:int
Parameter:
| Type | Parameter | Name |
|---|---|---|
| struct seq_file * | m | |
| void * | v |
| 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) |
| 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: ) |
| 98 | show_cpuinfo_misc(m, c) |
| 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]) |
| 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) |
| 129 | If i < ARRAY_SIZE - get the number of elements in array @arr*@arr: array to be sized(x86_power_flags) && x86_power_flags[i] Then seq_printf(m, "%s%s", x86_power_flags[i][0] ? " " : "", x86_power_flags[i]) |
| 134 | Else seq_printf(m, " [%d]", i) |
| 141 | Return 0 |
| Source code conversion tool public plug-in interface | X |
|---|---|
| Support c/c++/esqlc/java Oracle/Informix/Mysql Plug-in can realize: logical Report Code generation and batch code conversion |