!63 rasdaemon: upgrade to 0.6.8

From: @lvying6 
Reviewed-by: @xiezhipeng1 
Signed-off-by: @xiezhipeng1
This commit is contained in:
openeuler-ci-bot 2023-01-19 04:05:14 +00:00 committed by Gitee
commit 7a9f756b2e
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
8 changed files with 20 additions and 296 deletions

View File

@ -1,55 +0,0 @@
From 44fa917e290255570772926a2a11fd5bee3af90c Mon Sep 17 00:00:00 2001
From: Xiaofei Tan <tanxiaofei@huawei.com>
Date: Mon, 11 Oct 2021 10:22:10 +0800
Subject: [PATCH 1/4] rasdaemon: Fix the issue of sprintf data type mismatch in
uuid_le()
The data type of sprintf called in the function uuid_le() is mismatch.
Arm64 compiler force it to unsigned char by default, and can work normally.
But if someone compile it with the option -fsigned-char, the function
can't work correctly.
Signed-off-by: Xiaofei Tan <tanxiaofei@huawei.com>
---
ras-extlog-handler.c | 2 +-
ras-non-standard-handler.c | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/ras-extlog-handler.c b/ras-extlog-handler.c
index 5fd3580..1834687 100644
--- a/ras-extlog-handler.c
+++ b/ras-extlog-handler.c
@@ -152,7 +152,7 @@ static char *uuid_le(const char *uu)
static const unsigned char le[16] = {3,2,1,0,5,4,7,6,8,9,10,11,12,13,14,15};
for (i = 0; i < 16; i++) {
- p += sprintf(p, "%.2x", uu[le[i]]);
+ p += sprintf(p, "%.2x", (unsigned char) uu[le[i]]);
switch (i) {
case 3:
case 5:
diff --git a/ras-non-standard-handler.c b/ras-non-standard-handler.c
index 6ccf5bc..6d5a6f8 100644
--- a/ras-non-standard-handler.c
+++ b/ras-non-standard-handler.c
@@ -36,7 +36,7 @@ static char *uuid_le(const char *uu)
static const unsigned char le[16] = {3,2,1,0,5,4,7,6,8,9,10,11,12,13,14,15};
for (i = 0; i < 16; i++) {
- p += sprintf(p, "%.2x", uu[le[i]]);
+ p += sprintf(p, "%.2x", (unsigned char) uu[le[i]]);
switch (i) {
case 3:
case 5:
@@ -61,7 +61,7 @@ static int uuid_le_cmp(const char *sec_type, const char *uuid2)
3, 2, 1, 0, 5, 4, 7, 6, 8, 9, 10, 11, 12, 13, 14, 15};
for (i = 0; i < 16; i++)
- p += sprintf(p, "%.2x", sec_type[le[i]]);
+ p += sprintf(p, "%.2x", (unsigned char) sec_type[le[i]]);
*p = 0;
return strncmp(uuid1, uuid2, 32);
}
--
2.33.0

View File

@ -1,72 +0,0 @@
From 6af26231fd58be578ea7d2ceb009fddf14c386a7 Mon Sep 17 00:00:00 2001
From: Xiaofei Tan <tanxiaofei@huawei.com>
Date: Mon, 1 Feb 2021 19:09:59 +0800
Subject: [PATCH 2/4] rasdaemon: Fix the issue of command option -r for hip08
It will record event even the option -r is not provided for hip08.
It is not right, and fix it.
Signed-off-by: Xiaofei Tan <tanxiaofei@huawei.com>
---
non-standard-hisi_hip08.c | 6 +++---
non-standard-hisilicon.c | 6 ++++++
2 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/non-standard-hisi_hip08.c b/non-standard-hisi_hip08.c
index ebf03e1..9092183 100644
--- a/non-standard-hisi_hip08.c
+++ b/non-standard-hisi_hip08.c
@@ -670,7 +670,7 @@ static int decode_hip08_oem_type1_error(struct ras_events *ras,
}
#ifdef HAVE_SQLITE3
- if (!ev_decoder->stmt_dec_record) {
+ if (ras->record_events && !ev_decoder->stmt_dec_record) {
if (ras_mc_add_vendor_table(ras, &ev_decoder->stmt_dec_record,
&hip08_oem_type1_event_tab)
!= SQLITE_OK) {
@@ -842,7 +842,7 @@ static int decode_hip08_oem_type2_error(struct ras_events *ras,
}
#ifdef HAVE_SQLITE3
- if (!ev_decoder->stmt_dec_record) {
+ if (ras->record_events && !ev_decoder->stmt_dec_record) {
if (ras_mc_add_vendor_table(ras, &ev_decoder->stmt_dec_record,
&hip08_oem_type2_event_tab) != SQLITE_OK) {
trace_seq_printf(s,
@@ -992,7 +992,7 @@ static int decode_hip08_pcie_local_error(struct ras_events *ras,
}
#ifdef HAVE_SQLITE3
- if (!ev_decoder->stmt_dec_record) {
+ if (ras->record_events && !ev_decoder->stmt_dec_record) {
if (ras_mc_add_vendor_table(ras, &ev_decoder->stmt_dec_record,
&hip08_pcie_local_event_tab) != SQLITE_OK) {
trace_seq_printf(s,
diff --git a/non-standard-hisilicon.c b/non-standard-hisilicon.c
index a6f5e78..3fccff6 100644
--- a/non-standard-hisilicon.c
+++ b/non-standard-hisilicon.c
@@ -77,6 +77,9 @@ void record_vendor_data(struct ras_ns_ev_decoder *ev_decoder,
enum hisi_oem_data_type data_type,
int id, int64_t data, const char *text)
{
+ if (ev_decoder->stmt_dec_record == NULL)
+ return;
+
switch (data_type) {
case HISI_OEM_DATA_TYPE_INT:
sqlite3_bind_int(ev_decoder->stmt_dec_record, id, data);
@@ -94,6 +97,9 @@ int step_vendor_data_tab(struct ras_ns_ev_decoder *ev_decoder, const char *name)
{
int rc;
+ if (ev_decoder->stmt_dec_record == NULL)
+ return 0;
+
rc = sqlite3_step(ev_decoder->stmt_dec_record);
if (rc != SQLITE_OK && rc != SQLITE_DONE)
log(TERM, LOG_ERR,
--
2.33.0

View File

@ -1,76 +0,0 @@
From 6ff3528ea696377fe1ec666839258abfcf8802b6 Mon Sep 17 00:00:00 2001
From: Xiaofei Tan <tanxiaofei@huawei.com>
Date: Fri, 20 Aug 2021 10:02:04 +0800
Subject: [PATCH 3/4] rasdaemon: Fix some print format issues for hisi common
error section
It is not right to use '%d' to print uint8_t and uint16_t, although
there is no function issue. Change to use '%hhu' and '%hu' separately.
Signed-off-by: Xiaofei Tan <tanxiaofei@huawei.com>
---
non-standard-hisilicon.c | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/non-standard-hisilicon.c b/non-standard-hisilicon.c
index 3fccff6..f9c7bd4 100644
--- a/non-standard-hisilicon.c
+++ b/non-standard-hisilicon.c
@@ -198,7 +198,7 @@ static const char* get_soc_desc(uint8_t soc_id)
static void decode_module(struct hisi_event *event, uint8_t module_id)
{
if (module_id >= sizeof(module_name)/sizeof(char *))
- HISI_SNPRINTF(event->error_msg, "module=unknown(id=%d) ", module_id);
+ HISI_SNPRINTF(event->error_msg, "module=unknown(id=%hhu) ", module_id);
else
HISI_SNPRINTF(event->error_msg, "module=%s ", module_name[module_id]);
}
@@ -207,36 +207,36 @@ static void decode_hisi_common_section_hdr(struct ras_ns_ev_decoder *ev_decoder,
const struct hisi_common_error_section *err,
struct hisi_event *event)
{
- HISI_SNPRINTF(event->error_msg, "[ table_version=%d", err->version);
+ HISI_SNPRINTF(event->error_msg, "[ table_version=%hhu", err->version);
if (err->val_bits & BIT(HISI_COMMON_VALID_SOC_ID))
HISI_SNPRINTF(event->error_msg, "soc=%s", get_soc_desc(err->soc_id));
if (err->val_bits & BIT(HISI_COMMON_VALID_SOCKET_ID))
- HISI_SNPRINTF(event->error_msg, "socket_id=%d", err->socket_id);
+ HISI_SNPRINTF(event->error_msg, "socket_id=%hhu", err->socket_id);
if (err->val_bits & BIT(HISI_COMMON_VALID_TOTEM_ID))
- HISI_SNPRINTF(event->error_msg, "totem_id=%d", err->totem_id);
+ HISI_SNPRINTF(event->error_msg, "totem_id=%hhu", err->totem_id);
if (err->val_bits & BIT(HISI_COMMON_VALID_NIMBUS_ID))
- HISI_SNPRINTF(event->error_msg, "nimbus_id=%d", err->nimbus_id);
+ HISI_SNPRINTF(event->error_msg, "nimbus_id=%hhu", err->nimbus_id);
if (err->val_bits & BIT(HISI_COMMON_VALID_SUBSYSTEM_ID))
- HISI_SNPRINTF(event->error_msg, "subsystem_id=%d", err->subsystem_id);
+ HISI_SNPRINTF(event->error_msg, "subsystem_id=%hhu", err->subsystem_id);
if (err->val_bits & BIT(HISI_COMMON_VALID_MODULE_ID))
decode_module(event, err->module_id);
if (err->val_bits & BIT(HISI_COMMON_VALID_SUBMODULE_ID))
- HISI_SNPRINTF(event->error_msg, "submodule_id=%d", err->submodule_id);
+ HISI_SNPRINTF(event->error_msg, "submodule_id=%hhu", err->submodule_id);
if (err->val_bits & BIT(HISI_COMMON_VALID_CORE_ID))
- HISI_SNPRINTF(event->error_msg, "core_id=%d", err->core_id);
+ HISI_SNPRINTF(event->error_msg, "core_id=%hhu", err->core_id);
if (err->val_bits & BIT(HISI_COMMON_VALID_PORT_ID))
- HISI_SNPRINTF(event->error_msg, "port_id=%d", err->port_id);
+ HISI_SNPRINTF(event->error_msg, "port_id=%hhu", err->port_id);
if (err->val_bits & BIT(HISI_COMMON_VALID_ERR_TYPE))
- HISI_SNPRINTF(event->error_msg, "err_type=%d", err->err_type);
+ HISI_SNPRINTF(event->error_msg, "err_type=%hu", err->err_type);
if (err->val_bits & BIT(HISI_COMMON_VALID_PCIE_INFO))
HISI_SNPRINTF(event->error_msg, "pcie_device_id=%04x:%02x:%02x.%x",
--
2.33.0

View File

@ -1,35 +0,0 @@
From 31c1d5f335aa63fb02583eca8fe21a18fbcb865e Mon Sep 17 00:00:00 2001
From: Xiaofei Tan <tanxiaofei@huawei.com>
Date: Fri, 20 Aug 2021 10:39:12 +0800
Subject: [PATCH 4/4] rasdaemon: Add some modules supported by hisi common
error section
Add some modules supported by hisi common error section. Besides,
HHA is the module for some old platform, and it takes the same place
of MATA, so remove it.
Signed-off-by: Xiaofei Tan <tanxiaofei@huawei.com>
---
non-standard-hisilicon.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/non-standard-hisilicon.c b/non-standard-hisilicon.c
index f9c7bd4..1432163 100644
--- a/non-standard-hisilicon.c
+++ b/non-standard-hisilicon.c
@@ -184,7 +184,11 @@ static const char* module_name[] = {
"SEC",
"RDE",
"MEE",
- "HHA",
+ "L4D",
+ "Tsensor",
+ "ROH",
+ "BTC",
+ "HILINK"
};
static const char* get_soc_desc(uint8_t soc_id)
--
2.33.0

View File

@ -1,37 +0,0 @@
From 1ff5f3d2a0fcd48add9462567c30fe0e14585fb4 Mon Sep 17 00:00:00 2001
From: Matt Whitlock <whitslack@users.noreply.github.com>
Date: Wed, 9 Jun 2021 10:25:18 -0400
Subject: [PATCH] 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 <mchehab+huawei@kernel.org>
---
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.27.0

Binary file not shown.

BIN
rasdaemon-0.6.8.tar.gz Normal file

Binary file not shown.

View File

@ -1,6 +1,6 @@
Name: rasdaemon
Version: 0.6.7
Release: 6
Version: 0.6.8
Release: 1
License: GPLv2
Summary: Utility to get Platform Reliability, Availability and Serviceability (RAS) reports via the Kernel tracing events
URL: https://github.com/mchehab/rasdaemon.git
@ -19,25 +19,20 @@ Requires(post): systemd
Requires(preun): systemd
Requires(postun): systemd
Patch1: bugfix-rasdaemon-wait-for-file-access.patch
Patch2: bugfix-fix-fd-check.patch
Patch3: bugfix-fix-disk-error-log-storm.patch
Patch4: backport-configure.ac-fix-SYSCONFDEFDIR-default-value.patch
Patch5: 0001-rasdaemon-Support-cpu-fault-isolation-for-corrected-.patch
Patch6: 0002-rasdaemon-Support-cpu-fault-isolation-for-recoverabl.patch
Patch7: 0001-rasdaemon-Fix-the-issue-of-sprintf-data-type-mismatc.patch
Patch8: 0002-rasdaemon-Fix-the-issue-of-command-option-r-for-hip0.patch
Patch9: 0003-rasdaemon-Fix-some-print-format-issues-for-hisi-comm.patch
Patch10: 0004-rasdaemon-Add-some-modules-supported-by-hisi-common-.patch
Patch11: 0003-rasdaemon-Modify-recording-Hisilicon-common-error-da.patch
Patch12: 0004-rasdaemon-ras-mc-ctl-Modify-error-statistics-for-HiS.patch
Patch13: 0005-rasdaemon-ras-mc-ctl-Reformat-error-info-of-the-HiSi.patch
Patch14: 0006-rasdaemon-ras-mc-ctl-Add-printing-usage-if-necessary.patch
Patch15: 0007-rasdaemon-ras-mc-ctl-Add-support-to-display-the-HiSi.patch
Patch16: 0008-rasdaemon-ras-mc-ctl-Relocate-reading-and-display-Ku.patch
Patch17: 0009-rasdaemon-ras-mc-ctl-Updated-HiSilicon-platform-name.patch
Patch18: 0010-rasdaemon-Fix-for-a-memory-out-of-bounds-issue-and-o.patch
Patch19: 0001-rasdaemon-use-standard-length-PATH_MAX-for-path-name.patch
Patch9000: bugfix-rasdaemon-wait-for-file-access.patch
Patch9001: bugfix-fix-fd-check.patch
Patch9002: bugfix-fix-disk-error-log-storm.patch
Patch9003: 0001-rasdaemon-Support-cpu-fault-isolation-for-corrected-.patch
Patch9004: 0002-rasdaemon-Support-cpu-fault-isolation-for-recoverabl.patch
Patch9005: 0003-rasdaemon-Modify-recording-Hisilicon-common-error-da.patch
Patch9006: 0004-rasdaemon-ras-mc-ctl-Modify-error-statistics-for-HiS.patch
Patch9007: 0005-rasdaemon-ras-mc-ctl-Reformat-error-info-of-the-HiSi.patch
Patch9008: 0006-rasdaemon-ras-mc-ctl-Add-printing-usage-if-necessary.patch
Patch9009: 0007-rasdaemon-ras-mc-ctl-Add-support-to-display-the-HiSi.patch
Patch9010: 0008-rasdaemon-ras-mc-ctl-Relocate-reading-and-display-Ku.patch
Patch9011: 0009-rasdaemon-ras-mc-ctl-Updated-HiSilicon-platform-name.patch
Patch9012: 0010-rasdaemon-Fix-for-a-memory-out-of-bounds-issue-and-o.patch
Patch9013: 0001-rasdaemon-use-standard-length-PATH_MAX-for-path-name.patch
%description
The rasdaemon program is a daemon which monitors the platform
@ -83,6 +78,10 @@ rm INSTALL %{buildroot}/usr/include/*.h
/usr/bin/systemctl enable rasdaemon.service >/dev/null 2>&1 || :
%changelog
* Thu Jan 19 2023 Lv Ying <lvying6@huawei.com> - 0.6.8-1
- backport bugfix patches from community:
1. Fix error print handle_ras_events.
* Thu Aug 25 2022 Xiaofei Tan <tanxiaofei@huawei.com> - 0.6.7-6
- Type:bugfix
- ID:NA