]>
Commit | Line | Data |
---|---|---|
06c141a9 | 1 | .TH LSCPU 1 "March 2019" "util-linux" "User Commands" |
5dd7507c | 2 | .SH NAME |
67f1d481 | 3 | lscpu \- display information about the CPU architecture |
5dd7507c | 4 | .SH SYNOPSIS |
e7a5546c | 5 | .B lscpu |
9261d0a1 | 6 | [options] |
5dd7507c CQ |
7 | .SH DESCRIPTION |
8 | .B lscpu | |
bd9b94d1 | 9 | gathers CPU architecture information from sysfs, /proc/cpuinfo and any |
e71040ce | 10 | applicable architecture-specific libraries (e.g.\& librtas on Powerpc). The |
67f1d481 | 11 | command output can be optimized for parsing or for easy readability by humans. |
67f1d481 | 12 | The information includes, for example, the number of CPUs, threads, cores, |
7ff986d3 | 13 | sockets, and Non-Uniform Memory Access (NUMA) nodes. There is also information |
67f1d481 HC |
14 | about the CPU caches and cache sharing, family, model, bogoMIPS, byte order, |
15 | and stepping. | |
e71040ce | 16 | .sp |
bd9b94d1 SB |
17 | In virtualized environments, the CPU architecture information displayed |
18 | reflects the configuration of the guest operating system which is | |
e71040ce BS |
19 | typically different from the physical (host) system. On architectures that |
20 | support retrieving physical topology information, | |
bd9b94d1 SB |
21 | .B lscpu |
22 | also displays the number of physical sockets, chips, cores in the host system. | |
e71040ce | 23 | .sp |
7ff986d3 BS |
24 | Options that result in an output table have a \fIlist\fP argument. Use this |
25 | argument to customize the command output. Specify a comma-separated list of | |
67f1d481 | 26 | column labels to limit the output table to only the specified columns, arranged |
7ff986d3 | 27 | in the specified order. See \fBCOLUMNS\fP for a list of valid column labels. The |
67f1d481 | 28 | column labels are not case sensitive. |
e71040ce | 29 | .sp |
7ff986d3 | 30 | Not all columns are supported on all architectures. If an unsupported column is |
67f1d481 | 31 | specified, \fBlscpu\fP prints the column but does not provide any data for it. |
b8910af5 KZ |
32 | .sp |
33 | The default output formatting on terminal maybe optimized for better | |
34 | readability. The output for non-terminals (e.g. pipes) is never affected by | |
35 | this optimization and it is always in "Field: data\\n" format. | |
67f1d481 | 36 | .SS COLUMNS |
e71040ce BS |
37 | Note that topology elements (core, socket, etc.) use a sequential unique ID |
38 | starting from zero, but CPU logical numbers follow the kernel where there is | |
39 | no guarantee of sequential numbering. | |
67f1d481 HC |
40 | .TP |
41 | .B CPU | |
42 | The logical CPU number of a CPU as used by the Linux kernel. | |
43 | .TP | |
44 | .B CORE | |
7ff986d3 | 45 | The logical core number. A core can contain several CPUs. |
67f1d481 HC |
46 | .TP |
47 | .B SOCKET | |
7ff986d3 | 48 | The logical socket number. A socket can contain several cores. |
67f1d481 HC |
49 | .TP |
50 | .B BOOK | |
7ff986d3 | 51 | The logical book number. A book can contain several sockets. |
67f1d481 | 52 | .TP |
b3adf6ef HC |
53 | .B DRAWER |
54 | The logical drawer number. A drawer can contain several books. | |
55 | .TP | |
67f1d481 | 56 | .B NODE |
6417dd7f | 57 | The logical NUMA node number. A node can contain several drawers. |
67f1d481 HC |
58 | .TP |
59 | .B CACHE | |
60 | Information about how caches are shared between CPUs. | |
61 | .TP | |
62 | .B ADDRESS | |
63 | The physical address of a CPU. | |
64 | .TP | |
65 | .B ONLINE | |
66 | Indicator that shows whether the Linux instance currently makes use of the CPU. | |
67 | .TP | |
68 | .B CONFIGURED | |
69 | Indicator that shows if the hypervisor has allocated the CPU to the virtual | |
7ff986d3 | 70 | hardware on which the Linux instance runs. CPUs that are configured can be set |
67f1d481 HC |
71 | online by the Linux instance. |
72 | This column contains data only if your hardware system and hypervisor support | |
73 | dynamic CPU resource allocation. | |
74 | .TP | |
75 | .B POLARIZATION | |
76 | This column contains data for Linux instances that run on virtual hardware with | |
7ff986d3 | 77 | a hypervisor that can switch the CPU dispatching mode (polarization). The |
67f1d481 HC |
78 | polarization can be: |
79 | .RS | |
80 | .TP 12 | |
81 | .B horizontal\fP | |
82 | The workload is spread across all available CPUs. | |
83 | .TP 12 | |
84 | .B vertical | |
85 | The workload is concentrated on few CPUs. | |
86 | .P | |
87 | For vertical polarization, the column also shows the degree of concentration, | |
7ff986d3 | 88 | high, medium, or low. This column contains data only if your hardware system |
67f1d481 | 89 | and hypervisor support CPU polarization. |
bfbe985e | 90 | .RE |
e4b768c7 | 91 | .TP |
bfbe985e | 92 | .B MAXMHZ |
6417dd7f | 93 | Maximum megahertz value for the CPU. Useful when \fBlscpu\fP is used as hardware |
d640dd94 | 94 | inventory information gathering tool. Notice that the megahertz value is |
e4b768c7 | 95 | dynamic, and driven by CPU governor depending on current resource need. |
bfbe985e HC |
96 | .TP |
97 | .B MINMHZ | |
98 | Minimum megahertz value for the CPU. | |
5dd7507c | 99 | .SH OPTIONS |
e7a5546c | 100 | .TP |
0ad29ff6 | 101 | .BR \-a , " \-\-all" |
7ff986d3 BS |
102 | Include lines for online and offline CPUs in the output (default for \fB-e\fR). |
103 | This option may only be specified together with option \fB-e\fR or \fB-p\fR. | |
23e9e95a | 104 | .TP |
2011528b KZ |
105 | .BR \-B , " \-\-bytes" |
106 | Print the sizes in bytes rather than in a human-readable format. | |
107 | .TP | |
23e9e95a | 108 | .BR \-b , " \-\-online" |
7ff986d3 BS |
109 | Limit the output to online CPUs (default for \fB-p\fR). |
110 | This option may only be specified together with option \fB-e\fR or \fB-p\fR. | |
7afc2387 | 111 | .TP |
0e86bc84 KZ |
112 | .BR \-C , " \-\-caches" [=\fIlist\fP] |
113 | Display details about CPU caches. For details about available information see \fB\-\-help\fR | |
114 | output. | |
115 | ||
116 | If the \fIlist\fP argument is omitted, all columns for which data is available | |
117 | are included in the command output. | |
118 | ||
119 | When specifying the \fIlist\fP argument, the string of option, equal sign (=), and | |
120 | \fIlist\fP must not contain any blanks or other whitespace. | |
121 | Examples: '\fB-C=NAME,ONE-SIZE\fP' or '\fB--caches=NAME,ONE-SIZE\fP'. | |
122 | .TP | |
7afc2387 | 123 | .BR \-c , " \-\-offline" |
7ff986d3 BS |
124 | Limit the output to offline CPUs. |
125 | This option may only be specified together with option \fB-e\fR or \fB-p\fR. | |
ba45d8c1 | 126 | .TP |
7ff986d3 | 127 | .BR \-e , " \-\-extended" [=\fIlist\fP] |
e71040ce | 128 | Display the CPU information in human-readable format. |
ba45d8c1 | 129 | |
67f1d481 HC |
130 | If the \fIlist\fP argument is omitted, all columns for which data is available |
131 | are included in the command output. | |
ba45d8c1 | 132 | |
67f1d481 | 133 | When specifying the \fIlist\fP argument, the string of option, equal sign (=), and |
7ff986d3 | 134 | \fIlist\fP must not contain any blanks or other whitespace. |
67f1d481 | 135 | Examples: '\fB-e=cpu,node\fP' or '\fB--extended=cpu,node\fP'. |
ba45d8c1 | 136 | .TP |
e7a5546c | 137 | .BR \-h , " \-\-help" |
b4362b6f | 138 | Display help text and exit. |
e7a5546c | 139 | .TP |
19a5510b KZ |
140 | .BR \-J , " \-\-json" |
141 | Use JSON output format for the default summary or extended output (see \fB\-\-extended\fP). | |
19a5510b | 142 | .TP |
7ff986d3 | 143 | .BR \-p , " \-\-parse" [=\fIlist\fP] |
67f1d481 | 144 | Optimize the command output for easy parsing. |
477251f8 | 145 | |
67f1d481 | 146 | If the \fIlist\fP argument is omitted, the command output is compatible with earlier |
7ff986d3 BS |
147 | versions of \fBlscpu\fP. In this compatible format, two commas are used to separate |
148 | CPU cache columns. If no CPU caches are identified the cache column is omitted. | |
ba45d8c1 | 149 | .br |
67f1d481 | 150 | If the \fIlist\fP argument is used, cache columns are separated with a colon (:). |
477251f8 | 151 | |
67f1d481 | 152 | When specifying the \fIlist\fP argument, the string of option, equal sign (=), and |
7ff986d3 | 153 | \fIlist\fP must not contain any blanks or other whitespace. |
67f1d481 | 154 | Examples: '\fB-p=cpu,node\fP' or '\fB--parse=cpu,node\fP'. |
9b207793 BS |
155 | .TP |
156 | .BR \-s , " \-\-sysroot " \fIdirectory\fP | |
67f1d481 | 157 | Gather CPU data for a Linux instance other than the instance from which the |
7ff986d3 | 158 | \fBlscpu\fP command is issued. The specified \fIdirectory\fP is the system root |
67f1d481 | 159 | of the Linux instance to be inspected. |
4f912c6a KZ |
160 | .TP |
161 | .BR \-x , " \-\-hex" | |
65ba9a8c KZ |
162 | Use hexadecimal masks for CPU sets (for example "ff"). The default is to print |
163 | the sets in list format (for example 0,1). Note that before version 2.30 the mask | |
164 | has been printed with 0x prefix. | |
44de912c | 165 | .TP |
0d2b5d2a HC |
166 | .BR \-y , " \-\-physical" |
167 | Display physical IDs for all columns with topology elements (core, socket, etc.). | |
168 | Other than logical IDs, which are assigned by \fBlscpu\fP, physical IDs are | |
169 | platform-specific values that are provided by the kernel. Physical IDs are not | |
170 | necessarily unique and they might not be arranged sequentially. | |
171 | If the kernel could not retrieve a physical ID for an element \fBlscpu\fP prints | |
172 | the dash (-) character. | |
173 | ||
174 | The CPU logical numbers are not affected by this option. | |
175 | .TP | |
44de912c | 176 | .BR \-V , " \-\-version" |
67f1d481 | 177 | Display version information and exit. |
fbf0619b SK |
178 | .TP |
179 | .B \-\-output\-all | |
180 | Output all available columns. This option must be combined with either | |
06c141a9 | 181 | .BR \-\-extended ", " \-\-parse " or " \-\-caches . |
5dd7507c | 182 | .SH BUGS |
7ff986d3 | 183 | The basic overview of CPU family, model, etc. is always based on the first |
7e03f383 | 184 | CPU only. |
c8b64f6d | 185 | |
9b207793 | 186 | Sometimes in Xen Dom0 the kernel reports wrong data. |
67f1d481 HC |
187 | |
188 | On virtual hardware the number of cores per socket, etc. can be wrong. | |
5dd7507c | 189 | .SH AUTHOR |
7e03f383 | 190 | .nf |
5dd7507c | 191 | Cai Qian <qcai@redhat.com> |
7e03f383 | 192 | Karel Zak <kzak@redhat.com> |
67f1d481 | 193 | Heiko Carstens <heiko.carstens@de.ibm.com> |
7e03f383 | 194 | .fi |
0b57c6c2 | 195 | .SH "SEE ALSO" |
67f1d481 | 196 | .BR chcpu (8) |
5dd7507c | 197 | .SH AVAILABILITY |
601d12fb | 198 | The lscpu command is part of the util-linux package and is available from |
d673b74e | 199 | https://www.kernel.org/pub/linux/utils/util-linux/. |