Commit Graph

281 Commits

Author SHA1 Message Date
Sami Kerola 7cebf0bb4f docs: corrections to FSF license files, and postal address
The COPYING and Documentation/licenses/COPYING* files are being
replaced by files from GNU web site.

http://www.gnu.org/licenses/gpl-2.0.txt
http://www.gnu.org/licenses/lgpl-2.1.txt

Postal addresses to FSF in other files are updated to match with the
address in license files.

Reference: http://lists.gnu.org/archive/html/freefont-announce/2005-04/msg00001.html
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2012-02-24 14:13:35 +01:00
Karel Zak ad655c88ff lscpu: fix fd leak
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-02-02 12:32:45 +01:00
Karel Zak 701e2b8e53 chcpu: check get_max_number_of_cpus() result properly
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-02-01 12:26:32 +01:00
Karel Zak 960bf13048 lscpu: dereferencing NULL pointer [coverity scan]
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-01-31 15:00:52 +01:00
Davidlohr Bueso 756d79cd63 lscpu: fix compiler warnings
The string format is not being passed triggering:

    lscpu.c: In function ‘read_hypervisor’:
    lscpu.c:545:4: warning: format not a string literal and no format arguments
    lscpu.c: In function ‘get_cell_header’:
    lscpu.c:904:2: warning: format not a string literal and no format arguments
    lscpu.c:904:2: warning: format not a string literal and no format arguments

Signed-off-by: Davidlohr Bueso <dave@gnu.org>
2012-01-05 17:09:27 +01:00
Dave Reisner 8290a24952 lscpu: use xalloc libs
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2012-01-04 13:53:38 +01:00
Karel Zak 3d27b76ac1 lscpu: add columns description to help, fix header for parsable output
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-10-11 12:23:23 +02:00
Heiko Carstens f23608b892 lscpu: fix typo in help text
Add missing 'n' in help text for extended output line.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
2011-10-11 11:36:05 +02:00
Heiko Carstens 847b982ee3 lscpu: switch Yes/No output to lower case
Some people complained about the first letter of Yes/No as seen in the
online and configured column in the human readabe output being a capital
letter instead of the expected lower case letter.
So let's try to make everbody happy and convert them to lower case.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
2011-10-11 11:36:03 +02:00
Heiko Carstens 7bbb7829ca lscpu: stricter command line parsing
Disallow superfluous commands for lscpu like e.g. "lscpu bla" and let it
fail print the help text instead.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
2011-09-27 14:48:33 +02:00
Heiko Carstens 7afc23874e lscpu: add --offline option
Implement "--offline" option which only prints offline cpus. As a side effect
we can get rid of the internal "allcpus" flag, since if we want to print
informations for online and offline cpus we simply set both flags.

When reading sysfs attributes of cpus this is now done for all cpus, since
e.g. the topology informations of the online cpus may influence the
topology informations of the offline cpus. This mainly because online cpus
may contain masks which include offline cpus while offline cpus have a
missing topology directory.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
2011-09-27 14:48:33 +02:00
Heiko Carstens 81137d1c0b lscpu: fix -e output
The modifier mod->allcpus must be set earlier and also must be used
earlier. The current code only reads sysfs attributes from online
cpus but skips offline cpus.
So initialize mod->allcpus earlier.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
2011-09-27 13:37:52 +02:00
Heiko Carstens 8148217b5b lib,path: move path access functions from lscpu into lib/path.c
A couple of these functions already have been copied to chcpu.c,
so it makes sense to move these functions into an own file.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
2011-09-27 13:36:41 +02:00
Karel Zak b9d18bc3f8 lscpu: add column names to --help
* use uppercase by default (only -p uses lowercase)
 * a little cleanup usage()

