diff --git a/0006-add-cpu-online-fault-isolation.patch b/0006-add-cpu-online-fault-isolation.patch index 81707cdc788d54c941de87d6b53dc360ede0962e..cac4da05e2e44d486ec34797178467e41bd8a201 100644 --- a/0006-add-cpu-online-fault-isolation.patch +++ b/0006-add-cpu-online-fault-isolation.patch @@ -14,12 +14,12 @@ Signed-off-by: Luo Shengwei misc/rasdaemon.env | 17 ++ queue.c | 126 +++++++++++ queue.h | 43 ++++ - ras-arm-handler.c | 72 +++++++ - ras-cpu-isolation.c | 495 ++++++++++++++++++++++++++++++++++++++++++++ + ras-arm-handler.c | 73 +++++++ + ras-cpu-isolation.c | 499 ++++++++++++++++++++++++++++++++++++++++++++ ras-cpu-isolation.h | 76 +++++++ ras-events.c | 8 + ras-record.h | 5 + - 11 files changed, 859 insertions(+), 2 deletions(-) + 11 files changed, 864 insertions(+), 2 deletions(-) create mode 100644 queue.c create mode 100644 queue.h create mode 100644 ras-cpu-isolation.c @@ -295,10 +295,10 @@ index 0000000..9684c58 +#endif \ No newline at end of file diff --git a/ras-arm-handler.c b/ras-arm-handler.c -index 2f170e2..f9baa51 100644 +index 2f170e2..10d0099 100644 --- a/ras-arm-handler.c +++ b/ras-arm-handler.c -@@ -20,6 +20,43 @@ +@@ -20,6 +20,44 @@ #include "ras-record.h" #include "ras-logger.h" #include "ras-report.h" @@ -333,6 +333,7 @@ index 2f170e2..f9baa51 100644 + value = pevent_read_number(event->pevent, data+cur_offset, FLAGS_SIZE); + if (is_core_failure(value)) { + num++; ++ log(TERM, LOG_INFO, "Error in cpu core catched\n"); + } + cur_offset += PEI_ERR_SIZE; + } @@ -342,7 +343,7 @@ index 2f170e2..f9baa51 100644 int ras_arm_event_handler(struct trace_seq *s, struct pevent_record *record, -@@ -78,6 +115,41 @@ int ras_arm_event_handler(struct trace_seq *s, +@@ -78,6 +116,41 @@ int ras_arm_event_handler(struct trace_seq *s, ev.psci_state = val; trace_seq_printf(s, "\n psci_state: %d", ev.psci_state); @@ -386,10 +387,10 @@ index 2f170e2..f9baa51 100644 ras_store_arm_record(ras, &ev); diff --git a/ras-cpu-isolation.c b/ras-cpu-isolation.c new file mode 100644 -index 0000000..7f1c287 +index 0000000..a809f91 --- /dev/null +++ b/ras-cpu-isolation.c -@@ -0,0 +1,495 @@ +@@ -0,0 +1,499 @@ +/* + * Copyright (c) Huawei Technologies Co., Ltd. 2021-2021. All rights reserved. + * @@ -613,6 +614,9 @@ index 0000000..7f1c287 + if (isalpha(*unit)) { + has_unit = 1; + env_size--; ++ if (env_size <= 0) { ++ return -1; ++ } + } + + for (int i = 0; i < env_size; ++i) { @@ -632,7 +636,7 @@ index 0000000..7f1c287 + for (const struct param *units = config->units; units->name; units++) { + /* value character and unit character are both valid */ + if (!strcasecmp(unit, units->name)) { -+ if (*value > ULONG_MAX / units->value) { ++ if (*value > (ULONG_MAX / units->value)) { + log(TERM, LOG_ERR, "%s is out of range: %lu\n", env, ULONG_MAX); + return -1; + } @@ -667,7 +671,6 @@ index 0000000..7f1c287 + char *env = getenv("CPU_ISOLATION_ENABLE"); + + if (env == NULL || strcasecmp(env, "yes")) { -+ log(TERM, LOG_WARNING, "Cpu fault isolation is disabled\n"); + return -1; + } + @@ -678,8 +681,11 @@ index 0000000..7f1c287 +{ + if (init_cpu_info(cpus) < 0 || check_config_status() < 0) { + enabled = 0; ++ log(TERM, LOG_WARNING, "Cpu fault isolation is disabled\n"); ++ return; + } + ++ log(TERM, LOG_INFO, "Cpu fault isolation is enabled\n"); + init_config(&threshold); + init_config(&cpu_limit); + init_config(&cycle); @@ -841,7 +847,6 @@ index 0000000..7f1c287 + int ret; + + if (enabled == 0) { -+ log(TERM, LOG_INFO, "The cpu fault isolation is disabled, return\n"); + return; + } + diff --git a/0007-add-trace-print-and-add-sqlite-store.patch b/0007-add-trace-print-and-add-sqlite-store.patch index e78d0b7b9dd53243b841077cc19523508d2ae0bf..08361e6cdacc20a9b5bccc5fc251e7014763b7f0 100644 --- a/0007-add-trace-print-and-add-sqlite-store.patch +++ b/0007-add-trace-print-and-add-sqlite-store.patch @@ -13,7 +13,7 @@ Signed-off-by: Luo Shengwei 2 files changed, 18 insertions(+) diff --git a/ras-arm-handler.c b/ras-arm-handler.c -index f9baa51..fd5c541 100644 +index 10d0099..23ad470 100644 --- a/ras-arm-handler.c +++ b/ras-arm-handler.c @@ -23,6 +23,13 @@ @@ -30,7 +30,7 @@ index f9baa51..fd5c541 100644 static int is_core_failure(unsigned long value) { /* -@@ -134,6 +141,7 @@ int ras_arm_event_handler(struct trace_seq *s, +@@ -135,6 +142,7 @@ int ras_arm_event_handler(struct trace_seq *s, case GHES_SEV_PANIC: ev.severity = "Fatal"; } @@ -38,7 +38,7 @@ index f9baa51..fd5c541 100644 if (val == GHES_SEV_CORRECTED || val == GHES_SEV_RECOVERABLE) { int len, nums; -@@ -141,6 +149,8 @@ int ras_arm_event_handler(struct trace_seq *s, +@@ -142,6 +150,8 @@ int ras_arm_event_handler(struct trace_seq *s, if (!ev.error_info) return -1; ev.length = len; diff --git a/rasdaemon.spec b/rasdaemon.spec index a25b8813f80fc28714d9a5af63751d8cb9ebd5bf..0015def46e131deb14ed2c84f03135d805f1efa9 100644 --- a/rasdaemon.spec +++ b/rasdaemon.spec @@ -1,6 +1,6 @@ Name: rasdaemon Version: 0.6.6 -Release: 5 +Release: 6 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 @@ -72,6 +72,10 @@ rm INSTALL %{buildroot}/usr/include/*.h /usr/bin/systemctl enable rasdaemon.service >/dev/null 2>&1 || : %changelog +* Tue Jun 8 2021 luoshengwei - 0.6.6-6 +- fix parameter check in parse_ul_config and add or move log print +- to suitable position + * Thu Jun 3 2021 luoshengwei - 0.6.6-5 - modify the way to get cpu status and modify some description of - the log print