Hello community, here is the log from the commit of package rasdaemon for openSUSE:Factory checked in at 2017-11-29 10:53:52 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/rasdaemon (Old) and /work/SRC/openSUSE:Factory/.rasdaemon.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "rasdaemon" Wed Nov 29 10:53:52 2017 rev:6 rq:546108 version:0.6.0 Changes: -------- --- /work/SRC/openSUSE:Factory/rasdaemon/rasdaemon.changes 2017-07-07 10:17:07.245277017 +0200 +++ /work/SRC/openSUSE:Factory/.rasdaemon.new/rasdaemon.changes 2017-11-29 10:53:53.681962424 +0100 @@ -1,0 +2,16 @@ +Tue Nov 21 07:37:13 UTC 2017 - e...@suse.com + +- Update to version 0.6.0: + * rasdaemon: Update DIMM labels for Intel Skylake servers + * rasdaemon:add support for non-standard error decoder + * rasdaemon:add support for Hisilicon non-standard error decoder + * configure.ac: show if Hisilicon error report are enabled + * rasdaemon: add support for ARM events + * configure.ac: display if ARM error report is enabled + * rasdaemon: update bugs report information + * Makefile: add new rasdaemon headers + * rasdaemon.spec: add other --enable options + * Bump to version 0.6.0 + (FATE#323162). + +------------------------------------------------------------------- Old: ---- rasdaemon-0.5.9.tar.xz New: ---- rasdaemon-0.6.0.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ rasdaemon.spec ++++++ --- /var/tmp/diff_new_pack.PpLpJJ/_old 2017-11-29 10:53:54.253941672 +0100 +++ /var/tmp/diff_new_pack.PpLpJJ/_new 2017-11-29 10:53:54.253941672 +0100 @@ -1,7 +1,7 @@ # # spec file for package rasdaemon # -# Copyright (c) 2017 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -17,7 +17,7 @@ Name: rasdaemon -Version: 0.5.9 +Version: 0.6.0 Release: 0 Summary: Utility to receive RAS error tracings License: GPL-2.0 ++++++ _service ++++++ --- /var/tmp/diff_new_pack.PpLpJJ/_old 2017-11-29 10:53:54.281940657 +0100 +++ /var/tmp/diff_new_pack.PpLpJJ/_new 2017-11-29 10:53:54.281940657 +0100 @@ -4,8 +4,9 @@ <param name="scm">git</param> <param name="changesgenerate">enable</param> <param name="filename">rasdaemon</param> - <param name="revision">0d1f3f11be930187c7d290293a487d125a10d433</param> - <param name="version">0.5.9</param> + <param name="revision">refs/tags/v0.6.0</param> + <param name="versionformat">@PARENT_TAG@</param> + <param name="versionrewrite-pattern">v(.*)</param> </service> <service mode="disabled" name="recompress"> <param name="file">*.tar</param> ++++++ _servicedata ++++++ --- /var/tmp/diff_new_pack.PpLpJJ/_old 2017-11-29 10:53:54.301939931 +0100 +++ /var/tmp/diff_new_pack.PpLpJJ/_new 2017-11-29 10:53:54.301939931 +0100 @@ -1,4 +1,4 @@ <servicedata> <service name="tar_scm"> <param name="url">git://git.infradead.org/users/mchehab/rasdaemon.git</param> - <param name="changesrevision">0d1f3f11be930187c7d290293a487d125a10d433</param></service></servicedata> \ No newline at end of file + <param name="changesrevision">7deef57726d92c8575714be6e9fab100b1edb3bb</param></service></servicedata> \ No newline at end of file ++++++ rasdaemon-0.5.9.tar.xz -> rasdaemon-0.6.0.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rasdaemon-0.5.9/ChangeLog new/rasdaemon-0.6.0/ChangeLog --- old/rasdaemon-0.5.9/ChangeLog 2017-06-08 11:49:33.000000000 +0200 +++ new/rasdaemon-0.6.0/ChangeLog 2017-10-14 11:49:59.000000000 +0200 @@ -100,3 +100,10 @@ - Version 0.5.9 * Add Knights Mill and updated DELL labels * Configure now reports enabled options + +2017-10-14 Mauro Carvalho Chehab <mche...@osg.samsung.com> + - Version 0.6.0 + * Added support for non-standard CPER error sections + * Added support for Hisilicon HIP07 SAS HW module + * Added support for ARM events + * Updated DIMM labels for Intel Skylake servers diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rasdaemon-0.5.9/Makefile.am new/rasdaemon-0.6.0/Makefile.am --- old/rasdaemon-0.5.9/Makefile.am 2017-06-08 11:49:33.000000000 +0200 +++ new/rasdaemon-0.6.0/Makefile.am 2017-10-14 11:49:59.000000000 +0200 @@ -24,6 +24,12 @@ if WITH_AER rasdaemon_SOURCES += ras-aer-handler.c endif +if WITH_NON_STANDARD + rasdaemon_SOURCES += ras-non-standard-handler.c +endif +if WITH_ARM + rasdaemon_SOURCES += ras-arm-handler.c +endif if WITH_MCE rasdaemon_SOURCES += ras-mce-handler.c mce-intel.c mce-amd-k8.c \ mce-intel-p4-p6.c mce-intel-nehalem.c \ @@ -38,11 +44,14 @@ if WITH_ABRT_REPORT rasdaemon_SOURCES += ras-report.c endif +if WITH_HISI_NS_DECODE + rasdaemon_SOURCES += non-standard-hisi_hip07.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-extlog-handler.h ras-arm-handler.h ras-non-standard-handler.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 -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rasdaemon-0.5.9/configure.ac new/rasdaemon-0.6.0/configure.ac --- old/rasdaemon-0.5.9/configure.ac 2017-06-08 11:49:33.000000000 +0200 +++ new/rasdaemon-0.6.0/configure.ac 2017-10-14 11:49:59.000000000 +0200 @@ -1,4 +1,4 @@ -AC_INIT([RASdaemon], 0.5.9) +AC_INIT([RASdaemon], 0.6.0) AM_SILENT_RULES([yes]) AC_CANONICAL_SYSTEM AC_CONFIG_MACRO_DIR([m4]) @@ -44,6 +44,24 @@ ]) AM_CONDITIONAL([WITH_AER], [test x$enable_aer = xyes]) +AC_ARG_ENABLE([non_standard], + AS_HELP_STRING([--enable-non-standard], [enable NON_STANDARD events (currently experimental)])) + +AS_IF([test "x$enable_non_standard" = "xyes"], [ + AC_DEFINE(HAVE_NON_STANDARD,1,"have UNKNOWN_SEC events collect") + AC_SUBST([WITH_NON_STANDARD]) +]) +AM_CONDITIONAL([WITH_NON_STANDARD], [test x$enable_non_standard = xyes]) + +AC_ARG_ENABLE([arm], + AS_HELP_STRING([--enable-arm], [enable ARM events (currently experimental)])) + +AS_IF([test "x$enable_arm" = "xyes"], [ + AC_DEFINE(HAVE_ARM,1,"have ARM events collect") + AC_SUBST([WITH_ARM]) +]) +AM_CONDITIONAL([WITH_ARM], [test x$enable_arm = xyes]) + AC_ARG_ENABLE([mce], AS_HELP_STRING([--enable-mce], [enable MCE events (currently experimental)])) @@ -71,6 +89,15 @@ ]) AM_CONDITIONAL([WITH_ABRT_REPORT], [test x$enable_abrt_report = xyes]) +AC_ARG_ENABLE([hisi_ns_decode], + AS_HELP_STRING([--enable-hisi-ns-decode], [enable HISI_NS_DECODE events (currently experimental)])) + +AS_IF([test "x$enable_hisi_ns_decode" = "xyes"], [ + AC_DEFINE(HAVE_HISI_NS_DECODE,1,"have HISI UNKNOWN_SEC events decode") + AC_SUBST([WITH_HISI_NS_DECODE]) +]) +AM_CONDITIONAL([WITH_HISI_NS_DECODE], [test x$enable_hisi_ns_decode = xyes]) + test "$sysconfdir" = '${prefix}/etc' && sysconfdir=/etc CFLAGS="$CFLAGS -Wall -Wmissing-prototypes -Wstrict-prototypes" @@ -92,9 +119,12 @@ compile time options summary ============================ - Sqlite3 : $enable_sqlite3 - AER : $enable_aer - MCE : $enable_mce - EXTLOG : $enable_extlog - ABRT report : $enable_abrt_report + Sqlite3 : $enable_sqlite3 + AER : $enable_aer + MCE : $enable_mce + EXTLOG : $enable_extlog + CPER non-standard : $enable_non_standard + ABRT report : $enable_abrt_report + HIP07 SAS HW errors : $enable_hisi_ns_decode + ARM events : $enable_arm EOF diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rasdaemon-0.5.9/labels/dell new/rasdaemon-0.6.0/labels/dell --- old/rasdaemon-0.5.9/labels/dell 2017-06-08 11:49:33.000000000 +0200 +++ new/rasdaemon-0.6.0/labels/dell 2017-10-14 11:49:59.000000000 +0200 @@ -50,6 +50,13 @@ DIMM_B5: 1.0.1; DIMM_B6: 1.1.1; DIMM_B7: 1.2.1; DIMM_B8: 1.3.1; DIMM_B9: 1.0.2; DIMM_B10: 1.1.2; DIMM_B11: 1.2.2; DIMM_B12: 1.3.2; + Product: PowerEdge R640, PowerEdge R740, PowerEdge R740xd + A1: 0.0.0; A2: 0.1.0; A3: 0.2.0; A4: 1.0.0; A5: 1.1.0; A6: 1.2.0; + A7: 0.0.1; A8: 0.1.1; A9: 0.2.1; A10: 1.0.1; A11: 1.1.1; A12: 1.2.1; + + B1: 2.0.0; B2: 2.1.0; B3: 2.2.0; B4: 3.0.0; B5: 3.1.0; B6: 3.2.0; + B7: 2.0.1; B8: 2.1.1; B9: 2.2.1; B10: 3.0.1; B11: 3.1.1; B12: 3.2.1; + Product: PowerEdge M520, PowerEdge R420, PowerEdge T420 DIMM_A1: 0.1.0; DIMM_A2: 0.2.0; DIMM_A3: 0.3.0; DIMM_A4: 0.1.1; DIMM_A5: 0.2.1; DIMM_A6: 0.3.1; @@ -69,6 +76,17 @@ DIMM_B1: 1.0.0; DIMM_B2: 1.1.0; DIMM_B3: 1.2.0; DIMM_B4: 1.3.0; DIMM_B5: 1.0.1; DIMM_B6: 1.1.1; DIMM_B7: 1.2.1; DIMM_B8: 1.3.1; + Product: PowerEdge C6320p + A1: 0.0.0; B1: 0.1.0; C1: 0.2.0; + D1: 1.0.0; E1: 1.1.0; F1: 1.2.0; + + Product: PowerEdge C6420 + A1: 0.0.0; A2: 0.1.0; A3: 0.2.0; A4: 1.0.0; A5: 1.1.0; A6: 1.2.0; + A7: 0.0.1; A8: 1.0.1; + + B1: 2.0.0; B2: 2.1.0; B3: 2.2.0; B4: 3.0.0; B5: 3.1.0; B6: 3.2.0; + B7: 2.0.1; B8: 3.0.1; + Product: PowerEdge R430, PowerEdge T430, PowerEdge R530 DIMM_A1: 0.0.0; DIMM_A2: 0.1.0; DIMM_A3: 0.2.0; DIMM_A4: 0.3.0; DIMM_A5: 0.0.1; DIMM_A6: 0.1.1; DIMM_A7: 0.2.1; DIMM_A8: 0.3.1; @@ -106,3 +124,16 @@ DIMM_C_A1: 2.1.0; DIMM_C_A2: 2.2.0; DIMM_D_A1: 3.1.0; DIMM_D_A2: 3.2.0; + + Product: PowerEdge R940 + A1: 0.0.0; A2: 0.1.0; A3: 0.2.0; A4: 1.0.0; A5: 1.1.0; A6: 1.2.0; + A7: 0.0.1; A8: 0.1.1; A9: 0.2.1; A10: 1.0.1; A11: 1.1.1; A12: 1.2.1; + + B1: 2.0.0; B2: 2.1.0; B3: 2.2.0; B4: 3.0.0; B5: 3.1.0; B6: 3.2.0; + B7: 2.0.1; B8: 2.1.1; B9: 2.2.1; B10: 3.0.1; B11: 3.1.1; B12: 3.2.1; + + C1: 4.0.0; C2: 4.1.0; C3: 4.2.0; C4: 5.0.0; C5: 5.1.0; C6: 5.2.0; + C7: 4.0.1; C8: 4.1.1; C9: 4.2.1; C10: 5.0.1; C11: 5.1.1; C12: 5.2.1; + + D1: 6.0.0; D2: 6.1.0; D3: 6.2.0; D4: 7.0.0; D5: 7.1.0; D6: 7.2.0; + D7: 6.0.1; D8: 6.1.1; D9: 6.2.1; D10: 7.0.1; D11: 7.1.1; D12: 7.2.1; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rasdaemon-0.5.9/misc/rasdaemon.spec.in new/rasdaemon-0.6.0/misc/rasdaemon.spec.in --- old/rasdaemon-0.5.9/misc/rasdaemon.spec.in 2017-06-08 11:49:33.000000000 +0200 +++ new/rasdaemon-0.6.0/misc/rasdaemon.spec.in 2017-10-14 11:49:59.000000000 +0200 @@ -36,7 +36,8 @@ %setup -q %build -%configure --enable-mce --enable-aer --enable-sqlite3 --enable-extlog --enable-abrt-report +%configure --enable-mce --enable-aer --enable-sqlite3 --enable-extlog --enable-abrt-report --enable-non-standard --enable-hisi-ns-decode --enable-arm + make %{?_smp_mflags} %install @@ -56,6 +57,9 @@ %changelog +* Sat Oct 14 2017 Mauro Carvalho Chehab <mche...@osg.samsung.com> 0.6.0-1 +- Bump to version 0.5.8 adding support for Arm and Hisilicon events and update Dell Skylate labels + * Thu Jun 08 2017 Mauro Carvalho Chehab <mche...@osg.samsung.com> 0.5.9-1 - Bump to version 0.5.8 adding support for Knights Mill and update DELL labels @@ -91,4 +95,3 @@ * Mon May 20 2013 Mauro Carvalho Chehab <mche...@redhat.com> 0.3.0-1 - Package created - diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rasdaemon-0.5.9/non-standard-hisi_hip07.c new/rasdaemon-0.6.0/non-standard-hisi_hip07.c --- old/rasdaemon-0.5.9/non-standard-hisi_hip07.c 1970-01-01 01:00:00.000000000 +0100 +++ new/rasdaemon-0.6.0/non-standard-hisi_hip07.c 2017-10-14 11:49:59.000000000 +0200 @@ -0,0 +1,146 @@ +/* + * Copyright (c) 2017 Hisilicon Limited. + * + * 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 <stdio.h> +#include <stdlib.h> +#include <string.h> +#include "ras-record.h" +#include "ras-logger.h" +#include "ras-report.h" +#include "ras-non-standard-handler.h" + +/* common definitions */ + +/* HISI SAS definitions */ +#define HISI_SAS_VALID_PA BIT(0) +#define HISI_SAS_VALID_MB_ERR BIT(1) +#define HISI_SAS_VALID_ERR_TYPE BIT(2) +#define HISI_SAS_VALID_AXI_ERR_INFO BIT(3) + +static int decode_hip07_sas_error(struct trace_seq *s, const void *error); +static int decode_hip07_hns_error(struct trace_seq *s, const void *error); + +struct ras_ns_dec_tab hisi_ns_dec_tab[] = { + { + .sec_type = "daffd8146eba4d8c8a91bc9bbf4aa301", + .decode = decode_hip07_sas_error, + }, + { + .sec_type = "fbc2d923ea7a453dab132949f5af9e53", + .decode = decode_hip07_hns_error, + }, +}; + +struct hisi_sas_err_sec { + uint64_t val_bits; + uint64_t physical_addr; + uint32_t mb; + uint32_t type; + uint32_t axi_err_info; +}; + +/* Common Functions */ +static char *err_bit_type(int etype) +{ + switch (etype) { + case 0x0: return "single-bit ecc"; + case 0x1: return "multi-bit ecc"; + } + return "unknown error"; +} + +/* SAS Functions */ +static char *sas_err_type(int etype) +{ + switch (etype) { + case 0x0001: return "hgc_dqe ecc"; + case 0x0002: return "hgc_iost ecc"; + case 0x0004: return "hgc_itct ecc"; + case 0x0008: return "hgc_iostl ecc"; + case 0x0010: return "hgc_itctl ecc"; + case 0x0020: return "hgc_cqe ecc"; + case 0x0040: return "rxm_mem0 ecc"; + case 0x0080: return "rxm_mem1 ecc"; + case 0x0100: return "rxm_mem2 ecc"; + case 0x0200: return "rxm_mem3 ecc"; + case 0x0400: return "wp_depth"; + case 0x0800: return "iptt_slot_no_match"; + case 0x1000: return "rp_depth"; + case 0x2000: return "axi err"; + case 0x4000: return "fifo err"; + case 0x8000: return "lm_add_fetch_list"; + case 0x10000: return "hgc_abt_fetch_lm"; + } + return "unknown error"; +} + +static char *sas_axi_err_type(int etype) +{ + switch (etype) { + case 0x0001: return "IOST_AXI_W_ERR"; + case 0x0002: return "IOST_AXI_R_ERR"; + case 0x0004: return "ITCT_AXI_W_ERR"; + case 0x0008: return "ITCT_AXI_R_ERR"; + case 0x0010: return "SATA_AXI_W_ERR"; + case 0x0020: return "SATA_AXI_R_ERR"; + case 0x0040: return "DQE_AXI_R_ERR"; + case 0x0080: return "CQE_AXI_W_ERR"; + case 0x0100: return "CQE_WINFO_FIFO"; + case 0x0200: return "CQE_MSG_FIFIO"; + case 0x0400: return "GETDQE_FIFO"; + case 0x0800: return "CMDP_FIFO"; + case 0x1000: return "AWTCTRL_FIFO"; + } + return "unknown error"; +} + +static int decode_hip07_sas_error(struct trace_seq *s, const void *error) +{ + char buf[1024]; + char *p = buf; + const struct hisi_sas_err_sec *err = error; + + if (err->val_bits == 0) { + trace_seq_printf(s, "%s: no valid error data\n", + __func__); + return -1; + } + p += sprintf(p, "["); + if (err->val_bits & HISI_SAS_VALID_PA) + p += sprintf(p, "phy addr = 0x%p: ", + (void *)err->physical_addr); + + if (err->val_bits & HISI_SAS_VALID_MB_ERR) + p += sprintf(p, "%s: ", err_bit_type(err->mb)); + + if (err->val_bits & HISI_SAS_VALID_ERR_TYPE) + p += sprintf(p, "error type = %s: ", + sas_err_type(err->type)); + + if (err->val_bits & HISI_SAS_VALID_AXI_ERR_INFO) + p += sprintf(p, "axi error type = %s", + sas_axi_err_type(err->axi_err_info)); + + p += sprintf(p, "]"); + + trace_seq_printf(s, "\nHISI HIP07: SAS error: %s\n", buf); + return 0; +} + +static int decode_hip07_hns_error(struct trace_seq *s, const void *error) +{ + return 0; +} +__attribute__((constructor)) +static void hip07_init(void) +{ + hisi_ns_dec_tab[0].len = ARRAY_SIZE(hisi_ns_dec_tab); + register_ns_dec_tab(hisi_ns_dec_tab); +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rasdaemon-0.5.9/ras-arm-handler.c new/rasdaemon-0.6.0/ras-arm-handler.c --- old/rasdaemon-0.5.9/ras-arm-handler.c 1970-01-01 01:00:00.000000000 +0100 +++ new/rasdaemon-0.6.0/ras-arm-handler.c 2017-10-14 11:49:59.000000000 +0200 @@ -0,0 +1,90 @@ +/* + * Copyright (c) 2016, The Linux Foundation. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 and + * only version 2 as published by the Free Software Foundation. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ + +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <unistd.h> +#include "libtrace/kbuffer.h" +#include "ras-arm-handler.h" +#include "ras-record.h" +#include "ras-logger.h" +#include "ras-report.h" + +int ras_arm_event_handler(struct trace_seq *s, + struct pevent_record *record, + struct event_format *event, void *context) +{ + unsigned long long val; + struct ras_events *ras = context; + time_t now; + struct tm *tm; + struct ras_arm_event ev; + + /* + * Newer kernels (3.10-rc1 or upper) provide an uptime clock. + * On previous kernels, the way to properly generate an event would + * be to inject a fake one, measure its timestamp and diff it against + * gettimeofday. We won't do it here. Instead, let's use uptime, + * falling-back to the event report's time, if "uptime" clock is + * not available (legacy kernels). + */ + + if (ras->use_uptime) + now = record->ts/user_hz + ras->uptime_diff; + else + now = time(NULL); + + tm = localtime(&now); + if (tm) + strftime(ev.timestamp, sizeof(ev.timestamp), + "%Y-%m-%d %H:%M:%S %z", tm); + trace_seq_printf(s, "%s\n", ev.timestamp); + + if (pevent_get_field_val(s, event, "affinity", record, &val, 1) < 0) + return -1; + ev.affinity = val; + trace_seq_printf(s, " affinity: %d", ev.affinity); + + if (pevent_get_field_val(s, event, "mpidr", record, &val, 1) < 0) + return -1; + ev.mpidr = val; + trace_seq_printf(s, "\n MPIDR: 0x%llx", (unsigned long long)ev.mpidr); + + if (pevent_get_field_val(s, event, "midr", record, &val, 1) < 0) + return -1; + ev.midr = val; + trace_seq_printf(s, "\n MIDR: 0x%llx", (unsigned long long)ev.midr); + + if (pevent_get_field_val(s, event, "running_state", record, &val, 1) < 0) + return -1; + ev.running_state = val; + trace_seq_printf(s, "\n running_state: %d", ev.running_state); + + if (pevent_get_field_val(s, event, "psci_state", record, &val, 1) < 0) + return -1; + ev.psci_state = val; + trace_seq_printf(s, "\n psci_state: %d", ev.psci_state); + + /* Insert data into the SGBD */ +#ifdef HAVE_SQLITE3 + ras_store_arm_record(ras, &ev); +#endif + +#ifdef HAVE_ABRT_REPORT + /* Report event to ABRT */ + ras_report_arm_event(ras, &ev); +#endif + + return 0; +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rasdaemon-0.5.9/ras-arm-handler.h new/rasdaemon-0.6.0/ras-arm-handler.h --- old/rasdaemon-0.5.9/ras-arm-handler.h 1970-01-01 01:00:00.000000000 +0100 +++ new/rasdaemon-0.6.0/ras-arm-handler.h 2017-10-14 11:49:59.000000000 +0200 @@ -0,0 +1,24 @@ +/* + * Copyright (c) 2016, The Linux Foundation. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 and + * only version 2 as published by the Free Software Foundation. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ + +#ifndef __RAS_ARM_HANDLER_H +#define __RAS_ARM_HANDLER_H + +#include "ras-events.h" +#include "libtrace/event-parse.h" + +int ras_arm_event_handler(struct trace_seq *s, + struct pevent_record *record, + struct event_format *event, void *context); + +#endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rasdaemon-0.5.9/ras-events.c new/rasdaemon-0.6.0/ras-events.c --- old/rasdaemon-0.5.9/ras-events.c 2017-06-08 11:49:33.000000000 +0200 +++ new/rasdaemon-0.6.0/ras-events.c 2017-10-14 11:49:59.000000000 +0200 @@ -29,6 +29,8 @@ #include "libtrace/event-parse.h" #include "ras-mc-handler.h" #include "ras-aer-handler.h" +#include "ras-non-standard-handler.h" +#include "ras-arm-handler.h" #include "ras-mce-handler.h" #include "ras-extlog-handler.h" #include "ras-record.h" @@ -208,6 +210,14 @@ rc |= __toggle_ras_mc_event(ras, "ras", "extlog_mem_event", enable); #endif +#ifdef HAVE_NON_STANDARD + rc |= __toggle_ras_mc_event(ras, "ras", "non_standard_event", enable); +#endif + +#ifdef HAVE_ARM + rc |= __toggle_ras_mc_event(ras, "ras", "arm_event", enable); +#endif + free_ras: free(ras); return rc; @@ -676,6 +686,26 @@ "ras", "aer_event"); #endif +#ifdef HAVE_NON_STANDARD + rc = add_event_handler(ras, pevent, page_size, "ras", "non_standard_event", + ras_non_standard_event_handler); + if (!rc) + num_events++; + else + log(ALL, LOG_ERR, "Can't get traces from %s:%s\n", + "ras", "non_standard_event"); +#endif + +#ifdef HAVE_ARM + rc = add_event_handler(ras, pevent, page_size, "ras", "arm_event", + ras_arm_event_handler); + if (!rc) + num_events++; + else + log(ALL, LOG_ERR, "Can't get traces from %s:%s\n", + "ras", "arm_event"); +#endif + cpus = get_num_cpus(ras); #ifdef HAVE_MCE diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rasdaemon-0.5.9/ras-events.h new/rasdaemon-0.6.0/ras-events.h --- old/rasdaemon-0.5.9/ras-events.h 2017-06-08 11:49:33.000000000 +0200 +++ new/rasdaemon-0.6.0/ras-events.h 2017-10-14 11:49:59.000000000 +0200 @@ -68,6 +68,14 @@ HW_EVENT_ERR_INFO, }; +/* Should match the code at Kernel's include/acpi/ghes.h */ +enum ghes_severity { + GHES_SEV_NO, + GHES_SEV_CORRECTED, + GHES_SEV_RECOVERABLE, + GHES_SEV_PANIC, +}; + /* Function prototypes */ int toggle_ras_mc_event(int enable); int handle_ras_events(int record_events); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rasdaemon-0.5.9/ras-non-standard-handler.c new/rasdaemon-0.6.0/ras-non-standard-handler.c --- old/rasdaemon-0.5.9/ras-non-standard-handler.c 1970-01-01 01:00:00.000000000 +0100 +++ new/rasdaemon-0.6.0/ras-non-standard-handler.c 2017-10-14 11:49:59.000000000 +0200 @@ -0,0 +1,207 @@ +/* + * Copyright (c) 2016, The Linux Foundation. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 and + * only version 2 as published by the Free Software Foundation. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ + +#include <stdio.h> +#include <stdlib.h> +#include <stdbool.h> +#include <string.h> +#include <unistd.h> +#include "libtrace/kbuffer.h" +#include "ras-non-standard-handler.h" +#include "ras-record.h" +#include "ras-logger.h" +#include "ras-report.h" + +static p_ns_dec_tab * ns_dec_tab; +static size_t dec_tab_count; + +int register_ns_dec_tab(const p_ns_dec_tab tab) +{ + ns_dec_tab = (p_ns_dec_tab *)realloc(ns_dec_tab, + (dec_tab_count + 1) * sizeof(tab)); + if (ns_dec_tab == NULL) { + printf("%s p_ns_dec_tab malloc failed", __func__); + return -1; + } + ns_dec_tab[dec_tab_count] = tab; + dec_tab_count++; + return 0; +} + +void unregister_ns_dec_tab(void) +{ + if (ns_dec_tab) { + free(ns_dec_tab); + ns_dec_tab = NULL; + dec_tab_count = 0; + } +} + +void print_le_hex(struct trace_seq *s, const uint8_t *buf, int index) { + trace_seq_printf(s, "%02x%02x%02x%02x", buf[index+3], buf[index+2], buf[index+1], buf[index]); +} + +static char *uuid_le(const char *uu) +{ + static char uuid[sizeof("xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx")]; + char *p = uuid; + int i; + 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]]); + switch (i) { + case 3: + case 5: + case 7: + case 9: + *p++ = '-'; + break; + } + } + + *p = 0; + + return uuid; +} + +static int uuid_le_cmp(const char *sec_type, const char *uuid2) +{ + static char uuid1[32]; + char *p = uuid1; + int i; + 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", sec_type[le[i]]); + *p = 0; + return strncmp(uuid1, uuid2, 32); +} + +int ras_non_standard_event_handler(struct trace_seq *s, + struct pevent_record *record, + struct event_format *event, void *context) +{ + int len, i, line_count, count; + unsigned long long val; + struct ras_events *ras = context; + time_t now; + struct tm *tm; + struct ras_non_standard_event ev; + p_ns_dec_tab dec_tab; + bool dec_done = false; + + /* + * Newer kernels (3.10-rc1 or upper) provide an uptime clock. + * On previous kernels, the way to properly generate an event would + * be to inject a fake one, measure its timestamp and diff it against + * gettimeofday. We won't do it here. Instead, let's use uptime, + * falling-back to the event report's time, if "uptime" clock is + * not available (legacy kernels). + */ + + if (ras->use_uptime) + now = record->ts/user_hz + ras->uptime_diff; + else + now = time(NULL); + + tm = localtime(&now); + if (tm) + strftime(ev.timestamp, sizeof(ev.timestamp), + "%Y-%m-%d %H:%M:%S %z", tm); + trace_seq_printf(s, "%s ", ev.timestamp); + + if (pevent_get_field_val(s, event, "sev", record, &val, 1) < 0) + return -1; + switch (val) { + case GHES_SEV_NO: + ev.severity = "Informational"; + break; + case GHES_SEV_CORRECTED: + ev.severity = "Corrected"; + break; + case GHES_SEV_RECOVERABLE: + ev.severity = "Recoverable"; + break; + default: + case GHES_SEV_PANIC: + ev.severity = "Fatal"; + } + trace_seq_printf(s, "\n %s", ev.severity); + + ev.sec_type = pevent_get_field_raw(s, event, "sec_type", record, &len, 1); + if(!ev.sec_type) + return -1; + trace_seq_printf(s, "\n section type: %s", uuid_le(ev.sec_type)); + ev.fru_text = pevent_get_field_raw(s, event, "fru_text", + record, &len, 1); + ev.fru_id = pevent_get_field_raw(s, event, "fru_id", + record, &len, 1); + trace_seq_printf(s, " fru text: %s fru id: %s ", + ev.fru_text, + uuid_le(ev.fru_id)); + + 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); + + ev.error = pevent_get_field_raw(s, event, "buf", record, &len, 1); + if(!ev.error) + return -1; + len = ev.length; + i = 0; + line_count = 0; + trace_seq_printf(s, " error:\n %08x: ", i); + while(len >= 4) { + print_le_hex(s, ev.error, i); + i+=4; + len-=4; + if(++line_count == 4) { + trace_seq_printf(s, "\n %08x: ", i); + line_count = 0; + } else + trace_seq_printf(s, " "); + } + + for (count = 0; count < dec_tab_count && !dec_done; count++) { + dec_tab = ns_dec_tab[count]; + for (i = 0; i < dec_tab[0].len; i++) { + if (uuid_le_cmp(ev.sec_type, + dec_tab[i].sec_type) == 0) { + dec_tab[i].decode(s, ev.error); + dec_done = true; + break; + } + } + } + + /* Insert data into the SGBD */ +#ifdef HAVE_SQLITE3 + ras_store_non_standard_record(ras, &ev); +#endif + +#ifdef HAVE_ABRT_REPORT + /* Report event to ABRT */ + ras_report_non_standard_event(ras, &ev); +#endif + + return 0; +} + +__attribute__((destructor)) +static void ns_exit(void) +{ + unregister_ns_dec_tab(); +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rasdaemon-0.5.9/ras-non-standard-handler.h new/rasdaemon-0.6.0/ras-non-standard-handler.h --- old/rasdaemon-0.5.9/ras-non-standard-handler.h 1970-01-01 01:00:00.000000000 +0100 +++ new/rasdaemon-0.6.0/ras-non-standard-handler.h 2017-10-14 11:49:59.000000000 +0200 @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2016, The Linux Foundation. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 and + * only version 2 as published by the Free Software Foundation. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ + +#ifndef __RAS_NON_STANDARD_HANDLER_H +#define __RAS_NON_STANDARD_HANDLER_H + +#include "ras-events.h" +#include "libtrace/event-parse.h" + +#define BIT(nr) (1UL << (nr)) +#define BIT_ULL(nr) (1ULL << (nr)) + +typedef struct ras_ns_dec_tab { + const char *sec_type; + int (*decode)(struct trace_seq *s, const void *err); + size_t len; +} *p_ns_dec_tab; + +int ras_non_standard_event_handler(struct trace_seq *s, + struct pevent_record *record, + struct event_format *event, void *context); + +void print_le_hex(struct trace_seq *s, const uint8_t *buf, int index); + +int register_ns_dec_tab(const p_ns_dec_tab tab); + +void unregister_ns_dec_tab(void); + +#endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rasdaemon-0.5.9/ras-record.c new/rasdaemon-0.6.0/ras-record.c --- old/rasdaemon-0.5.9/ras-record.c 2017-06-08 11:49:33.000000000 +0200 +++ new/rasdaemon-0.6.0/ras-record.c 2017-10-14 11:49:59.000000000 +0200 @@ -1,5 +1,6 @@ /* * Copyright (C) 2013 Mauro Carvalho Chehab <mche...@redhat.com> + * Copyright (c) 2016, The Linux Foundation. All rights reserved. * * 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 @@ -157,6 +158,109 @@ } #endif +/* + * Table and functions to handle ras:non standard + */ + +#ifdef HAVE_NON_STANDARD +static const struct db_fields non_standard_event_fields[] = { + { .name="id", .type="INTEGER PRIMARY KEY" }, + { .name="timestamp", .type="TEXT" }, + { .name="sec_type", .type="BLOB" }, + { .name="fru_id", .type="BLOB" }, + { .name="fru_text", .type="TEXT" }, + { .name="severity", .type="TEXT" }, + { .name="error", .type="BLOB" }, +}; + +static const struct db_table_descriptor non_standard_event_tab = { + .name = "non_standard_event", + .fields = non_standard_event_fields, + .num_fields = ARRAY_SIZE(non_standard_event_fields), +}; + +int ras_store_non_standard_record(struct ras_events *ras, struct ras_non_standard_event *ev) +{ + int rc; + struct sqlite3_priv *priv = ras->db_priv; + + if (!priv || !priv->stmt_non_standard_record) + return 0; + log(TERM, LOG_INFO, "non_standard_event store: %p\n", priv->stmt_non_standard_record); + + sqlite3_bind_text (priv->stmt_non_standard_record, 1, ev->timestamp, -1, NULL); + sqlite3_bind_blob (priv->stmt_non_standard_record, 2, ev->sec_type, -1, NULL); + sqlite3_bind_blob (priv->stmt_non_standard_record, 3, ev->fru_id, 16, NULL); + sqlite3_bind_text (priv->stmt_non_standard_record, 4, ev->fru_text, -1, NULL); + sqlite3_bind_text (priv->stmt_non_standard_record, 5, ev->severity, -1, NULL); + sqlite3_bind_blob (priv->stmt_non_standard_record, 6, ev->error, ev->length, NULL); + + rc = sqlite3_step(priv->stmt_non_standard_record); + if (rc != SQLITE_OK && rc != SQLITE_DONE) + log(TERM, LOG_ERR, + "Failed to do non_standard_event step on sqlite: error = %d\n", rc); + rc = sqlite3_reset(priv->stmt_non_standard_record); + if (rc != SQLITE_OK && rc != SQLITE_DONE) + log(TERM, LOG_ERR, + "Failed reset non_standard_event on sqlite: error = %d\n", rc); + log(TERM, LOG_INFO, "register inserted at db\n"); + + return rc; +} +#endif + +/* + * Table and functions to handle ras:arm + */ + +#ifdef HAVE_ARM +static const struct db_fields arm_event_fields[] = { + { .name="id", .type="INTEGER PRIMARY KEY" }, + { .name="timestamp", .type="TEXT" }, + { .name="error_count", .type="INTEGER" }, + { .name="affinity", .type="INTEGER" }, + { .name="mpidr", .type="INTEGER" }, + { .name="running_state", .type="INTEGER" }, + { .name="psci_state", .type="INTEGER" }, +}; + +static const struct db_table_descriptor arm_event_tab = { + .name = "arm_event", + .fields = arm_event_fields, + .num_fields = ARRAY_SIZE(arm_event_fields), +}; + +int ras_store_arm_record(struct ras_events *ras, struct ras_arm_event *ev) +{ + int rc; + struct sqlite3_priv *priv = ras->db_priv; + + if (!priv || !priv->stmt_arm_record) + return 0; + log(TERM, LOG_INFO, "arm_event store: %p\n", priv->stmt_arm_record); + + sqlite3_bind_text (priv->stmt_arm_record, 1, ev->timestamp, -1, NULL); + sqlite3_bind_int (priv->stmt_arm_record, 2, ev->error_count); + sqlite3_bind_int (priv->stmt_arm_record, 3, ev->affinity); + sqlite3_bind_int (priv->stmt_arm_record, 4, ev->mpidr); + sqlite3_bind_int (priv->stmt_arm_record, 5, ev->running_state); + sqlite3_bind_int (priv->stmt_arm_record, 6, ev->psci_state); + + rc = sqlite3_step(priv->stmt_arm_record); + if (rc != SQLITE_OK && rc != SQLITE_DONE) + log(TERM, LOG_ERR, + "Failed to do arm_event step on sqlite: error = %d\n", rc); + rc = sqlite3_reset(priv->stmt_arm_record); + if (rc != SQLITE_OK && rc != SQLITE_DONE) + log(TERM, LOG_ERR, + "Failed reset arm_event on sqlite: error = %d\n", + rc); + log(TERM, LOG_INFO, "register inserted at db\n"); + + return rc; +} +#endif + #ifdef HAVE_EXTLOG static const struct db_fields extlog_event_fields[] = { { .name="id", .type="INTEGER PRIMARY KEY" }, @@ -450,6 +554,20 @@ &mce_record_tab); #endif +#ifdef HAVE_NON_STANDARD + rc = ras_mc_create_table(priv, &non_standard_event_tab); + if (rc == SQLITE_OK) + rc = ras_mc_prepare_stmt(priv, &priv->stmt_non_standard_record, + &non_standard_event_tab); +#endif + +#ifdef HAVE_ARM + rc = ras_mc_create_table(priv, &arm_event_tab); + if (rc == SQLITE_OK) + rc = ras_mc_prepare_stmt(priv, &priv->stmt_arm_record, + &arm_event_tab); +#endif + ras->db_priv = priv; return 0; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rasdaemon-0.5.9/ras-record.h new/rasdaemon-0.6.0/ras-record.h --- old/rasdaemon-0.5.9/ras-record.h 2017-06-08 11:49:33.000000000 +0200 +++ new/rasdaemon-0.6.0/ras-record.h 2017-10-14 11:49:59.000000000 +0200 @@ -1,5 +1,6 @@ /* * Copyright (C) 2013 Mauro Carvalho Chehab <mche...@redhat.com> + * Copyright (c) 2016, The Linux Foundation. All rights reserved. * * 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 @@ -56,9 +57,29 @@ unsigned short cper_data_length; }; +struct ras_non_standard_event { + char timestamp[64]; + const char *sec_type, *fru_id, *fru_text; + const char *severity; + const uint8_t *error; + uint32_t length; +}; + +struct ras_arm_event { + char timestamp[64]; + int32_t error_count; + int8_t affinity; + int64_t mpidr; + int64_t midr; + int32_t running_state; + int32_t psci_state; +}; + struct ras_mc_event; struct ras_aer_event; struct ras_extlog_event; +struct ras_non_standard_event; +struct ras_arm_event; struct mce_event; #ifdef HAVE_SQLITE3 @@ -77,6 +98,12 @@ #ifdef HAVE_EXTLOG sqlite3_stmt *stmt_extlog_record; #endif +#ifdef HAVE_NON_STANDARD + sqlite3_stmt *stmt_non_standard_record; +#endif +#ifdef HAVE_ARM + sqlite3_stmt *stmt_arm_record; +#endif }; int ras_mc_event_opendb(unsigned cpu, struct ras_events *ras); @@ -84,6 +111,8 @@ int ras_store_aer_event(struct ras_events *ras, struct ras_aer_event *ev); int ras_store_mce_record(struct ras_events *ras, struct mce_event *ev); int ras_store_extlog_mem_record(struct ras_events *ras, struct ras_extlog_event *ev); +int ras_store_non_standard_record(struct ras_events *ras, struct ras_non_standard_event *ev); +int ras_store_arm_record(struct ras_events *ras, struct ras_arm_event *ev); #else static inline int ras_mc_event_opendb(unsigned cpu, struct ras_events *ras) { return 0; }; @@ -91,6 +120,8 @@ static inline int ras_store_aer_event(struct ras_events *ras, struct ras_aer_event *ev) { return 0; }; static inline int ras_store_mce_record(struct ras_events *ras, struct mce_event *ev) { return 0; }; static inline int ras_store_extlog_mem_record(struct ras_events *ras, struct ras_extlog_event *ev) { return 0; }; +static inline int ras_store_non_standard_record(struct ras_events *ras, struct ras_non_standard_event *ev) { return 0; }; +static inline int ras_store_arm_record(struct ras_events *ras, struct ras_arm_event *ev) { return 0; }; #endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rasdaemon-0.5.9/ras-report.c new/rasdaemon-0.6.0/ras-report.c --- old/rasdaemon-0.5.9/ras-report.c 2017-06-08 11:49:33.000000000 +0200 +++ new/rasdaemon-0.6.0/ras-report.c 2017-10-14 11:49:59.000000000 +0200 @@ -1,3 +1,16 @@ +/* + * Copyright (c) 2016, The Linux Foundation. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 and + * only version 2 as published by the Free Software Foundation. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ + #include <stdio.h> #include <string.h> #include <unistd.h> @@ -196,6 +209,52 @@ return 0; } +static int set_non_standard_event_backtrace(char *buf, struct ras_non_standard_event *ev){ + char bt_buf[MAX_BACKTRACE_SIZE]; + + if(!buf || !ev) + return -1; + + sprintf(bt_buf, "BACKTRACE=" \ + "timestamp=%s\n" \ + "severity=%s\n" \ + "length=%d\n", \ + ev->timestamp, \ + ev->severity, \ + ev->length); + + strcat(buf, bt_buf); + + return 0; +} + +static int set_arm_event_backtrace(char *buf, struct ras_arm_event *ev){ + char bt_buf[MAX_BACKTRACE_SIZE]; + + if(!buf || !ev) + return -1; + + sprintf(bt_buf, "BACKTRACE=" \ + "timestamp=%s\n" \ + "error_count=%d\n" \ + "affinity=%d\n" \ + "mpidr=0x%lx\n" \ + "midr=0x%lx\n" \ + "running_state=%d\n" \ + "psci_state=%d\n", \ + ev->timestamp, \ + ev->error_count, \ + ev->affinity, \ + ev->mpidr, \ + ev->midr, \ + ev->running_state, \ + ev->psci_state); + + strcat(buf, bt_buf); + + return 0; +} + static int commit_report_backtrace(int sockfd, int type, void *ev){ char buf[MAX_BACKTRACE_SIZE]; char *pbuf = buf; @@ -218,6 +277,12 @@ case MCE_EVENT: rc = set_mce_event_backtrace(buf, (struct mce_event *)ev); break; + case NON_STANDARD_EVENT: + rc = set_non_standard_event_backtrace(buf, (struct ras_non_standard_event *)ev); + break; + case ARM_EVENT: + rc = set_arm_event_backtrace(buf, (struct ras_arm_event *)ev); + break; default: return -1; } @@ -345,6 +410,96 @@ } } +int ras_report_non_standard_event(struct ras_events *ras, struct ras_non_standard_event *ev){ + char buf[MAX_MESSAGE_SIZE]; + int sockfd = 0; + int rc = -1; + + memset(buf, 0, sizeof(buf)); + + sockfd = setup_report_socket(); + if(sockfd < 0){ + return rc; + } + + rc = commit_report_basic(sockfd); + if(rc < 0){ + goto non_standard_fail; + } + + rc = commit_report_backtrace(sockfd, NON_STANDARD_EVENT, ev); + if(rc < 0){ + goto non_standard_fail; + } + + sprintf(buf, "ANALYZER=%s", "rasdaemon-non-standard"); + rc = write(sockfd, buf, strlen(buf) + 1); + if(rc < strlen(buf) + 1){ + goto non_standard_fail; + } + + sprintf(buf, "REASON=%s", "Unknown CPER section problem"); + rc = write(sockfd, buf, strlen(buf) + 1); + if(rc < strlen(buf) + 1){ + goto non_standard_fail; + } + + rc = 0; + +non_standard_fail: + + if(sockfd > 0){ + close(sockfd); + } + + return rc; +} + +int ras_report_arm_event(struct ras_events *ras, struct ras_arm_event *ev){ + char buf[MAX_MESSAGE_SIZE]; + int sockfd = 0; + int rc = -1; + + memset(buf, 0, sizeof(buf)); + + sockfd = setup_report_socket(); + if(sockfd < 0){ + return rc; + } + + rc = commit_report_basic(sockfd); + if(rc < 0){ + goto arm_fail; + } + + rc = commit_report_backtrace(sockfd, ARM_EVENT, ev); + if(rc < 0){ + goto arm_fail; + } + + sprintf(buf, "ANALYZER=%s", "rasdaemon-arm"); + rc = write(sockfd, buf, strlen(buf) + 1); + if(rc < strlen(buf) + 1){ + goto arm_fail; + } + + sprintf(buf, "REASON=%s", "ARM CPU report problem"); + rc = write(sockfd, buf, strlen(buf) + 1); + if(rc < strlen(buf) + 1){ + goto arm_fail; + } + + rc = 0; + +arm_fail: + + if(sockfd > 0){ + close(sockfd); + } + + return rc; +} + int ras_report_mce_event(struct ras_events *ras, struct mce_event *ev){ char buf[MAX_MESSAGE_SIZE]; int sockfd = 0; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rasdaemon-0.5.9/ras-report.h new/rasdaemon-0.6.0/ras-report.h --- old/rasdaemon-0.5.9/ras-report.h 2017-06-08 11:49:33.000000000 +0200 +++ new/rasdaemon-0.6.0/ras-report.h 2017-10-14 11:49:59.000000000 +0200 @@ -1,3 +1,16 @@ +/* + * Copyright (c) 2016, The Linux Foundation. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 and + * only version 2 as published by the Free Software Foundation. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ + #ifndef __RAS_REPORT_H #define __RAS_REPORT_H @@ -19,7 +32,9 @@ enum { MC_EVENT, MCE_EVENT, - AER_EVENT + AER_EVENT, + NON_STANDARD_EVENT, + ARM_EVENT }; #ifdef HAVE_ABRT_REPORT @@ -27,12 +42,16 @@ int ras_report_mc_event(struct ras_events *ras, struct ras_mc_event *ev); int ras_report_aer_event(struct ras_events *ras, struct ras_aer_event *ev); int ras_report_mce_event(struct ras_events *ras, struct mce_event *ev); +int ras_report_non_standard_event(struct ras_events *ras, struct ras_non_standard_event *ev); +int ras_report_arm_event(struct ras_events *ras, struct ras_arm_event *ev); #else static inline int ras_report_mc_event(struct ras_events *ras, struct ras_mc_event *ev) { return 0; }; static inline int ras_report_aer_event(struct ras_events *ras, struct ras_aer_event *ev) { return 0; }; static inline int ras_report_mce_event(struct ras_events *ras, struct mce_event *ev) { return 0; }; +static inline int ras_report_non_standard_event(struct ras_events *ras, struct ras_non_standard_event *ev) { return 0; }; +static inline int ras_report_arm_event(struct ras_events *ras, struct ras_arm_event *ev) { return 0; }; #endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rasdaemon-0.5.9/rasdaemon.c new/rasdaemon-0.6.0/rasdaemon.c --- old/rasdaemon-0.5.9/rasdaemon.c 2017-06-08 11:49:33.000000000 +0200 +++ new/rasdaemon-0.6.0/rasdaemon.c 2017-10-14 11:49:59.000000000 +0200 @@ -35,7 +35,7 @@ #define ARGS_DOC "<options>" const char *argp_program_version = TOOL_NAME " " VERSION; -const char *argp_program_bug_address = "Mauro Carvalho Chehab <mche...@redhat.com>"; +const char *argp_program_bug_address = "Mauro Carvalho Chehab <mche...@kernel.org>"; struct arguments { int record_events;