Signed-off-by: Karel Zak <kzak@redhat.com>
2011-09-27 12:45:42 +02:00
Karel Zak 50c6ee4cb4 lscpu: gettextize two columns
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-09-27 12:26:02 +02:00
Heiko Carstens e43fc13e76 lscpu: s/Y/Yes/ s/N/No/
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>
2011-09-12 12:39:30 +02:00
Heiko Carstens 10829cd73c lscpu: add Hypervisor to output
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>
2011-09-09 23:54:01 +02:00
Karel Zak 23e9e95ac3 lscpu: add --online option
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-09-09 23:50:41 +02:00
Heiko Carstens 0ad29ff6b0 lscpu: add --all option
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>
2011-09-09 23:50:01 +02:00
Heiko Carstens a7e5300c97 lscpu: add online state to output
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>
2011-09-09 23:49:22 +02:00
Heiko Carstens d231eea114 lscpu: add configured state to output
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>
2011-09-09 23:41:25 +02:00
Karel Zak ba45d8c1ea lscpu: add human readable extended cpu table output
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>
2011-09-09 23:41:01 +02:00
Karel Zak e3b3a2f3f8 lscpu: use buffer for data and headers
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-09-09 23:40:28 +02:00
Karel Zak e9d659ea85 lscpu: use function to search in cpu masks arrays
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-09-09 23:27:40 +02:00
Karel Zak 8005924a89 lscpu: cleanup output modes
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-09-09 07:25:21 +02:00
Heiko Carstens 44de912cdf lscpu: add --version option
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>
2011-09-09 06:34:43 +02:00
Heiko Carstens dcdead4271 lscpu: allow read_cache() to be called for offline cpus
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>
2011-09-09 06:30:06 +02:00
Heiko Carstens f6512068b2 lscpu: simplify cache column output function
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>
2011-09-09 06:24:26 +02:00
Heiko Carstens 08cd09415a lscpu: fix cache output for extended parsable output
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>
2011-09-09 06:24:14 +02:00
Heiko Carstens c403ae6a1a lscpu: remove comma operator
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>
2011-09-09 06:24:12 +02:00
Karel Zak b82c15bd19 Merge branch 'chcpu' of git://git.kernel.org/pub/scm/linux/kernel/git/heiko/util-linux
* 'chcpu' of git://git.kernel.org/pub/scm/linux/kernel/git/heiko/util-linux:
  chcpu: new tool
  cpuset: add option to allow cpulist_parse() to fail
2011-08-31 11:49:27 +02:00
Karel Zak e8a728df31 Merge branch 'lscpu' of git://git.kernel.org/pub/scm/linux/kernel/git/heiko/util-linux
* 'lscpu' of git://git.kernel.org/pub/scm/linux/kernel/git/heiko/util-linux:
  lscpu: add physical cpu address to parseable output
  lscpu: add cpu polarization to parseable output
  lscpu: show dispatching mode
  lscpu: use hypervisor generated topology information
  lscpu: detect IBM hypervisor
  lscpu: fix fallback nthreads calculation
  lscpu: fix cpu map array sizes
  lscpu: fix s390 bogomips detection coding style
2011-08-30 12:05:05 +02:00
Karel Zak 7f1ec5e8d4 lscpu: cleanup usage()
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-08-16 13:28:02 +02:00
Heiko Carstens b16f615afb cpuset: add option to allow cpulist_parse() to fail
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>
2011-08-15 07:52:44 +02:00
Heiko Carstens 596b884510 lscpu: add physical cpu address to parseable output
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>
2011-08-14 17:34:39 +02:00
Heiko Carstens 2b8fcb8138 lscpu: add cpu polarization to parseable output
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>
2011-08-14 17:34:34 +02:00
Heiko Carstens a0fff77e93 lscpu: show dispatching mode
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>
2011-08-14 17:34:30 +02:00
Heiko Carstens 8648ca961f lscpu: use hypervisor generated topology information
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>
2011-08-14 17:34:26 +02:00
Heiko Carstens b8ec7bdfeb lscpu: detect IBM hypervisor
Detect if the hypervisor on s390 is from KVM or IBM.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
2011-08-14 17:34:21 +02:00
Heiko Carstens 32a46618bc lscpu: fix fallback nthreads calculation
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>
2011-08-14 17:34:17 +02:00
Heiko Carstens 9d1a3a18f3 lscpu: fix cpu map array sizes
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>
2011-08-14 17:34:12 +02:00
Heiko Carstens abcd6368e6 lscpu: fix s390 bogomips detection coding style
Just make the s390 bogomips detection line look like all others.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
2011-08-14 17:34:06 +02:00
Karel Zak 329fd1c3a0 lscpu: fix compiler warnings [-Wsign-compare]
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-08-01 13:03:19 +02:00
Karel Zak 477251f8f5 lscpu: extend --parse functionality
... to allow define output columns, for example:

	$ lscpu --parse=CPU,CORE,NODE,CACHE
	# CPU,Core,Node,L1d:L1i:L2
	0,0,0,0:0:0
	1,1,0,1:1:0

