However I'd like to see one change if you don't object: printing just "N" or
"Y" instead of "No" and "Yes" in the human readable output looks a bit ugly to
me.
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Reduce code duplication and print better error message if an
unsupported cpu number was passed.
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Some vendors have several hypervisors. Therefore it makes sense to not only
print out the hypervisor vendor but also the name of the hypervisor.
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
The parsable output includes only lines of online CPUs. To also include
lines for all offline CPUs the "--all" option can be specified.
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
lscpu only prints lines for online CPUs. At least for the human readable
list the offline CPUs are of interest as well. In order to distinguish
between online and offline CPUs introduce the "Online" column.
By default the human readable output now displays online and offline CPUs.
The parsable output is not changed. It will print only lines for online
CPUs as it used to do.
[kzak@redhat.com: - minor changes]
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
CPUs may be in a configured or deconfigured state depending if the CPU resource
may be used by the guest. If a CPU is in configured state the guest may use it
(i.e. set it online). It it is in deconfigured state it cannot use it before
changing its state to configured. Display this CPU attribute as well.
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Based on patch from Heiko Carstens <heiko.carstens@de.ibm.com>:
lscpu currently only supports a parsable output which contains a row for
each cpu and its attributes. This output contains only comas as separators
and is hard to read for humans.
Therefore add a new option "-e | --extended" which outputs the rows in a
much more readable (and non-parsable) form. Just like for the -p option a
list of columns can be specified that shall be included in the output.
By default this option will print all columns that contain data.
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
Add a --version option like most other tools have it.
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
First check path before accessing files to be sure they actually exist. This is
necessary when also informations for offline CPUs will be printed. Since we do
not necessarily know if "cpu is offline" means the same as "path does not
exist" just check for it.
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Simplify the logic to "always print a ',' for each cache except if it is the
last one. This is also a preparation patch for printing the cache column for
offline CPUs where it would print one colon too much because of the current
logic.
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
The extended parsable output prints a colon instead of comma between each
item. The case where a CPU doesn't belong to any cache was not converted.
Just fix this.
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Fix typo where the comma operator has been introduced.
Use a semicolon instead so we end up with simple assignment expressions.
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
* dmesg(1) incorrectly assumes that lines like "<6>\n"
are broken.
* it's more robust to assume the end of the record is "\n<"
* print \n for empty lines
Reported-by: "Gabor Z. Papp" <gzp@papp.hu>
Signed-off-by: Karel Zak <kzak@redhat.com>
* 'docs-dir' of https://github.com/kerolasa/lelux-utiliteetit:
docs: remove duplicated text
docs: require kernel support before accepting use of it
docs: note about independent super block structs
docs: add libmount & libblkid debug instructions
Documentation: add debugging doc
arch: start using arch as a usage() example
docs: new file Documentation/release-schedule.txt
docs: move setuid information from reame to hwclock.8
docs: clean up old readme files
docs: copy contributors from legacy files to AUTHORS
docs: new file Documentation/howto-man-page.txt
docs: new file Documentation/source-code-management.txt
docs: new file Documentation/howto-contribute.txt
docs: new file Documentation/howto-compilation.txt
docs: tell what the Documentation/ is about
docs: add usage() howto for contributors
docs: Documentation directory added
docs: remove README.clear
Add two spaces as the required third argument of the date line to make
the specified date get used instead of today's date. Incorporate the
section number into the page title, then use an empty section number,
so that specifying an explicit section/volume name will work.
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
The arch command is hijacked to be example of howto write usage
as defined in Documentation/howto-usage-function.txt
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
chcpu can modify the logical state of CPUs. It can enable and disable CPUs,
scan for new CPUs, change the CPU dispatching mode of the underlying
hypervisor and request (configure) or give logical CPUs back (deconfigure)
to the the underlying hypervisor.
This is quite useful if you work a lot with virtual servers, since doing all
the configuration stuff directly via sysfs becomes a pain.
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Use dates without the day, use the full month name, put "util-linux" in
the lower left corner, and "User Commands" or "System Administration"
at the top center.
Also improve here and there the one-line program description.
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
Since util-linux commit a7ee94f220,
dmesg incorrectly calculates number of bytes that are remaining in the
buffer in get_next_record(). This could, under specific circumstances,
cause printing mess at the end of dmesg output:
> dmesg | tail
[ 1191.478725] Adding 285488k swap on /root/swapfile. Priority:-2 extents:15 across:1186612k
[ 1205.588331] Adding 285488k swap on /root/swapfile. Priority:-2 extents:15 across:1186612k
\xffffffba\xffffffba
Reported-by: Glenn Doig <doiggl@velocitynet.com.au>
Addresses: https://bugzilla.novell.com/show_bug.cgi?id=710417
Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
This is a preparation patch for chcpu. If a cpu should be added to
a cpu_set where the cpu doesn't fit into the cpu_set this got silently
ignored.
Since the cpu-list is user space provided it should be checked if cpus
are specified that are completely out of range of the system.
In order to do that add a parameter which specifies if cpulist_parse()
should fail if it parses a cpu-list with "impossible" cpus.
The current callers have been converted so they behave like before.
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Print also the physical cpu address for each logical cpu in parsable
output if selected and present via sysfs.
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
When running in different dispatching mode the virtual cpus may
have different polarizations.
E.g. in "vertical" mode cpus may have a polarization of "vertical:high"
which means the virtual cpu has dedicated physical cpu assigned.
Print this information in the parsable output.
Note that this breaks the current rule that
a) the parseable output contains only numbers
b) these numbers are equal or increased in each line
Since however this new item must be selected with the "list" argument
this shouldn't be a problem.
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
A virtual guest my run in either "horiziontal" or "vertical" mode
which is the mode in which the underlying hypervisor schedules the
guest cpu.
Since this is of interest print this in the readable output.
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
The readable output prints also informations like cores per socket etc.
On newer kernel versions on s390 this information is available via
/proc/sysinfo. However it does not contain the layout of the guest but
the layout of the real machine.
Nevertheless this is better than random guessing with completely broken
numbers like we have it now on s390. If the information is not available
we fall back to old mechanism with more or less random numbers.
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
The fallback calculation of nthreads did not consider books.
In order to avoid division/multiply by/with zero make sure each number
used is at least "1".
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Completely virtualized architectures like s390 may have multiple
virtual sockets and/or cores where each of them has a different
number of cores and cpus.
So the general assumption within the allocation scheme that e.g.
each socket contains the same number of cores is not necessarily
true. To make sure the arrays are always large enough we simply
allocate enough memory so that each array could hold cpu masks
for all present cpus.
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>