From 8f5cfa10c27915686fa92e55994597d8f0c1d49f Mon Sep 17 00:00:00 2001 From: Ruidong Tian Date: Wed, 13 Sep 2023 11:48:27 +0800 Subject: [PATCH] spec: add yitian ns decode feature Signed-off-by: Ruidong Tian --- ...e.ac-fix-SYSCONFDEFDIR-default-value.patch | 37 ++ ...-non_standard_event-at-just-one-line.patch | 48 ++ ...pport-for-THead-Yitian-non-standard-.patch | 409 ++++++++++++++++++ ...-ctl-Add-support-to-display-the-THea.patch | 105 +++++ rasdaemon.spec | 18 +- 5 files changed, 614 insertions(+), 3 deletions(-) create mode 100644 2001-configure.ac-fix-SYSCONFDEFDIR-default-value.patch create mode 100644 2002-rasdaemon-log-non_standard_event-at-just-one-line.patch create mode 100644 2003-rasdaemon-add-support-for-THead-Yitian-non-standard-.patch create mode 100644 2004-rasdaemon-ras-mc-ctl-Add-support-to-display-the-THea.patch diff --git a/2001-configure.ac-fix-SYSCONFDEFDIR-default-value.patch b/2001-configure.ac-fix-SYSCONFDEFDIR-default-value.patch new file mode 100644 index 0000000..7d6ac4f --- /dev/null +++ b/2001-configure.ac-fix-SYSCONFDEFDIR-default-value.patch @@ -0,0 +1,37 @@ +From 8f44bff597adcfb34c73e7477d1a867516e7fbfe Mon Sep 17 00:00:00 2001 +From: Matt Whitlock +Date: Wed, 9 Jun 2021 10:25:18 -0400 +Subject: [PATCH 1/4] configure.ac: fix SYSCONFDEFDIR default value + +configure.ac was using AC_ARG_WITH incorrectly, yielding a generated configure script like: + + # Check whether --with-sysconfdefdir was given. + if test "${with_sysconfdefdir+set}" = set; then : + withval=$with_sysconfdefdir; SYSCONFDEFDIR=$withval + else + "/etc/sysconfig" + fi + +This commit fixes the default case so that the SYSCONFDEFDIR variable is assigned the value "/etc/sysconfig" rather than trying to execute "/etc/sysconfig" as a command. + +Signed-off-by: Mauro Carvalho Chehab +--- + configure.ac | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/configure.ac b/configure.ac +index f7d1947..33b81fe 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -172,7 +172,7 @@ AC_SUBST([RASSTATEDIR]) + AC_ARG_WITH(sysconfdefdir, + AC_HELP_STRING([--with-sysconfdefdir=DIR], [rasdaemon environment file dir]), + [SYSCONFDEFDIR=$withval], +- ["/etc/sysconfig"]) ++ [SYSCONFDEFDIR=/etc/sysconfig]) + AC_SUBST([SYSCONFDEFDIR]) + + AC_DEFINE([RAS_DB_FNAME], ["ras-mc_event.db"], [ras events database]) +-- +2.33.1 + diff --git a/2002-rasdaemon-log-non_standard_event-at-just-one-line.patch b/2002-rasdaemon-log-non_standard_event-at-just-one-line.patch new file mode 100644 index 0000000..1d85b12 --- /dev/null +++ b/2002-rasdaemon-log-non_standard_event-at-just-one-line.patch @@ -0,0 +1,48 @@ +From 9e407134b86f7a176970be70121e08cac6cad3ff Mon Sep 17 00:00:00 2001 +From: Ruidong Tian +Date: Thu, 7 Sep 2023 18:19:40 +0800 +Subject: [PATCH 2/4] rasdaemon: log non_standard_event at just one line + +It is more reasonable log non_standard_event in one line exclude errors +dump. So you can easily to get decoded non_standard_event log in one +line if you implement a decoder like other event. + +Signed-off-by: Ruidong Tian +--- + ras-non-standard-handler.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/ras-non-standard-handler.c b/ras-non-standard-handler.c +index 6ccf5bc..7818ed8 100644 +--- a/ras-non-standard-handler.c ++++ b/ras-non-standard-handler.c +@@ -174,7 +174,7 @@ int ras_non_standard_event_handler(struct trace_seq *s, + case GHES_SEV_PANIC: + ev.severity = "Fatal"; + } +- trace_seq_printf(s, "\n %s", ev.severity); ++ trace_seq_printf(s, " %s", ev.severity); + + ev.sec_type = pevent_get_field_raw(s, event, "sec_type", + record, &len, 1); +@@ -185,7 +185,7 @@ int ras_non_standard_event_handler(struct trace_seq *s, + trace_seq_printf(s, "\n section type: %s", + "Ampere Specific Error\n"); + else +- trace_seq_printf(s, "\n section type: %s", ++ trace_seq_printf(s, " section type: %s", + uuid_le(ev.sec_type)); + ev.fru_text = pevent_get_field_raw(s, event, "fru_text", + record, &len, 1); +@@ -198,7 +198,7 @@ int ras_non_standard_event_handler(struct trace_seq *s, + if (pevent_get_field_val(s, event, "len", record, &val, 1) < 0) + return -1; + ev.length = val; +- trace_seq_printf(s, "\n length: %d\n", ev.length); ++ trace_seq_printf(s, " length: %d", ev.length); + + ev.error = pevent_get_field_raw(s, event, "buf", record, &len, 1); + if(!ev.error) +-- +2.33.1 + diff --git a/2003-rasdaemon-add-support-for-THead-Yitian-non-standard-.patch b/2003-rasdaemon-add-support-for-THead-Yitian-non-standard-.patch new file mode 100644 index 0000000..519f4d7 --- /dev/null +++ b/2003-rasdaemon-add-support-for-THead-Yitian-non-standard-.patch @@ -0,0 +1,409 @@ +From dbc5d5a9ba57ef3f84eb09c9ca658c96219a1736 Mon Sep 17 00:00:00 2001 +From: Ruidong Tian +Date: Thu, 7 Sep 2023 18:21:05 +0800 +Subject: [PATCH 3/4] rasdaemon: add support for THead Yitian non-standard + error decoder + +Add a new non-standard error decoder to decode THead YiTian error +section. Put all related code to a new source file. + +Signed-off-by: Ruidong Tian +--- + Makefile.am | 7 +- + configure.ac | 11 ++ + non-standard-yitian.c | 251 ++++++++++++++++++++++++++++++++++++++++++ + non-standard-yitian.h | 73 ++++++++++++ + 4 files changed, 341 insertions(+), 1 deletion(-) + create mode 100644 non-standard-yitian.c + create mode 100644 non-standard-yitian.h + +diff --git a/Makefile.am b/Makefile.am +index fabca78..7cbc81e 100644 +--- a/Makefile.am ++++ b/Makefile.am +@@ -63,13 +63,18 @@ endif + if WITH_AMP_NS_DECODE + rasdaemon_SOURCES += non-standard-ampere.c + endif ++if WITH_YITIAN_NS_DECODE ++ rasdaemon_SOURCES += non-standard-yitian.c ++endif ++ + rasdaemon_LDADD = -lpthread $(SQLITE3_LIBS) libtrace/libtrace.a + + include_HEADERS = config.h ras-events.h ras-logger.h ras-mc-handler.h \ + ras-aer-handler.h ras-mce-handler.h ras-record.h bitfield.h ras-report.h \ + ras-extlog-handler.h ras-arm-handler.h ras-non-standard-handler.h \ + ras-devlink-handler.h ras-diskerror-handler.h rbtree.h ras-page-isolation.h \ +- non-standard-hisilicon.h non-standard-ampere.h ras-memory-failure-handler.h ++ non-standard-hisilicon.h non-standard-ampere.h ras-memory-failure-handler.h \ ++ non-standard-yitian.h + + # This rule can't be called with more than one Makefile job (like make -j8) + # I can't figure out a way to fix that +diff --git a/configure.ac b/configure.ac +index 33b81fe..a02cca3 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -161,6 +161,16 @@ AS_IF([test "x$enable_amp_ns_decode" = "xyes" || test "x$enable_all" == "xyes"], + AM_CONDITIONAL([WITH_AMP_NS_DECODE], [test x$enable_amp_ns_decode = xyes || test x$enable_all == xyes]) + AM_COND_IF([WITH_AMP_NS_DECODE], [USE_AMP_NS_DECODE="yes"], [USE_AMP_NS_DECODE="no"]) + ++AC_ARG_ENABLE([yitian_ns_decode], ++ AS_HELP_STRING([--enable-yitian-ns-decode], [enable YITIAN_NS_DECODE events (currently experimental)])) ++ ++AS_IF([test "x$enable_yitian_ns_decode" = "xyes" || test "x$enable_all" == "xyes"], [ ++ AC_DEFINE(HAVE_YITIAN_NS_DECODE,1,"have YITIAN UNKNOWN_SEC events decode") ++ AC_SUBST([WITH_YITIAN_NS_DECODE]) ++]) ++AM_CONDITIONAL([WITH_YITIAN_NS_DECODE], [test x$enable_yitian_ns_decode = xyes || test x$enable_all == xyes]) ++AM_COND_IF([WITH_YITIAN_NS_DECODE], [USE_YITIAN_NS_DECODE="yes"], [USE_YITIAN_NS_DECODE="no"]) ++ + test "$sysconfdir" = '${prefix}/etc' && sysconfdir=/etc + + CFLAGS="$CFLAGS -Wall -Wmissing-prototypes -Wstrict-prototypes" +@@ -201,4 +211,5 @@ compile time options summary + Memory Failure : $USE_MEMORY_FAILURE + Memory CE PFA : $USE_MEMORY_CE_PFA + AMP RAS errors : $USE_AMP_NS_DECODE ++ YITIAN RAS errors : $USE_YITIAN_NS_DECODE + EOF +diff --git a/non-standard-yitian.c b/non-standard-yitian.c +new file mode 100644 +index 0000000..99cea47 +--- /dev/null ++++ b/non-standard-yitian.c +@@ -0,0 +1,251 @@ ++/* ++ * Copyright (C) 2023 Alibaba Inc ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ */ ++ ++#include ++#include ++#include ++#include ++#include "ras-record.h" ++#include "ras-logger.h" ++#include "ras-report.h" ++#include "ras-non-standard-handler.h" ++#include "non-standard-yitian.h" ++ ++static const char * const yitian_ddr_payload_err_reg_name[] = { ++ "Error Type:", ++ "Error SubType:", ++ "Error Instance:", ++ "ECCCFG0:", ++ "ECCCFG1:", ++ "ECCSTAT:", ++ "ECCERRCNT:", ++ "ECCCADDR0:", ++ "ECCCADDR1:", ++ "ECCCSYN0:", ++ "ECCCSYN1:", ++ "ECCCSYN2:", ++ "ECCUADDR0:", ++ "ECCUADDR1:", ++ "ECCUSYN0:", ++ "ECCUSYN1:", ++ "ECCUSYN2:", ++ "ECCBITMASK0:", ++ "ECCBITMASK1:", ++ "ECCBITMASK2:", ++ "ADVECCSTAT:", ++ "ECCAPSTAT:", ++ "ECCCDATA0:", ++ "ECCCDATA1:", ++ "ECCUDATA0:", ++ "ECCUDATA1:", ++ "ECCSYMBOL:", ++ "ECCERRCNTCTL:", ++ "ECCERRCNTSTAT:", ++ "ECCERRCNT0:", ++ "ECCERRCNT1:", ++ "RESERVED0:", ++ "RESERVED1:", ++ "RESERVED2:", ++}; ++ ++struct yitian_ras_type_info { ++ int id; ++ const char *name; ++ const char * const *sub; ++ int sub_num; ++}; ++ ++static const struct yitian_ras_type_info yitian_payload_error_type[] = { ++ { ++ .id = YITIAN_RAS_TYPE_DDR, ++ .name = "DDR", ++ }, ++ { ++ } ++}; ++ ++#ifdef HAVE_SQLITE3 ++static const struct db_fields yitian_ddr_payload_fields[] = { ++ { .name = "id", .type = "INTEGER PRIMARY KEY" }, ++ { .name = "timestamp", .type = "TEXT" }, ++ { .name = "address", .type = "INTEGER" }, ++ { .name = "regs_dump", .type = "TEXT" }, ++}; ++ ++static const struct db_table_descriptor yitian_ddr_payload_section_tab = { ++ .name = "yitian_ddr_reg_dump_event", ++ .fields = yitian_ddr_payload_fields, ++ .num_fields = ARRAY_SIZE(yitian_ddr_payload_fields), ++}; ++ ++int record_yitian_ddr_reg_dump_event(struct ras_ns_ev_decoder *ev_decoder, ++ struct ras_yitian_ddr_payload_event *ev) ++{ ++ int rc; ++ struct sqlite3_stmt *stmt = ev_decoder->stmt_dec_record; ++ ++ log(TERM, LOG_INFO, "yitian_ddr_reg_dump_event store: %p\n", stmt); ++ ++ sqlite3_bind_text (stmt, 1, ev->timestamp, -1, NULL); ++ sqlite3_bind_int64 (stmt, 2, ev->address); ++ sqlite3_bind_text (stmt, 3, ev->reg_msg, -1, NULL); ++ ++ rc = sqlite3_step(stmt); ++ if (rc != SQLITE_OK && rc != SQLITE_DONE) ++ log(TERM, LOG_ERR, ++ "Failed to do yitian_ddr_reg_dump_event step on sqlite: error = %d\n", rc); ++ rc = sqlite3_reset(stmt); ++ if (rc != SQLITE_OK && rc != SQLITE_DONE) ++ log(TERM, LOG_ERR, ++ "Failed reset yitian_ddr_reg_dump_event on sqlite: error = %d\n", rc); ++ log(TERM, LOG_INFO, "register inserted at db\n"); ++ ++ return rc; ++} ++#endif ++ ++static const char *oem_type_name(const struct yitian_ras_type_info *info, ++ uint8_t type_id) ++{ ++ const struct yitian_ras_type_info *type = &info[0]; ++ ++ for (; type->name; type++) { ++ if (type->id != type_id) ++ continue; ++ return type->name; ++ } ++ return "unknown"; ++} ++ ++static const char *oem_subtype_name(const struct yitian_ras_type_info *info, ++ uint8_t type_id, uint8_t sub_type_id) ++{ ++ const struct yitian_ras_type_info *type = &info[0]; ++ ++ for (; type->name; type++) { ++ const char * const *submodule = type->sub; ++ ++ if (type->id != type_id) ++ continue; ++ if (type->sub == NULL) ++ return type->name; ++ if (sub_type_id >= type->sub_num) ++ return "unknown"; ++ return submodule[sub_type_id]; ++ } ++ return "unknown"; ++} ++ ++void decode_yitian_ddr_payload_err_regs(struct ras_ns_ev_decoder *ev_decoder, ++ struct trace_seq *s, ++ const struct yitian_ddr_payload_type_sec *err, ++ struct ras_events *ras) ++{ ++ char buf[1024]; ++ char *p = buf; ++ char *end = buf + 1024; ++ int i = 0; ++ const struct yitian_payload_header *header = &err->header; ++ uint32_t *pstart; ++ time_t now; ++ struct tm *tm; ++ struct ras_yitian_ddr_payload_event ev; ++ ++ const char *type_str = oem_type_name(yitian_payload_error_type, ++ header->type); ++ ++ const char *subtype_str = oem_subtype_name(yitian_payload_error_type, ++ header->type, header->subtype); ++ ++#ifdef HAVE_SQLITE3 ++ if (ras->record_events && !ev_decoder->stmt_dec_record) { ++ if (ras_mc_add_vendor_table(ras, &ev_decoder->stmt_dec_record, ++ &yitian_ddr_payload_section_tab) != SQLITE_OK) { ++ trace_seq_printf(s, "create sql fail\n"); ++ return; ++ } ++ } ++#endif ++ ++ now = time(NULL); ++ tm = localtime(&now); ++ if (tm) ++ strftime(ev.timestamp, sizeof(ev.timestamp), ++ "%Y-%m-%d %H:%M:%S %z", tm); ++ //display error type ++ p += snprintf(p, end - p, " %s", yitian_ddr_payload_err_reg_name[i++]); ++ p += snprintf(p, end - p, " %s,", type_str); ++ ++ //display error subtype ++ p += snprintf(p, end - p, " %s", yitian_ddr_payload_err_reg_name[i++]); ++ p += snprintf(p, end - p, " %s,", subtype_str); ++ ++ //display error instance ++ p += snprintf(p, end - p, " %s", yitian_ddr_payload_err_reg_name[i++]); ++ p += snprintf(p, end - p, " 0x%x,", header->instance); ++ ++ //display reg dump ++ for (pstart = (uint32_t *)&err->ecccfg0; (void *)pstart < (void *)(err + 1); pstart += 1) { ++ p += snprintf(p, end - p, " %s", yitian_ddr_payload_err_reg_name[i++]); ++ p += snprintf(p, end - p, " 0x%x ", *pstart); ++ } ++ ++ if (p > buf && p < end) { ++ p--; ++ *p = '\0'; ++ } ++ ++ ev.reg_msg = malloc(p - buf + 1); ++ memcpy(ev.reg_msg, buf, p - buf + 1); ++ ev.address = 0; ++ ++ i = 0; ++ p = NULL; ++ end = NULL; ++ trace_seq_printf(s, "%s\n", buf); ++ ++#ifdef HAVE_SQLITE3 ++ record_yitian_ddr_reg_dump_event(ev_decoder, &ev); ++#endif ++ ++} ++ ++/* error data decoding functions */ ++static int decode_yitian710_ns_error(struct ras_events *ras, ++ struct ras_ns_ev_decoder *ev_decoder, ++ struct trace_seq *s, ++ struct ras_non_standard_event *event) ++{ ++ int payload_type = event->error[0]; ++ ++ if (payload_type == YITIAN_RAS_TYPE_DDR) { ++ const struct yitian_ddr_payload_type_sec *err = ++ (struct yitian_ddr_payload_type_sec *)event->error; ++ decode_yitian_ddr_payload_err_regs(ev_decoder, s, err, ras); ++ } else { ++ trace_seq_printf(s, "%s: wrong payload type\n", __func__); ++ return -1; ++ } ++ return 0; ++} ++ ++struct ras_ns_ev_decoder yitian_ns_oem_decoder[] = { ++ { ++ .sec_type = "a698081116ea4e4db936fb00a23ff29c", ++ .decode = decode_yitian710_ns_error, ++ }, ++}; ++ ++static void __attribute__((constructor)) yitian_ns_init(void) ++{ ++ int i; ++ for (i = 0; i < ARRAY_SIZE(yitian_ns_oem_decoder); i++) ++ register_ns_ev_decoder(&yitian_ns_oem_decoder[i]); ++} +diff --git a/non-standard-yitian.h b/non-standard-yitian.h +new file mode 100644 +index 0000000..b7d6a2d +--- /dev/null ++++ b/non-standard-yitian.h +@@ -0,0 +1,73 @@ ++/* ++ * Copyright (C) 2023 Alibaba Inc ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ */ ++ ++ ++#ifndef __NON_STANDARD_YITIAN_H ++#define __NON_STANDARD_YITIAN_H ++ ++#include "ras-events.h" ++#include "libtrace/event-parse.h" ++ ++#define YITIAN_RAS_TYPE_DDR 0x50 ++ ++struct yitian_payload_header { ++ uint8_t type; ++ uint8_t subtype; ++ uint16_t instance; ++}; ++ ++struct yitian_ddr_payload_type_sec { ++ struct yitian_payload_header header; ++ uint32_t ecccfg0; ++ uint32_t ecccfg1; ++ uint32_t eccstat; ++ uint32_t eccerrcnt; ++ uint32_t ecccaddr0; ++ uint32_t ecccaddr1; ++ uint32_t ecccsyn0; ++ uint32_t ecccsyn1; ++ uint32_t ecccsyn2; ++ uint32_t eccuaddr0; ++ uint32_t eccuaddr1; ++ uint32_t eccusyn0; ++ uint32_t eccusyn1; ++ uint32_t eccusyn2; ++ uint32_t eccbitmask0; ++ uint32_t eccbitmask1; ++ uint32_t eccbitmask2; ++ uint32_t adveccstat; ++ uint32_t eccapstat; ++ uint32_t ecccdata0; ++ uint32_t ecccdata1; ++ uint32_t eccudata0; ++ uint32_t eccudata1; ++ uint32_t eccsymbol; ++ uint32_t eccerrcntctl; ++ uint32_t eccerrcntstat; ++ uint32_t eccerrcnt0; ++ uint32_t eccerrcnt1; ++ uint32_t reserved0; ++ uint32_t reserved1; ++ uint32_t reserved2; ++}; ++ ++struct ras_yitian_ddr_payload_event { ++ char timestamp[64]; ++ unsigned long long address; ++ char *reg_msg; ++}; ++ ++int record_yitian_ddr_reg_dump_event(struct ras_ns_ev_decoder *ev_decoder, ++ struct ras_yitian_ddr_payload_event *ev); ++void decode_yitian_ddr_payload_err_regs(struct ras_ns_ev_decoder *ev_decoder, ++ struct trace_seq *s, ++ const struct yitian_ddr_payload_type_sec *err, ++ struct ras_events *ras); ++#endif +-- +2.33.1 + diff --git a/2004-rasdaemon-ras-mc-ctl-Add-support-to-display-the-THea.patch b/2004-rasdaemon-ras-mc-ctl-Add-support-to-display-the-THea.patch new file mode 100644 index 0000000..b508066 --- /dev/null +++ b/2004-rasdaemon-ras-mc-ctl-Add-support-to-display-the-THea.patch @@ -0,0 +1,105 @@ +From 2e30517b9584ee8ae99553400168e07afce8ff9c Mon Sep 17 00:00:00 2001 +From: Ruidong Tian +Date: Thu, 7 Sep 2023 18:22:06 +0800 +Subject: [PATCH 4/4] rasdaemon: ras-mc-ctl: Add support to display the THead + vendor errors + +Add support for the THead YiTian DDRC register dump event. + +Signed-off-by: Ruidong Tian +--- + util/ras-mc-ctl.in | 43 +++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 43 insertions(+) + +diff --git a/util/ras-mc-ctl.in b/util/ras-mc-ctl.in +index 1e3aeb7..d30fca4 100755 +--- a/util/ras-mc-ctl.in ++++ b/util/ras-mc-ctl.in +@@ -1528,6 +1528,7 @@ sub errors + use constant { + HISILICON_KUNPENG_920 => "Kunpeng920", + HISILICON_KUNPENG_9XX => "Kunpeng9xx", ++ THEAD_YITIAN_7XX => "YiTian7XX", + }; + + sub vendor_errors_summary +@@ -1536,6 +1537,7 @@ sub vendor_errors_summary + my ($num_args, $platform_id); + my ($query, $query_handle, $count, $out); + my ($module_id, $sub_module_id, $err_severity, $err_sev, $err_info); ++ my ($address); + + $num_args = $#ARGV + 1; + $platform_id = 0; +@@ -1628,6 +1630,24 @@ sub vendor_errors_summary + $query_handle->finish; + } + ++ # THead Yitian710 DDR errors ++ if ($platform_id eq THEAD_YITIAN_7XX) { ++ $query = "select address, count(*) from yitian_ddr_reg_dump_event"; ++ $query_handle = $dbh->prepare($query); ++ $query_handle->execute(); ++ $query_handle->bind_columns(\($address, $count)); ++ $out = ""; ++ while($query_handle->fetch()) { ++ $out .= "\terrors: $count"; ++ } ++ if ($out ne "") { ++ print "THead YiTian710 DDR error dump events summary:\n$out\n"; ++ } else { ++ print "No THead YiTian710 DDR error dump errors.\n\n"; ++ } ++ $query_handle->finish; ++ } ++ + undef($dbh); + } + +@@ -1638,6 +1658,7 @@ sub vendor_errors + my ($query, $query_handle, $id, $timestamp, $out); + my ($version, $soc_id, $socket_id, $nimbus_id, $core_id, $port_id); + my ($module_id, $sub_module_id, $err_severity, $err_type, $err_info, $regs); ++ my ($address, $regs_dump); + + $num_args = $#ARGV + 1; + $platform_id = 0; +@@ -1743,6 +1764,27 @@ sub vendor_errors + $query_handle->finish; + } + ++ # THead Yitian7xx ddr errors ++ if ($platform_id eq THEAD_YITIAN_7XX) { ++ $query = "select id, timestamp, address, regs_dump from yitian_ddr_reg_dump_event order by id"; ++ $query_handle = $dbh->prepare($query); ++ $query_handle->execute(); ++ $query_handle->bind_columns(\($id, $timestamp, $address, $regs_dump)); ++ $out = ""; ++ while($query_handle->fetch()) { ++ $out .= "$id. $timestamp "; ++ $out .= "Error Address: $address "; ++ $out .= "Error Registers Dump: $regs_dump" if ($regs_dump); ++ $out .= "\n\n"; ++ } ++ if ($out ne "") { ++ print "THead Yitian710 DDRC error events:\n$out\n"; ++ } else { ++ print "No THead Yitian710 DDRC error events.\n"; ++ } ++ $query_handle->finish; ++ } ++ + undef($dbh); + } + +@@ -1751,6 +1793,7 @@ 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 "\tTHead Yitian7xx, platform-id=\"", THEAD_YITIAN_7XX, "\"\n"; + print "\n"; + } + +-- +2.33.1 + diff --git a/rasdaemon.spec b/rasdaemon.spec index 5c06b1e..9f6dca4 100644 --- a/rasdaemon.spec +++ b/rasdaemon.spec @@ -1,7 +1,7 @@ %define anolis_release .0.1 Name: rasdaemon Version: 0.6.7 -Release: 8%{?dist} +Release: 9%{?dist} Summary: Utility to receive RAS error tracings License: GPLv2 URL: http://git.infradead.org/users/mchehab/rasdaemon.git @@ -30,6 +30,11 @@ Patch20: d0e0bb3d73c4bc5060da20270a089857bba2a64c.patch Patch1001: 1001-rasdaemon-Add-notification-support-when-page-goes-of.patch +Patch2001: 2001-configure.ac-fix-SYSCONFDEFDIR-default-value.patch +Patch2002: 2002-rasdaemon-log-non_standard_event-at-just-one-line.patch +Patch2003: 2003-rasdaemon-add-support-for-THead-Yitian-non-standard-.patch +Patch2004: 2004-rasdaemon-ras-mc-ctl-Add-support-to-display-the-THea.patch + ExcludeArch: s390 s390x BuildRequires: make BuildRequires: gcc @@ -68,14 +73,18 @@ an utility for reporting current error counts from the EDAC sysfs files. %patch2 -p1 %patch3 -p1 %patch1001 -p1 +%patch2001 -p1 +%patch2002 -p1 +%patch2003 -p1 +%patch2004 -p1 autoreconf -vfi %build %ifarch %{arm} aarch64 -%configure --enable-sqlite3 --enable-aer --enable-mce --enable-extlog --enable-devlink --enable-diskerror --enable-abrt-report --enable-non-standard --enable-arm --enable-hisi-ns-decode +%configure --enable-sqlite3 --enable-aer --enable-mce --enable-extlog --enable-devlink --enable-diskerror --enable-abrt-report --enable-non-standard --enable-memory-failure --enable-arm --enable-hisi-ns-decode --enable-yitian-ns-decode %else -%configure --enable-sqlite3 --enable-aer --enable-mce --enable-extlog --enable-devlink --enable-diskerror --enable-abrt-report +%configure --enable-sqlite3 --enable-aer --enable-mce --enable-extlog --enable-devlink --enable-diskerror --enable-abrt-report --enable-non-standard --enable-memory-failure %endif make %{?_smp_mflags} @@ -109,6 +118,9 @@ install -D -p -m 0755 misc/notices/* %{buildroot}%{_sysconfdir}/rasdaemon_notice %endif %changelog +* Thu Sep 02 2023 Ruidong Tian - 0.6.7-9 +- rasdaemon: add decoder to decode yitian ns error + * Fri Jun 02 2023 Bixuan Cui - 0.6.7-8.0.1 - rasdaemon: add notification support when page goes offline for Memory Corrected Error -- Gitee