Note that CPU caches are separated by ":" in the new format. The
output for --parse (without the list of the columns) is backwardly
compatible, it means:

	$ lscpu --parse
	# CPU,Core,Socket,Node,,L1d,L1i,L2
	0,0,0,0,,0,0,0
	1,1,0,0,,1,1,0

Signed-off-by: Karel Zak <kzak@redhat.com>
2011-07-27 23:10:01 +02:00
Davidlohr Bueso 08de16d003 lscpu: use xalloc
Signed-off-by: Davidlohr Bueso <dave@gnu.org>
2011-07-26 11:58:38 +02:00
Heiko Carstens 56baaa4e1f lscpu: add support for books
This patch adds support for books in cpu topology output. Books are
currently only present on the s390 architecture, however it looks like
others will follow to use the extra scheduling domain of the kernel.

Books are logically between sockets and nodes. In order to not break
any existing tools that might parse the output of lscpu the output
is changed so that books will follow nodes:
CPU,Core,Socket,Node,Book

In addition the readable output is changed from
"CPU socket(s):" to "Socket(s) per book:" or simply "Socket(s):" in the
absence of books.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
2011-07-18 10:46:35 +02:00
Heiko Carstens 1f5b7d4b87 lscpu: fix bogomips detection for s390
s390 has a "bogomips per cpu" string instead of a "bogomips" string in
/proc/sysinfo. So add a second bogomips lookup which detects the s390
variant.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
2011-06-27 16:13:48 +02:00
Stephen Hemminger 99fbc877e5 lscpu: detect VMware hypervisor
Add detection of VMware.
Tested on VMware Workstation 7.1.4

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
2011-06-20 12:53:28 +02:00
Karel Zak c487c90ccd lscpu: detect sun4{u,v} in /proc/cpuinfo for sparc64
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-03-31 14:30:06 +02:00
Karel Zak 4e740fd81a lscpu: fix op-mode for /{sys,proc} dumps
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-03-31 13:09:50 +02:00
Karel Zak e282eec2a2 lscpu: fix threads-per-core calculation
On Thu, Mar 24, 2011 at 01:45:34PM +0100, Jan Engelhardt wrote:
> On a 24-thread/6-core SPARC T1, lscpu would wrongly output "5
> threads per core".
>
> It seems that the 6c T1 is simply an 8c T1 where 2c are disabled
> (offering a lesser model for a lower price, and all that marketing
> fluff). So the machine description header of the 6c T1 reports 32
> threads, but only goes on to provide 24 elements thereafter, which
> is why Linux will report threads 24-31 as "offline". So far so good.
>
> But lscpu would take the number of all (online and offline) threads
> (32) and divides it by the number of online cores (6), which yields
> an odd 5.33 threads/core.
>
> Simply pick the number of online threads.

Based on Jan's patch.

Reported-by: Jan Engelhardt <jengelh@medozas.de>
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-03-31 12:55:13 +02:00
Karel Zak 6c7d5ae9a2 move struct option to .rodata
It does not make sense to have writable large arrays of "struct
option" on the stack.

Signed-off-by: Karel Zak <kzak@redhat.com>
2011-03-03 15:00:30 +01:00
Petr Uzel 4581647a62 lscpu: use xstrdup from xalloc.h
Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
2011-02-21 14:41:36 +01:00
Benno Schulenberg e8ab5ce3d0 textual: improve the wording of some error and usage messages
[kzak@redhat.com: - cleanup lscpu(1) usage text
                  - use <disk> rather than <device> in partx(8)
                    usage text]

Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-02-16 15:46:38 +01:00
Fabian Groffen eb76ca98b0 build-sys: provide alternatives for err, errx, warn and warnx
Solaris lacks err, errx, warn and warnx.  This also means the err.h header
doesn't exist.  Removed err.h include from all files, and included err.h from
c.h instead if it exists, otherwise alternatives are provided.

Signed-off-by: Fabian Groffen <grobian@gentoo.org>
2011-02-14 17:45:24 +01:00
Karel Zak 39561c706a lscpu: cleanup usage()
Signed-off-by: Karel Zak <kzak@redhat.com>
2011-02-08 15:36:28 +01:00
Karel Zak f633ad4e31 lscpu: fix 64bit CPU detection
Note that the code is still not able to detect 64bit on sparcs and
ppc.

