From: Jean Delvare <jdelvare@suse.de>
To: linux-hwmon@vger.kernel.org
Subject: [PATCH] sensors-detect: Report proper processor information on ppc
Date: Mon, 26 Sep 2016 10:49:14 +0200 [thread overview]
Message-ID: <20160926104914.554fb354@endymion> (raw)
The format of /proc/cpuinfo on ppc differs from the x86 format. Add
the missing pieces to the parsing code so that ppc processor
information is reported properly.
---
prog/detect/sensors-detect | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
--- a/prog/detect/sensors-detect
+++ b/prog/detect/sensors-detect
@@ -2864,7 +2864,7 @@ sub initialize_cpu_list
};
next;
}
- if (m/^(vendor_id|cpu family|model|model name|stepping|cpuid level)\s*:\s*(.+)$/) {
+ if (m/^(vendor_id|cpu family|model|model name|stepping|cpuid level|cpu|revision)\s*:\s*(.+)$/) {
my $k = $1;
my $v = $2;
$v =~ s/\s+/ /g; # Merge multiple spaces
@@ -2880,7 +2880,11 @@ sub initialize_cpu_list
sub print_cpu_info
{
my $cpu = $cpu[0];
- print "# Processor: $cpu->{'model name'} ($cpu->{'cpu family'}/$cpu->{model}/$cpu->{stepping})\n";
+ if (defined $cpu->{'model name'}) {
+ print "# Processor: $cpu->{'model name'} ($cpu->{'cpu family'}/$cpu->{model}/$cpu->{stepping})\n";
+ } elsif (defined $cpu->{'cpu'}) { # ppc
+ print "# Processor: $cpu->{'cpu'}, revision $cpu->{'revision'}\n";
+ }
}
# @i2c_adapters is a list of references to hashes, one hash per I2C/SMBus
--
Jean Delvare
SUSE L3 Support
next reply other threads:[~2016-09-26 8:49 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-26 8:49 Jean Delvare [this message]
2016-09-26 12:58 ` [PATCH] sensors-detect: Report proper processor information on ppc Guenter Roeck
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=20160926104914.554fb354@endymion \
--to=jdelvare@suse.de \
--cc=linux-hwmon@vger.kernel.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.