Linux-EDAC Archive on lore.kernel.org
 help / color / Atom feed
From: Shiju Jose <shiju.jose@huawei.com>
To: <mchehab+huawei@kernel.org>, <linux-edac@vger.kernel.org>
Cc: <linuxarm@huawei.com>, <tanxiaofei@huawei.com>,
	<jonathan.cameron@huawei.com>
Subject: [PATCH 1/1] rasdaemon: ras-mc-ctl: Add ARM processor error information
Date: Tue, 11 Aug 2020 13:31:46 +0100
Message-ID: <20200811123146.1409-1-shiju.jose@huawei.com> (raw)

Add supporting ARM processor error in the ras-mc-ctl tool.

Signed-off-by: Shiju Jose <shiju.jose@huawei.com>
---
 util/ras-mc-ctl.in | 40 ++++++++++++++++++++++++++++++++++++++++
 1 file changed, 40 insertions(+)

diff --git a/util/ras-mc-ctl.in b/util/ras-mc-ctl.in
index ff38143..dd7d56f 100755
--- a/util/ras-mc-ctl.in
+++ b/util/ras-mc-ctl.in
@@ -1123,6 +1123,7 @@ sub summary
     my ($err_type, $label, $mc, $top, $mid, $low, $count, $msg);
     my ($etype, $severity, $etype_string, $severity_string);
     my ($dev_name, $dev);
+    my ($affinity, $mpidr);
 
     my $dbh = DBI->connect("dbi:SQLite:dbname=$dbname", "", "", {});
 
@@ -1158,6 +1159,22 @@ sub summary
     }
     $query_handle->finish;
 
+    # ARM processor arm_event errors
+    $query = "select affinity, mpidr, count(*) from arm_event group by affinity, mpidr";
+    $query_handle = $dbh->prepare($query);
+    $query_handle->execute();
+    $query_handle->bind_columns(\($affinity, $mpidr, $count));
+    $out = "";
+    while($query_handle->fetch()) {
+        $out .= "\t$count errors\n";
+    }
+    if ($out ne "") {
+        print "ARM processor events summary:\n$out\n";
+    } else {
+        print "No ARM processor errors.\n\n";
+    }
+    $query_handle->finish;
+
     # extlog errors
     $query = "select etype, severity, count(*) from extlog_event group by etype, severity";
     $query_handle = $dbh->prepare($query);
@@ -1235,6 +1252,7 @@ sub errors
     my ($timestamp, $etype, $severity, $etype_string, $severity_string, $fru_id, $fru_text, $cper_data);
     my ($bus_name, $dev_name, $driver_name, $reporter_name);
     my ($dev, $sector, $nr_sector, $error, $rwbs, $cmd);
+    my ($error_count, $affinity, $mpidr, $r_state, $psci_state);
 
     my $dbh = DBI->connect("dbi:SQLite:dbname=$dbname", "", "", {});
 
@@ -1274,6 +1292,28 @@ sub errors
     }
     $query_handle->finish;
 
+    # ARM processor arm_event errors
+    $query = "select id, timestamp, error_count, affinity, mpidr, running_state, psci_state from arm_event order by id";
+    $query_handle = $dbh->prepare($query);
+    $query_handle->execute();
+    $query_handle->bind_columns(\($id, $timestamp, $error_count, $affinity, $mpidr, $r_state, $psci_state));
+    $out = "";
+    while($query_handle->fetch()) {
+        $out .= "$id $timestamp error: ";
+        $out .= "error_count=$error_count, " if ($error_count);
+        $out .= "affinity_level=$affinity, ";
+        $out .= sprintf "mpidr=0x%x, ", $mpidr;
+        $out .= sprintf "running_state=0x%x, ", $r_state;
+        $out .= sprintf "psci_state=0x%x", $psci_state;
+        $out .= "\n";
+    }
+    if ($out ne "") {
+        print "ARM processor events:\n$out\n";
+    } else {
+        print "No ARM processor errors.\n\n";
+    }
+    $query_handle->finish;
+
     # Extlog errors
     $query = "select id, timestamp, etype, severity, address, fru_id, fru_text, cper_data from extlog_event order by id";
     $query_handle = $dbh->prepare($query);
-- 
2.17.1



             reply index

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-11 12:31 Shiju Jose [this message]
2020-09-01  6:34 ` Mauro Carvalho Chehab

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=20200811123146.1409-1-shiju.jose@huawei.com \
    --to=shiju.jose@huawei.com \
    --cc=jonathan.cameron@huawei.com \
    --cc=linux-edac@vger.kernel.org \
    --cc=linuxarm@huawei.com \
    --cc=mchehab+huawei@kernel.org \
    --cc=tanxiaofei@huawei.com \
    /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

Linux-EDAC Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-edac/0 linux-edac/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-edac linux-edac/ https://lore.kernel.org/linux-edac \
		linux-edac@vger.kernel.org
	public-inbox-index linux-edac

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-edac


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git