Signed-off-by: Karel Zak <kzak@redhat.com>
2011-01-19 09:34:37 +01:00
Fabian Groffen aabe244176 build-sys: use WORDS_BIGENDIAN to determine platform byte-order
Autoconf contains the right magic to determine the endianness on many
platforms next to Linux.  This reverses previous commits to move away
from WORDS_BIGENDIAN:
"use __BYTE_ORDER rather than AC specific WORDS_BIGENDIAN"

This is necessary to compile on non Linux platforms like Darwin and
Solaris.

Signed-off-by: Fabian Groffen <grobian@gentoo.org>
2011-01-17 15:34:45 +01:00
Gerrit Renker 3d6e5c355d lscpu: avoid len = 0 as a consequence of maxcpus = 0
This problem was observed on an x86_64 Mobile AMD Sempron 3700+ where kernel_max
returned "0" as the index of the highest CPU.

As a consequence, several variables in lscpu, which relied on maxcpus >= 1 (in
particular the 'len' value) were set to 0, resulting in the following errors:

host>./lscpu
lscpu: failed to read: /sys/devices/system/cpu/online: No such file or directory
host> cat /sys/devices/system/cpu/kernel_max
0

The fix used by this patch is to interpret kernel_max as an index and maxcpus as
a count >= 1, tested to work.

Signed-off-by: Gerrit Renker <gerrit@erg.abdn.ac.uk>
Signed-off-by: Karel Zak <kzak@redhat.com>
2010-12-31 00:22:52 +01:00
Karel Zak 80dde62f9c lscpu: use GPLv2+
CAI Qian and I agree that GPLv2+ is better for lscpu.c. This license
is more compatible (than v3) with the rest of the util-linux package.
We need to link the code with functions from lib/ -- mix GPLv3 and
GPLv2 is bad idea.

Note that it was only Cai and I who did significant changes to
lscpu.c, all others changes from others developers was trivial (fix
typos, add _(), ...).

Signed-off-by: CAI Qian <caiqian@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2010-12-01 11:20:45 +01:00
Petr Uzel fe81c7d1b8 lscpu: really use 'mode' argument in path_fopen() 2010-10-07 10:24:57 +02:00
Karel Zak 5d4ba40ddc lscpu: support sysfs without cpu/online file
Signed-off-by: Karel Zak <kzak@redhat.com>
2010-08-20 21:15:51 +02:00
Davidlohr Bueso 9b8d4d5f18 lscpu: add byte order and bogoMIPS information
Signed-off-by: Davidlohr Bueso <dave@gnu.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
2010-08-20 13:20:09 +02:00
Karel Zak 4f912c6ac5 lscpu: add -x and {On,Off}-line CPU(s) mask/list
Signed-off-by: Karel Zak <kzak@redhat.com>
2010-08-11 15:41:48 +02:00
Karel Zak aac1e59ebb lscpu: support offline CPUs
# echo 0 >/sys/devices/system/cpu/cpu3/online
 # echo 0 >/sys/devices/system/cpu/cpu2/online

 # grep processor /proc/cpuinfo
 processor       : 0
 processor       : 1

 # lscpu
 lscpu: error: cannot open
 /sys/devices/system/cpu/cpu2/cache/index0/shared_cpu_map: No such file or directory

This patch also add a new "On-line CPU(s):" line to the lscpu(1)
output.

Addresses: http://bugzilla.redhat.com/show_bug.cgi?id=623012
Signed-off-by: Karel Zak <kzak@redhat.com>
2010-08-11 12:43:25 +02:00
Francesco Cosoleto 2f8f138883 lscpu: replace LC_MESSAGES with LC_ALL in setlocate()
LC_CTYPE is necessary to print correctly some non English characters,
set LC_ALL for the sake of brevity.

Example:
    $ LANG=fr_FR lscpu -p | head -n 1
\# La suite est en format analysable, transmissible ? d'autres

instead of:
\# La suite est en format analysable, transmissible à d'autres

