Linux-EDAC Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH 1/1] rasdaemon: ras-mc-ctl: Add ARM processor error information
@ 2020-08-11 12:31 Shiju Jose
  2020-09-01  6:34 ` Mauro Carvalho Chehab
  0 siblings, 1 reply; 2+ messages in thread
From: Shiju Jose @ 2020-08-11 12:31 UTC (permalink / raw)
  To: mchehab+huawei, linux-edac; +Cc: linuxarm, tanxiaofei, jonathan.cameron

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



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-11 12:31 [PATCH 1/1] rasdaemon: ras-mc-ctl: Add ARM processor error information Shiju Jose
2020-09-01  6:34 ` Mauro Carvalho Chehab

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