From 88bf3126312645843152c6c3215b54b120bcc1ec Mon Sep 17 00:00:00 2001 From: Shiju Jose Date: Mon, 7 Mar 2022 12:38:45 +0000 Subject: [PATCH 6/6] rasdaemon: ras-mc-ctl: Relocate reading and display Kunpeng920 errors to under Kunpeng9xx Relocate reading and display Kunpeng920 errors to under Kunpeng9xx. Signed-off-by: Shiju Jose --- util/ras-mc-ctl.in | 38 ++++++++++---------------------------- 1 file changed, 10 insertions(+), 28 deletions(-) diff --git a/util/ras-mc-ctl.in b/util/ras-mc-ctl.in index d728300..2ab9602 100755 --- a/util/ras-mc-ctl.in +++ b/util/ras-mc-ctl.in @@ -1527,7 +1527,6 @@ sub errors # Definitions of the vendor platform IDs. use constant { - HISILICON_KUNPENG_920 => "Kunpeng920", HISILICON_KUNPENG_9XX => "Kunpeng9xx", }; @@ -1549,8 +1548,8 @@ sub vendor_errors_summary my $dbh = DBI->connect("dbi:SQLite:dbname=$dbname", "", "", {}); - # HiSilicon Kunpeng920 errors - if ($platform_id eq HISILICON_KUNPENG_920) { + # HiSilicon Kunpeng9xx common errors + if ($platform_id eq HISILICON_KUNPENG_9XX) { $query = "select err_severity, module_id, count(*) from hip08_oem_type1_event_v2 group by err_severity, module_id"; $query_handle = $dbh->prepare($query); $query_handle->execute(); @@ -1565,9 +1564,7 @@ sub vendor_errors_summary $out .= "\t$module_id: $count\n"; } if ($out ne "") { - print "HiSilicon Kunpeng920 OEM type1 error events summary:\n$out\n"; - } else { - print "No HiSilicon Kunpeng920 OEM type1 errors.\n\n"; + print "HiSilicon Kunpeng9xx OEM type1 error events summary:\n$out\n"; } $query_handle->finish; @@ -1585,9 +1582,7 @@ sub vendor_errors_summary $out .= "\t$module_id: $count\n"; } if ($out ne "") { - print "HiSilicon Kunpeng920 OEM type2 error events summary:\n$out\n"; - } else { - print "No HiSilicon Kunpeng920 OEM type2 errors.\n\n"; + print "HiSilicon Kunpeng9xx OEM type2 error events summary:\n$out\n"; } $query_handle->finish; @@ -1605,15 +1600,10 @@ sub vendor_errors_summary $out .= "\t$sub_module_id: $count\n"; } if ($out ne "") { - print "HiSilicon Kunpeng920 PCIe controller error events summary:\n$out\n"; - } else { - print "No HiSilicon Kunpeng920 PCIe controller errors.\n\n"; + print "HiSilicon Kunpeng9xx PCIe controller error events summary:\n$out\n"; } $query_handle->finish; - } - # HiSilicon Kunpeng9xx common errors - if ($platform_id eq HISILICON_KUNPENG_9XX) { $query = "select err_severity, module_id, count(*) from hisi_common_section_v2 group by err_severity, module_id"; $query_handle = $dbh->prepare($query); $query_handle->execute(); @@ -1629,8 +1619,6 @@ sub vendor_errors_summary } if ($out ne "") { print "HiSilicon Kunpeng9xx common error events summary:\n$out\n"; - } else { - print "No HiSilicon Kunpeng9xx common errors.\n\n"; } $query_handle->finish; } @@ -1661,8 +1649,8 @@ sub vendor_errors my $dbh = DBI->connect("dbi:SQLite:dbname=$dbname", "", "", {}); - # HiSilicon Kunpeng920 errors - if ($platform_id eq HISILICON_KUNPENG_920) { + # HiSilicon Kunpeng9xx common errors + if ($platform_id eq HISILICON_KUNPENG_9XX) { $query = "select id, timestamp, version, soc_id, socket_id, nimbus_id, module_id, sub_module_id, err_severity, regs_dump from hip08_oem_type1_event_v2 order by id, module_id, err_severity"; $query_handle = $dbh->prepare($query); $query_handle->execute(); @@ -1683,7 +1671,7 @@ sub vendor_errors } } if ($out ne "") { - print "HiSilicon Kunpeng920 OEM type1 error events:\n$out\n"; + print "HiSilicon Kunpeng9xx OEM type1 error events:\n$out\n"; } $query_handle->finish; @@ -1707,7 +1695,7 @@ sub vendor_errors } } if ($out ne "") { - print "HiSilicon Kunpeng920 OEM type2 error events:\n$out\n"; + print "HiSilicon Kunpeng9xx OEM type2 error events:\n$out\n"; } $query_handle->finish; @@ -1733,13 +1721,10 @@ sub vendor_errors } } if ($out ne "") { - print "HiSilicon Kunpeng920 PCIe controller error events:\n$out\n"; + print "HiSilicon Kunpeng9xx PCIe controller error events:\n$out\n"; } $query_handle->finish; - } - # HiSilicon Kunpeng9xx common errors - if ($platform_id eq HISILICON_KUNPENG_9XX) { $query = "select id, timestamp, version, soc_id, socket_id, totem_id, nimbus_id, sub_system_id, module_id, sub_module_id, core_id, port_id, err_type, pcie_info, err_severity, regs_dump from hisi_common_section_v2 order by id, module_id, err_severity"; $query_handle = $dbh->prepare($query); $query_handle->execute(); @@ -1767,8 +1752,6 @@ sub vendor_errors } if ($out ne "") { print "HiSilicon Kunpeng9xx common error events:\n$out\n"; - } else { - print "No HiSilicon Kunpeng9xx common errors.\n"; } $query_handle->finish; } @@ -1779,7 +1762,6 @@ sub vendor_errors sub vendor_platforms { print "\nSupported platforms for the vendor-specific errors:\n"; - print "\tHiSilicon Kunpeng920, platform-id=\"", HISILICON_KUNPENG_920, "\"\n"; print "\tHiSilicon Kunpeng9xx, platform-id=\"", HISILICON_KUNPENG_9XX, "\"\n"; print "\n"; } -- 2.25.1