Signed-off-by: Francesco Cosoleto <cosoleto@gmail.com>
2010-06-30 12:51:35 +02:00
Francesco Cosoleto 4a939e047c lscpu: gettextize "CPU(s)"
Signed-off-by: Francesco Cosoleto <cosoleto@gmail.com>
2010-06-30 12:51:35 +02:00
Benno Schulenberg d8b25f6254 lscpu: fix typo, "faild" to "failed"
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2010-06-15 12:55:17 +02:00
Benno Schulenberg e6b0611b46 messages: gettextize a few skipped or forgotten ones
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2010-06-14 11:19:19 +02:00
Benno Schulenberg d0bb6987a8 textual: fix typos, and rephrase some things for clarity
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
2010-06-14 11:17:00 +02:00
Karel Zak 7e03f38312 lscpu: use cpuset masks, read data for all CPUs
Signed-off-by: Karel Zak <kzak@redhat.com>
2010-06-01 11:11:26 +02:00
Karel Zak d50363cd62 lscpu: improve --sysroot code
Signed-off-by: Karel Zak <kzak@redhat.com>
2010-06-01 11:11:25 +02:00
Karel Zak e8aa16eedd lscpu: cleanup used names
Signed-off-by: Karel Zak <kzak@redhat.com>
2010-06-01 11:10:49 +02:00
Karel Zak ef173bde3f lscpu: cleanup path_scanstr()
Signed-off-by: Karel Zak <kzak@redhat.com>
2010-06-01 11:10:01 +02:00
Henne Vogelsang bc54770d9e lscpu: fix cpuid opcode detection
Fixes commit c9239f23ac. The author
didn't care for matching constraints when resorting the register
constraints.  The eax register (with the cpuid opcode) is now in
operand 1, not zero anymore.

Signed-off-by: Henne Vogelsang <hvogel@opensuse.org>
2010-03-01 11:35:54 +01:00
Karel Zak 79e8b41a4a lscpu: add {32,64}-bit CPU modes detection
This patch add "CPU op-mode(s):" field that prints all supported CPU
operation modes. The field is based on CPU flags:

	rm (real mode)          16-bit
	tm (transparent mode)   32-bit
	lm (long mode)          64-bit

Example:

	$ lscpu
	Architecture:          x86_64
	CPU op-mode(s):        32-bit, 64-bit
	CPU(s):                2
	Thread(s) per core:    1
	Core(s) per socket:    2
	CPU socket(s):         1
	NUMA node(s):          1
	Vendor ID:             GenuineIntel
	CPU family:            6
	Model:                 15
	Stepping:              11
	CPU MHz:               1600.000
	Virtualization:        VT-x
	L1d cache:             32K
	L1i cache:             32K
	L2 cache:              4096K

Signed-off-by: Karel Zak <kzak@redhat.com>
2010-01-07 17:34:03 +01:00
Mike Frysinger c9239f23ac lscpu: fix cpuid code on x86/PIC
If we build lscpu as PIE, we currently get a build failure:
lscpu.c: In function 'main':
lscpu.c:333: error: can't find a register in class 'BREG' while reloading 'asm'
lscpu.c:333: error: 'asm' operand has impossible constraints
make[2]: *** [lscpu.o] Error 1

So we need a little bit of register shuffling to keep gcc happy.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-05-11 10:52:02 +02:00
Matthias Koenig cf474aacfc lscpu: return EXIT_SUCCESS at the end
Signed-off-by: Matthias Koenig <mkoenig@suse.de>
2008-10-22 23:35:19 +02:00
Karel Zak c8b64f6d77 lscpu: add Hypervisor detection
This patch adds two new fields:

 * "Hypervisor vendor"  -- based on CPUID and hypervisor specific
   PCI devices. lscpu(1) supports KVM, XEN, Microsoft HV now.

 * "Virtualization type"
	- "none"	= Xen dom0
	- "full"	= full virtualization (KVM, Xen, ...)
	- "para"	= Xen paravirtualization

Co-Author: Ky Srinivasan <ksrinivasan@novell.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2008-10-22 13:56:52 +02:00
Cai Qian 47b6e8b684 lscpu: --sysroot option and stable cache output
This patch added a --sysroot command-line option for testing purpose. It
also sorted cache names, and displayed cache information in a sorted
manner instead of randomly before. In addition, it had some other minor
fixes.

Signed-off-by: Cai Qian <qcai@redhat.com>
2008-08-14 12:22:29 +02:00
Cai Qian 5dd7507c18 lscpu: new command
Add a lscpu(1) utility program.

[kzak@redhat.com:
	- indent by linux-2.6/scripts/Lindent
	- add lscpu.{c,1} to sys-utils/Makefile.am
	- add NLS suport
	- complete code refactoring
]

Co-Author: Karel Zak <kzak@redhat.com>
Signed-off-by: Cai Qian <qcai@redhat.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
2008-07-18 03:01:49 +02:00