Blame SOURCES/3f9af0adc4c11b60c3969c0fc0bb209c0fbfdc8e.patch

David Johansen 45192c
commit 3f9af0adc4c11b60c3969c0fc0bb209c0fbfdc8e
David Johansen 45192c
Author: dann frazier <dann.frazier@canonical.com>
David Johansen 45192c
Date:   Tue Apr 21 15:56:04 2020 -0600
David Johansen 45192c
David Johansen 45192c
    ras-mc-ctl: PCIe AER: display PCIe dev name
David Johansen 45192c
    
David Johansen 45192c
    Storage of PCIe dev name was added in commit 8e96ca2c1c59 ("rasdaemon:
David Johansen 45192c
    store PCIe dev name and TLP header for the aer event"). This makes
David Johansen 45192c
    ras-mc-ctl extract and emit it like so:
David Johansen 45192c
    
David Johansen 45192c
    PCIe AER events:
David Johansen 45192c
    1 2020-04-16 22:09:48 +0000 0000:0b:00.0 Corrected error: Receiver Error
David Johansen 45192c
    2 2020-04-16 22:23:24 +0000 0000:0b:00.0 Corrected error: Receiver Error
David Johansen 45192c
    3 2020-04-17 23:00:37 +0000 0000:d9:01.0 Corrected error: Advisory Non-Fatal, BIT15
David Johansen 45192c
    4 2020-04-17 23:21:52 +0000 0000:d9:01.0 Corrected error: Advisory Non-Fatal
David Johansen 45192c
    5 2020-04-18 02:04:24 +0000 0000:5e:00.0 Corrected error: Receiver Error
David Johansen 45192c
    
David Johansen 45192c
    Signed-off-by: Dann Frazier <dann.frazier@canonical.com>
David Johansen 45192c
    Tested-by: Shiju Jose <shiju.jose@huawei.com>
David Johansen 45192c
David Johansen 45192c
diff --git a/util/ras-mc-ctl.in b/util/ras-mc-ctl.in
David Johansen 45192c
index f361fd0..dd7d56f 100755
David Johansen 45192c
--- a/util/ras-mc-ctl.in
David Johansen 45192c
+++ b/util/ras-mc-ctl.in
David Johansen 45192c
@@ -1247,7 +1247,7 @@ sub summary
David Johansen 45192c
 sub errors
David Johansen 45192c
 {
David Johansen 45192c
     require DBI;
David Johansen 45192c
-    my ($query, $query_handle, $id, $time, $count, $type, $msg, $label, $mc, $top, $mid, $low, $addr, $grain, $syndrome, $detail, $out);
David Johansen 45192c
+    my ($query, $query_handle, $id, $time, $devname, $count, $type, $msg, $label, $mc, $top, $mid, $low, $addr, $grain, $syndrome, $detail, $out);
David Johansen 45192c
     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);
David Johansen 45192c
     my ($timestamp, $etype, $severity, $etype_string, $severity_string, $fru_id, $fru_text, $cper_data);
David Johansen 45192c
     my ($bus_name, $dev_name, $driver_name, $reporter_name);
David Johansen 45192c
@@ -1277,13 +1277,13 @@ sub errors
David Johansen 45192c
     $query_handle->finish;
David Johansen 45192c
 
David Johansen 45192c
     # PCIe AER aer_event errors
David Johansen 45192c
-    $query = "select id, timestamp, err_type, err_msg from aer_event order by id";
David Johansen 45192c
+    $query = "select id, timestamp, dev_name, err_type, err_msg from aer_event order by id";
David Johansen 45192c
     $query_handle = $dbh->prepare($query);
David Johansen 45192c
     $query_handle->execute();
David Johansen 45192c
-    $query_handle->bind_columns(\($id, $time, $type, $msg));
David Johansen 45192c
+    $query_handle->bind_columns(\($id, $time, $devname, $type, $msg));
David Johansen 45192c
     $out = "";
David Johansen 45192c
     while($query_handle->fetch()) {
David Johansen 45192c
-        $out .= "$id $time $type error: $msg\n";
David Johansen 45192c
+        $out .= "$id $time $devname $type error: $msg\n";
David Johansen 45192c
     }
David Johansen 45192c
     if ($out ne "") {
David Johansen 45192c
         print "PCIe AER events:\n$out\n";