From: Ian Campbell <Ian.Campbell@citrix.com>
To: Rita Sinha <rita.sinha89@gmail.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>, xen-devel@lists.xen.org
Subject: Re: [OPW][PATCH v2] Support added to read system information from BIOS and verify it with Xen.
Date: Tue, 21 Oct 2014 10:13:44 +0100 [thread overview]
Message-ID: <1413882824.23337.8.camel@citrix.com> (raw)
In-Reply-To: <20141021061012.GA12475@chroot-build.noidalab.local>
On Tue, 2014-10-21 at 11:40 +0530, Rita Sinha wrote:
> This patch is in response to
> http://secure-web.cisco.com/1YB1awPInStO2hrLa12KgfqobN6IDb1NLSm9NDTo00PshSMkAjWOlHjGJGcermXIpIZUvx3-fqRwDbSnhthheWCKKPOn5XvXx826jIO9jEhbTjUrPXeSn7NTVUCES71yLs1nX_OAbMCmg1MPlywqp3SUGT6O973O-mDSzQty_mYU/http%3A%2F%2Fwiki.xenproject.org%2Fwiki%2FOutreach_Program_Projects#CPU.2FRAM.2FPCI_diagram_tool
> project for applying to OPW-Round9.It adds support for reading system
> architecture information from BIOS and verifies it with Xen via xl toolstack.
>
> ---
> dmidecode.pl | 61 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Which git tree is this against? It certainly wouldn't be correct to dump
this into the toplevel of xen.git.
> 1 file changed, 61 insertions(+)
> create mode 100644 dmidecode.pl
>
> diff --git a/dmidecode.pl b/dmidecode.pl
> new file mode 100644
> index 0000000..8556cfd
> --- /dev/null
> +++ b/dmidecode.pl
> @@ -0,0 +1,61 @@
> +#!/usr/bin/perl
> +
> +# dmidecode.pl - a script to read the system architecture information
> +# directly from the BIOS and verify with xen. Only for Linux.
> +#
> +# Rita Sinha (rita.sinha89@gmail.com)
> +# OPW Program-Round9
> +# 21/10/14
> +
> +`id -u` == 0 || die "must be run as root";
> +
> +open(DmiFh, "/usr/sbin/dmidecode |") or
> + die "problem running dmidecode";
> +$DmiNumProcs = 0;
> +$DmiNumSockets = 0;
> +while(<DmiFh>)
> + {
> + next unless /Central Processor/;
> + # We've found a processor (or at least a socket), keep going
> + while(<DmiFh>)
> + {
> + # Keep walking the dmidecode output to find out if
> + # the socket has a processor in it.
> + last if /^Handle/;
> + next unless /Status/;
> + $DmiNumSockets += 1;
> + /Populated/ and $DmiNumProcs += 1;
> + last;
> + }
> + }
> +close DmiFh;
> +
> +open(CpuInfoFh, "/proc/cpuinfo") || die "failed to open /proc/cpuinfo!";
> +$CpuInfoNumProcs = 0;
> +while(<CpuInfoFh>)
> + {
> + next unless /^processor.*:/;
> + ($CpuInfoNumProcs) += (/^processor.*: (\d+)/);
> + }
> +close CpuInfoFh;
> +
> +my @command = `xl list`;
> +my @xen_values = split(' ', $command[1]);
> +
> +
> +if ( $DmiNumProcs != $CpuInfoNumProcs )
> + {
> + print "Warning: dmidecode reports $DmiNumProcs processors, kernel reports $CpuInfoNumProcs processors.\n";
> + }
> +
> +if ( $DmiNumProcs != $DmiNumSockets )
> + {
> + print "Info: dmidecode reports $DmiNumSockets cpu sockets, but only $DmiNumProcs processors.\n";
> + }
> +
> +if ( $DmiNumProcs != @xen_values[3] )
> + {
> + print "Warning: dmidecode reports $DmiNumProcs processors, xen reports $xenCpus processors\n";
> + }
> +
> +
next prev parent reply other threads:[~2014-10-21 9:13 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-21 6:10 [OPW][PATCH v2] Support added to read system information from BIOS and verify it with Xen Rita Sinha
2014-10-21 9:13 ` Ian Campbell [this message]
2014-10-21 9:53 ` Rita Sinha
2014-10-21 10:14 ` Ian Campbell
2014-10-21 9:21 ` Olaf Hering
2014-10-21 10:04 ` Rita Sinha
2014-10-21 10:08 ` Olaf Hering
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1413882824.23337.8.camel@citrix.com \
--to=ian.campbell@citrix.com \
--cc=andrew.cooper3@citrix.com \
--cc=rita.sinha89@gmail.com \
--cc=xen-devel@lists.xen.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.