diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2008-03-20 14:13:27 -0300 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2008-03-20 14:13:27 -0300 |
commit | 6da342f4382725ace479638cede4a3d8e6c4cae4 (patch) | |
tree | 44c024984713f116441d301a1d96b14c8f2e0713 | |
parent | 76a691c279d00f60e4032c03db57e042cf5202dc (diff) | |
download | python-linux-procfs-6da342f4382725ace479638cede4a3d8e6c4cae4.tar.gz |
[CPUINFO]: Handle the non-multicore format
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
-rwxr-xr-x | procfs/procfs.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/procfs/procfs.py b/procfs/procfs.py index 3bdad94..22f11f9 100755 --- a/procfs/procfs.py +++ b/procfs/procfs.py @@ -289,8 +289,9 @@ class cpuinfo: self.sockets.append(socket_id) f.close() - self.nr_sockets = len(self.sockets) - self.nr_cores = int(self.tags["cpu cores"]) * self.nr_sockets + self.nr_sockets = self.sockets and len(self.sockets) or \ + (self.nr_cpus / ("siblings" in self.tags and int(self.tags["siblings"]) or 1)) + self.nr_cores = ("cpu cores" in self.tags and int(self.tags["cpu cores"]) or 1) * self.nr_sockets class smaps_lib: def __init__(self, lines): |