Blame SOURCES/0862a096c3a1d0f993703ab3299f1ddfadf53d7f.patch

81d547
commit 0862a096c3a1d0f993703ab3299f1ddfadf53d7f
81d547
Author: Shiju Jose <shiju.jose@huawei.com>
81d547
Date:   Tue Aug 11 13:31:46 2020 +0100
81d547
81d547
    rasdaemon: ras-mc-ctl: Add ARM processor error information
81d547
    
81d547
    Add supporting ARM processor error in the ras-mc-ctl tool.
81d547
    
81d547
    Signed-off-by: Shiju Jose <shiju.jose@huawei.com>
81d547
    Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
81d547
81d547
---
81d547
 util/ras-mc-ctl.in |   40 ++++++++++++++++++++++++++++++++++++++++
81d547
 1 file changed, 40 insertions(+)
81d547
81d547
--- rasdaemon-0.6.1.orig/util/ras-mc-ctl.in	2021-10-06 14:14:25.000440090 -0400
81d547
+++ rasdaemon-0.6.1/util/ras-mc-ctl.in	2021-10-06 14:15:59.995598590 -0400
81d547
@@ -1124,6 +1124,7 @@ sub summary
81d547
     my ($query, $query_handle, $out);
81d547
     my ($err_type, $label, $mc, $top, $mid, $low, $count, $msg);
81d547
     my ($etype, $severity, $etype_string, $severity_string);
81d547
+    my ($affinity, $mpidr);
81d547
 
81d547
     my $dbh = DBI->connect("dbi:SQLite:dbname=$dbname", "", "", {});
81d547
 
81d547
@@ -1159,6 +1160,22 @@ sub summary
81d547
     }
81d547
     $query_handle->finish;
81d547
 
81d547
+    # ARM processor arm_event errors
81d547
+    $query = "select affinity, mpidr, count(*) from arm_event group by affinity, mpidr";
81d547
+    $query_handle = $dbh->prepare($query);
81d547
+    $query_handle->execute();
81d547
+    $query_handle->bind_columns(\($affinity, $mpidr, $count));
81d547
+    $out = "";
81d547
+    while($query_handle->fetch()) {
81d547
+        $out .= "\t$count errors\n";
81d547
+    }
81d547
+    if ($out ne "") {
81d547
+        print "ARM processor events summary:\n$out\n";
81d547
+    } else {
81d547
+        print "No ARM processor errors.\n\n";
81d547
+    }
81d547
+    $query_handle->finish;
81d547
+
81d547
     # extlog errors
81d547
     $query = "select etype, severity, count(*) from extlog_event group by etype, severity";
81d547
     $query_handle = $dbh->prepare($query);
81d547
@@ -1202,6 +1219,7 @@ sub errors
81d547
     my ($query, $query_handle, $id, $time, $count, $type, $msg, $label, $mc, $top, $mid, $low, $addr, $grain, $syndrome, $detail, $out);
81d547
     my ($mcgcap,$mcgstatus, $status, $misc, $ip, $tsc, $walltime, $cpu, $cpuid, $apicid, $socketid, $cs, $bank, $cpuvendor, $bank_name, $mcgstatus_msg, $mcistatus_msg, $user_action, $mc_location);
81d547
     my ($timestamp, $etype, $severity, $etype_string, $severity_string, $fru_id, $fru_text, $cper_data);
81d547
+    my ($error_count, $affinity, $mpidr, $r_state, $psci_state);
81d547
 
81d547
     my $dbh = DBI->connect("dbi:SQLite:dbname=$dbname", "", "", {});
81d547
 
81d547
@@ -1241,6 +1259,28 @@ sub errors
81d547
     }
81d547
     $query_handle->finish;
81d547
 
81d547
+    # ARM processor arm_event errors
81d547
+    $query = "select id, timestamp, error_count, affinity, mpidr, running_state, psci_state from arm_event order by id";
81d547
+    $query_handle = $dbh->prepare($query);
81d547
+    $query_handle->execute();
81d547
+    $query_handle->bind_columns(\($id, $timestamp, $error_count, $affinity, $mpidr, $r_state, $psci_state));
81d547
+    $out = "";
81d547
+    while($query_handle->fetch()) {
81d547
+        $out .= "$id $timestamp error: ";
81d547
+        $out .= "error_count=$error_count, " if ($error_count);
81d547
+        $out .= "affinity_level=$affinity, ";
81d547
+        $out .= sprintf "mpidr=0x%x, ", $mpidr;
81d547
+        $out .= sprintf "running_state=0x%x, ", $r_state;
81d547
+        $out .= sprintf "psci_state=0x%x", $psci_state;
81d547
+        $out .= "\n";
81d547
+    }
81d547
+    if ($out ne "") {
81d547
+        print "ARM processor events:\n$out\n";
81d547
+    } else {
81d547
+        print "No ARM processor errors.\n\n";
81d547
+    }
81d547
+    $query_handle->finish;
81d547
+
81d547
     # Extlog errors
81d547
     $query = "select id, timestamp, etype, severity, address, fru_id, fru_text, cper_data from extlog_event order by id";
81d547
     $query_handle = $dbh->prepare($query);