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