CCIX rasdaemon support
cover CCIX rasdaemon support
This is an RFC because the kernel side is currently under review and may change with obvious follow through effects on this.
https://lore.kernel.org/linux-edac/[email protected]/
There are a few additional questions around this:
1. Divide between specifity of DB fields vs blobs.
Where possible I have tried to fully describe the contents via separate fields rather than large blobs. One common SQL convention that doesn't seem to have been previously done in rasdaemon is to use explicit NULL entries for elements where data is missing.
2. Should we split ras-record.c and have the ccix handling in a separate ras-record-ccix.c file or similar as that one is getting rather large.
Note the following is a trademark grant and doesn't prevent normal stuff covered under fair use. Given this doesn't current quote from the spec, there are no such copyright notices.
This patch is being distributed by the CCIX Consortium, Inc. (CCIX) to you and other parties that are paticipating (the "participants") in rasdemon project with the understanding that the participants will use CCIX's name and trademark only when this patch is used in association with rasdaemon.
CCIX is also distributing this patch to these participants with the understanding that if any portion of the CCIX specification will be used or referenced in rasdaemon, the participants will not modify the cited portion of the CCIX specification and will give CCIX propery copyright attribution by including the following copyright notice with the cited part of the CCIX specification:
"© 2019 CCIX CONSORTIUM, INC. ALL RIGHTS RESERVED."
Jonathan Cameron (6):
rasdaemon: CCIX: CCIX memory error reporting.
rasdaemon: CCIX: Cache error support
rasdaemon: CCIX: ATC errors
rasdaemon: CCIX: Port error handling
rasdaemon: CCIX: Link error support
rasdaemon: CCIX: Agent Internal error support
Makefile.am | 6 +- configure.ac | 10 + ras-ccix-handler.c | 648 +++++++++++++++++++++++++++++++++++++++++++++ ras-ccix-handler.h | 139 ++++++++++ ras-events.c | 61 +++++ ras-record.c | 568 +++++++++++++++++++++++++++++++++++++++ ras-record.h | 35 +++ ras-report.h | 6 +- 8 files changed, 1471 insertions(+), 2 deletions(-) create mode 100644 ras-ccix-handler.c create mode 100644 ras-ccix-handler.h
Signature · 1 line
2.20.1
RFC PATCH 1/6 rasdaemon: CCIX: CCIX memory error reporting.
Adds support for basic decoding and logging of ccix memory errors
+ storing to sqlite3 DB.
Given that the CCIX memory record is very tightly defined by the specification and that databases with large blobs in them are not particularly useful, I have separately exposed all of the standard fields. Note that this means setting them NULL if the validation bits indicate that the field is not valid.
--- Makefile.am | 6 +- configure.ac | 10 ++ ras-ccix-handler.c | 244 +++++++++++++++++++++++++++++++++++++++++++++ ras-ccix-handler.h | 61 ++++++++++++ ras-events.c | 16 +++ ras-record.c | 176 ++++++++++++++++++++++++++++++++ ras-record.h | 20 ++++ ras-report.h | 6 +- 8 files changed, 537 insertions(+), 2 deletions(-)
Makefile.am +5 -1
@@ -24,6 +24,9 @@ endif if WITH_AER rasdaemon_SOURCES += ras-aer-handler.c endif +if WITH_CCIX + rasdaemon_SOURCES += ras-ccix-handler.c +endif if WITH_NON_STANDARD rasdaemon_SOURCES += ras-non-standard-handler.c endif
@@ -51,7 +54,8 @@ 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-extlog-handler.h ras-arm-handler.h ras-non-standard-handler.h \ + ras-ccix-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
configure.ac +10 -0
@@ -44,6 +44,15 @@ AS_IF([test "x$enable_aer" = "xyes"], [ ]) AM_CONDITIONAL([WITH_AER], [test x$enable_aer = xyes]) +AC_ARG_ENABLE([ccix], + AS_HELP_STRING([--enable-ccix], [enable CCIX PER events (currently experimental)])) + +AS_IF([test "x$enable_ccix" = "xyes"], [ + AC_DEFINE(HAVE_CCIX,1,"have CCIX PER events collect") + AC_SUBST([WITH_CCIX]) +]) +AM_CONDITIONAL([WITH_CCIX], [test x$enable_ccix = xyes]) + AC_ARG_ENABLE([non_standard], AS_HELP_STRING([--enable-non-standard], [enable NON_STANDARD events (currently experimental)]))
@@ -127,4 +136,5 @@ compile time options summary ABRT report : $enable_abrt_report HIP07 SAS HW errors : $enable_hisi_ns_decode ARM events : $enable_arm + CCIX : $enable_ccix EOF
ras-ccix-handler.c new file +244 -0
244 lines not on this page · raw message
ras-ccix-handler.h new file +61 -0
61 lines not on this page · raw message
ras-events.c +16 -0
@@ -29,6 +29,7 @@#include "libtrace/event-parse.h" #include "ras-mc-handler.h" #include "ras-aer-handler.h" +#include "ras-ccix-handler.h" #include "ras-non-standard-handler.h" #include "ras-arm-handler.h" #include "ras-mce-handler.h"
@@ -202,6 +203,10 @@ int toggle_ras_mc_event(int enable) rc |=__toggle_ras_mc_event (ras,"ras" ,"aer_event" , enable);#endif +#ifdef HAVE_CCIX + rc |=__toggle_ras_mc_event (ras,"ras" ,"ccix_memory_event" , enable); +#endif +#ifdef HAVE_MCE rc |=__toggle_ras_mc_event (ras,"mce" ,"mce_record" , enable);#endif
@@ -686,6 +691,17 @@ int handle_ras_events(int record_events) "ras", "aer_event");#endif +#ifdef HAVE_CCIX + rc =add_event_handler (ras, pevent, page_size,"ras" , +"ccix_memory_error_event" , + ras_ccix_memory_event_handler); +if (!rc) + num_events++; +else +log (ALL ,LOG_ERR ,"Can't get traces from %s:%s\n" , +"ras" ,"ccix_memory_event" ); +#endif +#ifdef HAVE_NON_STANDARD rc =add_event_handler (ras, pevent, page_size,"ras" ,"non_standard_event" , ras_non_standard_event_handler);
ras-record.c +176 -0
194 lines not on this page · raw message
ras-record.h +20 -0
@@ -44,6 +44,21 @@ struct ras_aer_event {const char *msg; }; +struct ras_ccix_event { +char timestamp[64 ]; +int32_t error_seq; +int8_t severity; +int8_t severity_detail; +unsigned long long address; +int8_t pa_mask_lsb; +uint8_t source; +uint8_t component; +const char *cper_data; +unsigned short cper_data_length; +uint16_t vendor_data_length; +const char *vendor_data; +}; +struct ras_extlog_event {char timestamp[64 ];int32_t error_seq;
@@ -98,6 +113,9 @@ struct sqlite3_priv {#ifdef HAVE_EXTLOG sqlite3_stmt *stmt_extlog_record;#endif +#ifdef HAVE_CCIX +sqlite3_stmt *stmt_ccix_mem_record; +#endif #ifdef HAVE_NON_STANDARD sqlite3_stmt *stmt_non_standard_record;#endif
@@ -111,6 +129,7 @@ int ras_store_mc_event(struct ras_events *ras, struct ras_mc_event *ev);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_ccix_memory_event (struct ras_events *ras,struct ras_ccix_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);
@@ -120,6 +139,7 @@ static inline int ras_store_mc_event(struct ras_events *ras, struct ras_mc_eventstatic 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_ccix_memory_event (struct ras_events *ras,struct ras_ccix_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 ; };
ras-report.h +5 -1
@@ -19,6 +19,7 @@#include "ras-mc-handler.h" #include "ras-mce-handler.h" #include "ras-aer-handler.h" +#include "ras-ccix-handler.h" /* Maximal length of backtrace. */ #define MAX_BACKTRACE_SIZE (1024*1024)
@@ -34,7 +35,8 @@ enum {MCE_EVENT ,AER_EVENT ,NON_STANDARD_EVENT , - ARM_EVENT +ARM_EVENT , + CCIX_EVENT, };#ifdef HAVE_ABRT_REPORT
@@ -44,6 +46,7 @@ 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); +int ras_report_ccix_event (struct ras_events *ras,struct ras_ccix_event *ev);#else
@@ -52,6 +55,7 @@ static inline int ras_report_aer_event(struct ras_events *ras, struct ras_aer_evstatic 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 ; }; +static inline int ras_report_ccix_event (struct ras_events *ras,struct ras_ccix_event *ev) {return 0 ; };#endif
Signature · 1 line
2.20.1
RFC PATCH 2/6 rasdaemon: CCIX: Cache error support
In reply to Jonathan CameronAdds the support of CCIX cache error reporting and logging to sqlite3.
--- ras-ccix-handler.c | 114 +++++++++++++++++++++++++++++++++++++++++++++ ras-ccix-handler.h | 24 ++++++++++ ras-events.c | 9 ++++ ras-record.c | 100 +++++++++++++++++++++++++++++++++++++++ ras-record.h | 3 ++ 5 files changed, 250 insertions(+)
ras-ccix-handler.c +114 -0
@@ -127,6 +127,79 @@ static char *ccix_mem_err_cper_data(const char *c)return buf; } +static char *ccix_cache_type (uint8_t type) +{ +switch (type) { +case 0 :return "instruction" ; +case 1 :return "data" ; +case 2 :return "generic/unified" ; +case 3 :return "snoop filter directory" ; + } +return "unknown" ; +} + +static char *ccix_cache_err_type (int etype) +{ +switch (etype) { +case 0 :return "data" ; +case 1 :return "tag" ; +case 2 :return "timeout" ; +case 3 :return "hang" ; +case 4 :return "data loss" ; +case 5 :return "invalid address" ; + } +return "unknown-type" ; +} + +static char *ccix_cache_op (uint8_t op) +{ +switch (op) { +case 0 :return "generic" ; +case 1 :return "generic read" ; +case 2 :return "generic write" ; +case 3 :return "data read" ; +case 4 :return "data write" ; +case 5 :return "instruction fetch" ; +case 6 :return "prefetch" ; +case 7 :return "eviction" ; +case 8 :return "snooping" ; +case 9 :return "snooped" ; +case 10 :return "management/command" ; + } +return "unknown" ; +} + +static char *ccix_cache_err_cper_data (const char *c) +{ +const struct cper_ccix_cache_err_compact *cpd = + (struct cper_ccix_cache_err_compact *)c; +static char buf[1024 ]; +char *p = buf; + +if (!(cpd->validation_bits)) +return "" ; + + p +=sprintf (p," (" ); +if (cpd->validation_bits &CCIX_CACHE_ERR_CACHE_ERR_TYPE_VALID ) + p +=sprintf (p,"error: %s " , +ccix_cache_err_type (cpd->cache_error_type)); +if (cpd->validation_bits &CCIX_CACHE_ERR_TYPE_VALID ) + p +=sprintf (p,"type: %s " ,ccix_cache_type (cpd->cache_type)); +if (cpd->validation_bits &CCIX_CACHE_ERR_OP_VALID ) + p +=sprintf (p,"op: %s " ,ccix_cache_op (cpd->op_type)); +if (cpd->validation_bits &CCIX_CACHE_ERR_LEVEL_VALID ) + p +=sprintf (p,"level: %u " , cpd->cache_level); +if (cpd->validation_bits &CCIX_CACHE_ERR_SET_VALID ) + p +=sprintf (p,"set: %u " , cpd->set); +if (cpd->validation_bits &CCIX_CACHE_ERR_WAY_VALID ) + p +=sprintf (p,"way: %u " , cpd->way); +if (cpd->validation_bits &CCIX_CACHE_ERR_INSTANCE_ID_VALID ) + p +=sprintf (p,"instance: %u " , cpd->instance); + p +=sprintf (p -1 ,")" ); + +return buf; +} +static char *ccix_component_type (int type) {switch (type) {
@@ -242,3 +315,44 @@ int ras_ccix_memory_event_handler(struct trace_seq *s,return 0 ; } + +int ras_ccix_cache_event_handler (struct trace_seq *s, +struct pevent_record *record, +struct event_format *event,void *context) +{ +struct ras_events *ras = context; +struct tm *tm; +struct ras_ccix_event ev; +time_t now; +int ret; + +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); + ret =ras_ccix_common_parse (s, record, event, context, &ev); +if (ret) +return ret; + +trace_seq_printf (s,"%d %s id:%d CCIX cache error %s ue:%d nocomm:%d degraded:%d deferred:%d physical addr: 0x%llx mask: 0x%llx %s" , + ev.error_seq,err_severity (ev.severity), + ev.source,ccix_component_type (ev.component), + (ev.severity_detail &0x1 ) ?1 :0 , + (ev.severity_detail &0x2 ) ?1 :0 , + (ev.severity_detail &0x4 ) ?1 :0 , + (ev.severity_detail &0x8 ) ?1 :0 , + ev.address, +err_mask (ev.pa_mask_lsb), +ccix_cache_err_cper_data (ev.cper_data)); + +ras_store_ccix_cache_event (ras, &ev); + +return 0 ; +}
ras-ccix-handler.h +24 -0
@@ -21,6 +21,9 @@int ras_ccix_memory_event_handler (struct trace_seq *s,struct pevent_record *record,struct event_format *event,void *context); +int ras_ccix_cache_event_handler (struct trace_seq *s, +struct pevent_record *record, +struct event_format *event,void *context);/* Perhaps unnecessary paranoia, but the tracepoint structure is packed */ #pragma pack(1)
@@ -41,6 +44,18 @@ struct cper_ccix_mem_err_compact {uint8_t chip_id;uint8_t fru; }; + +struct cper_ccix_cache_err_compact { +uint32_t validation_bits; +uint32_t set; +uint32_t way; +uint8_t cache_type; +uint8_t op_type; +uint8_t cache_error_type; +uint8_t cache_level; +uint8_t instance; +}; +#pragma pack()#define CCIX_MEM_ERR_GENERIC_MEM_VALID 0x0001
@@ -58,4 +73,13 @@ struct cper_ccix_mem_err_compact {#define CCIX_MEM_ERR_MOD_VALID 0x1000#define CCIX_MEM_ERR_SPEC_TYPE_VALID 0x2000 +#define CCIX_CACHE_ERR_TYPE_VALID 0x0001 +#define CCIX_CACHE_ERR_OP_VALID 0x0002 +#define CCIX_CACHE_ERR_CACHE_ERR_TYPE_VALID 0x0004 +#define CCIX_CACHE_ERR_LEVEL_VALID 0x0008 +#define CCIX_CACHE_ERR_SET_VALID 0x0010 +#define CCIX_CACHE_ERR_WAY_VALID 0x0020 +#define CCIX_CACHE_ERR_INSTANCE_ID_VALID 0x0040 +#define CCIX_CACHE_ERR_VENDOR_DATA_VALID 0x0080 +#endif
ras-events.c +9 -0
@@ -205,6 +205,7 @@ int toggle_ras_mc_event(int enable)#ifdef HAVE_CCIX rc |=__toggle_ras_mc_event (ras,"ras" ,"ccix_memory_event" , enable); + rc |=__toggle_ras_mc_event (ras,"ras" ,"ccix_cache_event" , enable);#endif #ifdef HAVE_MCE
@@ -700,6 +701,14 @@ int handle_ras_events(int record_events) else log(ALL, LOG_ERR, "Can't get traces from %s:%s\n", "ras", "ccix_memory_event"); + rc =add_event_handler (ras, pevent, page_size,"ras" , +"ccix_cache_error_event" , + ras_ccix_cache_event_handler); +if (!rc) + num_events++; +else +log (ALL ,LOG_ERR ,"Can't get traces from %s:%s\n" , +"ras" ,"ccix_cache_event" );#endif #ifdef HAVE_NON_STANDARD
ras-record.c +100 -0
112 lines not on this page · raw message
ras-record.h +3 -0
@@ -115,6 +115,7 @@ struct sqlite3_priv {#endif #ifdef HAVE_CCIX sqlite3_stmt *stmt_ccix_mem_record; +sqlite3_stmt *stmt_ccix_cache_record;#endif #ifdef HAVE_NON_STANDARD sqlite3_stmt *stmt_non_standard_record;
@@ -130,6 +131,7 @@ 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_ccix_memory_event (struct ras_events *ras,struct ras_ccix_event *ev); +int ras_store_ccix_cache_event (struct ras_events *ras,struct ras_ccix_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);
@@ -140,6 +142,7 @@ static inline int ras_store_aer_event(struct ras_events *ras, struct ras_aer_evestatic 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_ccix_memory_event (struct ras_events *ras,struct ras_ccix_event *ev) {return 0 ; }; +static inline int ras_store_ccix_cache_event (struct ras_events *ras,struct ras_ccix_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 ; };
Signature · 1 line
2.20.1
RFC PATCH 3/6 rasdaemon: CCIX: ATC errors
In reply to Jonathan CameronAdds support for CCIX address translation cache (ATC) errors.
--- ras-ccix-handler.c | 61 ++++++++++++++++++++++++++++++++++++++++ ras-ccix-handler.h | 13 +++++++++ ras-events.c | 9 ++++++ ras-record.c | 69 ++++++++++++++++++++++++++++++++++++++++++++++ ras-record.h | 3 ++ 5 files changed, 155 insertions(+)
ras-ccix-handler.c +61 -0
@@ -200,6 +200,26 @@ static char *ccix_cache_err_cper_data(const char *c)return buf; } +static char *ccix_atc_err_cper_data (const char *c) +{ +const struct cper_ccix_atc_err_compact *cpd = + (struct cper_ccix_atc_err_compact *)c; +static char buf[1024 ]; +char *p = buf; + +if (!cpd->validation_bits) +return "" ; + + p +=sprintf (p," (" ); +if (cpd->validation_bits &CCIX_ATC_ERR_OP_VALID ) + p +=sprintf (p,"op: %s " ,ccix_cache_op (cpd->op_type)); +if (cpd->validation_bits &CCIX_ATC_ERR_INSTANCE_ID_VALID ) + p +=sprintf (p,"instance: %u " , cpd->instance); + p +=sprintf (p -1 ,")" ); + +return buf; +} +static char *ccix_component_type (int type) {switch (type) {
@@ -356,3 +376,44 @@ int ras_ccix_cache_event_handler(struct trace_seq *s,return 0 ; } + +int ras_ccix_atc_event_handler (struct trace_seq *s, +struct pevent_record *record, +struct event_format *event,void *context) +{ +struct ras_events *ras = context; +struct tm *tm; +struct ras_ccix_event ev; +time_t now; +int ret; + +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); + ret =ras_ccix_common_parse (s, record, event, context, &ev); +if (ret) +return ret; + +trace_seq_printf (s,"%d %s id:%d CCIX ATC error: %s ue:%d nocomm:%d degraded:%d deferred:%d physical addr: 0x%llx mask: 0x%llx %s" , + ev.error_seq,err_severity (ev.severity), + ev.source,ccix_component_type (ev.component), + (ev.severity_detail &0x1 ) ?1 :0 , + (ev.severity_detail &0x2 ) ?1 :0 , + (ev.severity_detail &0x4 ) ?1 :0 , + (ev.severity_detail &0x8 ) ?1 :0 , + ev.address, +err_mask (ev.pa_mask_lsb), +ccix_atc_err_cper_data (ev.cper_data)); + +ras_store_ccix_atc_event (ras, &ev); + +return 0 ; +}
ras-ccix-handler.h +13 -0
@@ -24,6 +24,9 @@ int ras_ccix_memory_event_handler(struct trace_seq *s,int ras_ccix_cache_event_handler (struct trace_seq *s,struct pevent_record *record,struct event_format *event,void *context); +int ras_ccix_atc_event_handler (struct trace_seq *s, +struct pevent_record *record, +struct event_format *event,void *context);/* Perhaps unnecessary paranoia, but the tracepoint structure is packed */ #pragma pack(1)
@@ -56,6 +59,12 @@ struct cper_ccix_cache_err_compact {uint8_t instance; }; +struct cper_ccix_atc_err_compact { +uint32_t validation_bits; +uint8_t op_type; +uint8_t instance; +}; +#pragma pack()#define CCIX_MEM_ERR_GENERIC_MEM_VALID 0x0001
@@ -82,4 +91,8 @@ struct cper_ccix_cache_err_compact {#define CCIX_CACHE_ERR_INSTANCE_ID_VALID 0x0040#define CCIX_CACHE_ERR_VENDOR_DATA_VALID 0x0080 +#define CCIX_ATC_ERR_OP_VALID 0x0001 +#define CCIX_ATC_ERR_INSTANCE_ID_VALID 0x0002 +#define CCIX_ATC_ERR_VENDOR_DATA_VALID 0x0004 +#endif
ras-events.c +9 -0
@@ -206,6 +206,7 @@ int toggle_ras_mc_event(int enable)#ifdef HAVE_CCIX rc |=__toggle_ras_mc_event (ras,"ras" ,"ccix_memory_event" , enable); rc |=__toggle_ras_mc_event (ras,"ras" ,"ccix_cache_event" , enable); + rc |=__toggle_ras_mc_event (ras,"ras" ,"ccix_atc_event" , enable);#endif #ifdef HAVE_MCE
@@ -709,6 +710,14 @@ int handle_ras_events(int record_events) else log(ALL, LOG_ERR, "Can't get traces from %s:%s\n", "ras", "ccix_cache_event"); + rc =add_event_handler (ras, pevent, page_size,"ras" , +"ccix_atc_error_event" , + ras_ccix_atc_event_handler); +if (!rc) + num_events++; +else +log (ALL ,LOG_ERR ,"Can't get traces from %s:%s\n" , +"ras" ,"ccix_atc_event" );#endif #ifdef HAVE_NON_STANDARD
ras-record.c +69 -0
81 lines not on this page · raw message
ras-record.h +3 -0
@@ -116,6 +116,7 @@ struct sqlite3_priv {#ifdef HAVE_CCIX sqlite3_stmt *stmt_ccix_mem_record;sqlite3_stmt *stmt_ccix_cache_record; +sqlite3_stmt *stmt_ccix_atc_record;#endif #ifdef HAVE_NON_STANDARD sqlite3_stmt *stmt_non_standard_record;
@@ -132,6 +133,7 @@ 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_ccix_memory_event (struct ras_events *ras,struct ras_ccix_event *ev);int ras_store_ccix_cache_event (struct ras_events *ras,struct ras_ccix_event *ev); +int ras_store_ccix_atc_event (struct ras_events *ras,struct ras_ccix_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);
@@ -143,6 +145,7 @@ static inline int ras_store_mce_record(struct ras_events *ras, struct mce_eventstatic inline int ras_store_extlog_mem_record (struct ras_events *ras,struct ras_extlog_event *ev) {return 0 ; };static inline int ras_store_ccix_memory_event (struct ras_events *ras,struct ras_ccix_event *ev) {return 0 ; };static inline int ras_store_ccix_cache_event (struct ras_events *ras,struct ras_ccix_event *ev) {return 0 ; }; +static inline int ras_store_ccix_atc_event (struct ras_events *ras,struct ras_ccix_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 ; };
Signature · 1 line
2.20.1
RFC PATCH 6/6 rasdaemon: CCIX: Agent Internal error support
In reply to Jonathan CameronAdd support for reporting and stroing to sqlite3 of CCIX Agent Interal errors.
In the current 1.0 CCIX specification these only have vendor_data defined. However, they are structured to allow additional fields in future so we handle them the same way as all the other CCIX error types.
--- ras-ccix-handler.c | 40 ++++++++++++++++++++++++++++++ ras-ccix-handler.h | 8 ++++++ ras-events.c | 9 +++++++ ras-record.c | 61 ++++++++++++++++++++++++++++++++++++++++++++++ ras-record.h | 3 +++ 5 files changed, 121 insertions(+)
ras-ccix-handler.c +40 -0
@@ -606,3 +606,43 @@ int ras_ccix_link_event_handler(struct trace_seq *s,return 0 ; } + +int ras_ccix_agent_event_handler (struct trace_seq *s, +struct pevent_record *record, +struct event_format *event,void *context) +{ +struct ras_events *ras = context; +struct tm *tm; +struct ras_ccix_event ev; +time_t now; +int ret; + +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); + ret =ras_ccix_common_parse (s, record, event, context, &ev); +if (ret) +return ret; + +trace_seq_printf (s,"%d %s id:%d CCIX Agent Internal error: %s ue:%d nocomm:%d degraded:%d deferred:%d physical addr: 0x%llx mask: 0x%llx" , + ev.error_seq,err_severity (ev.severity), + ev.source,ccix_component_type (ev.component), + (ev.severity_detail &0x1 ) ?1 :0 , + (ev.severity_detail &0x2 ) ?1 :0 , + (ev.severity_detail &0x4 ) ?1 :0 , + (ev.severity_detail &0x8 ) ?1 :0 , + ev.address, +err_mask (ev.pa_mask_lsb)); + +ras_store_ccix_agent_event (ras, &ev); + +return 0 ; +}
ras-ccix-handler.h +8 -0
@@ -33,6 +33,9 @@ int ras_ccix_port_event_handler(struct trace_seq *s,int ras_ccix_link_event_handler (struct trace_seq *s,struct pevent_record *record,struct event_format *event,void *context); +int ras_ccix_agent_event_handler (struct trace_seq *s, +struct pevent_record *record, +struct event_format *event,void *context);/* Perhaps unnecessary paranoia, but the tracepoint structure is packed */ #pragma pack(1)
@@ -86,6 +89,10 @@ struct cper_ccix_link_err_compact {uint8_t link_id;uint8_t credit_type; }; + +struct cper_ccix_agent_internal_err_compact { +uint32_t validation_bits; +};#pragma pack()#define CCIX_MEM_ERR_GENERIC_MEM_VALID 0x0001
@@ -128,4 +135,5 @@ struct cper_ccix_link_err_compact {#define CCIX_LINK_ERR_MESSAGE_VALID 0x0010#define CCIX_LINK_ERR_VENDOR_DATA_VALID 0x0020 +#define CCIX_AGENT_ERR_VENDOR_DATA_VALID 0x0001#endif
ras-events.c +9 -0
@@ -209,6 +209,7 @@ int toggle_ras_mc_event(int enable) rc |=__toggle_ras_mc_event (ras,"ras" ,"ccix_atc_event" , enable); rc |=__toggle_ras_mc_event (ras,"ras" ,"ccix_port_event" , enable); rc |=__toggle_ras_mc_event (ras,"ras" ,"ccix_link_event" , enable); + rc |=__toggle_ras_mc_event (ras,"ras" ,"ccix_agent_event" , enable);#endif #ifdef HAVE_MCE
@@ -736,6 +737,14 @@ int handle_ras_events(int record_events) else log(ALL, LOG_ERR, "Can't get traces from %s:%s\n", "ras", "ccix_link_event"); + rc =add_event_handler (ras, pevent, page_size,"ras" , +"ccix_agent_error_event" , + ras_ccix_agent_event_handler); +if (!rc) + num_events++; +else +log (ALL ,LOG_ERR ,"Cant' get traces from %s:%s\n" , +"ras" ,"ccix_agent_error_event" );#endif #ifdef HAVE_NON_STANDARD
ras-record.c +61 -0
73 lines not on this page · raw message
ras-record.h +3 -0
@@ -119,6 +119,7 @@ struct sqlite3_priv {sqlite3_stmt *stmt_ccix_atc_record;sqlite3_stmt *stmt_ccix_port_record;sqlite3_stmt *stmt_ccix_link_record; +sqlite3_stmt *stmt_ccix_agent_record;#endif #ifdef HAVE_NON_STANDARD sqlite3_stmt *stmt_non_standard_record;
@@ -138,6 +139,7 @@ int ras_store_ccix_cache_event(struct ras_events *ras, struct ras_ccix_event *evint ras_store_ccix_atc_event (struct ras_events *ras,struct ras_ccix_event *ev);int ras_store_ccix_port_event (struct ras_events *ras,struct ras_ccix_event *ev);int ras_store_ccix_link_event (struct ras_events *ras,struct ras_ccix_event *ev); +int ras_store_ccix_agent_event (struct ras_events *ras,struct ras_ccix_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);
@@ -152,6 +154,7 @@ static inline int ras_store_ccix_cache_event(struct ras_events *ras, struct ras_static inline int ras_store_ccix_atc_event (struct ras_events *ras,struct ras_ccix_event *ev) {return 0 ; };static inline int ras_store_ccix_port_event (struct ras_events *ras,struct ras_ccix_event *ev) {return 0 ; };static inline int ras_store_ccix_link_event (struct ras_events *ras,struct ras_ccix_event *ev) {return 0 ; }; +static inline int ras_store_ccix_agent_event (struct ras_events *ras,struct ras_ccix_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 ; };
Signature · 1 line
2.20.1
RFC PATCH 5/6 rasdaemon: CCIX: Link error support
In reply to Jonathan CameronAdd support for reporting and storing to sqlite3 of CCIX Link errors.
--- ras-ccix-handler.c | 96 ++++++++++++++++++++++++++++++++++++++++++++++ ras-ccix-handler.h | 19 +++++++++ ras-events.c | 9 +++++ ras-record.c | 87 +++++++++++++++++++++++++++++++++++++++++ ras-record.h | 3 ++ 5 files changed, 214 insertions(+)
ras-ccix-handler.c +96 -0
@@ -272,6 +272,61 @@ static char *ccix_port_err_cper_data(const char *c)return buf; } +static char *ccix_link_err_type (uint8_t err) +{ +switch (err) { +case 0 :return "generic" ; +case 1 :return "credit underflow" ; +case 2 :return "credit overflow" ; +case 3 :return "unusable credit" ; +case 4 :return "credit timeout" ; + } +return "unknown" ; +}; + +static char *ccix_link_credit (uint8_t credit) +{ +switch (credit) { +case 0 :return "memory" ; +case 1 :return "snoop" ; +case 2 :return "data" ; +case 3 :return "misc" ; + } +return "unknown" ; +}; + +static char *ccix_link_err_cper_data (const char *c) +{ +const struct cper_ccix_link_err_compact *cpd = + (struct cper_ccix_link_err_compact *)c; +static char buf[1024 ]; +char *p = buf; +int i; + +if (!cpd->validation_bits) +return "" ; + + p +=sprintf (p," (" ); +if (cpd->validation_bits &CCIX_LINK_ERR_TYPE_VALID ) + p +=sprintf (p,"error: %s " , +ccix_link_err_type (cpd->err_type)); +if (cpd->validation_bits &CCIX_LINK_ERR_OP_VALID ) + p +=sprintf (p,"op: %s " ,ccix_port_op (cpd->op_type)); +if (cpd->validation_bits &CCIX_LINK_ERR_LINK_ID_VALID ) + p +=sprintf (p,"id: %u " , cpd->link_id); +if (cpd->validation_bits &CCIX_LINK_ERR_CREDIT_TYPE_VALID ) + p +=sprintf (p,"credit-type: %s " , +ccix_link_credit (cpd->credit_type)); +if (cpd->validation_bits &CCIX_LINK_ERR_MESSAGE_VALID ) { + p +=sprintf (p,"message: " ); +for (i =0 ; i <8 ; i++) + p +=sprintf (p,"0x%08x " , cpd->message[i]); + } + p +=sprintf (p -1 ,")" ); + +return buf; +} +static char *ccix_component_type (int type) {switch (type) {
@@ -510,3 +565,44 @@ int ras_ccix_port_event_handler(struct trace_seq *s,return 0 ; } + +int ras_ccix_link_event_handler (struct trace_seq *s, +struct pevent_record *record, +struct event_format *event,void *context) +{ +struct ras_events *ras = context; +struct tm *tm; +struct ras_ccix_event ev; +time_t now; +int ret; + +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); + ret =ras_ccix_common_parse (s, record, event, context, &ev); +if (ret) +return ret; + +trace_seq_printf (s,"%d %s id:%d CCIX Link error: %s ue:%d nocomm:%d degraded:%d deferred:%d physical addr: 0x%llx mask: 0x%llx %s" , + ev.error_seq,err_severity (ev.severity), + ev.source,ccix_component_type (ev.component), + (ev.severity_detail &0x1 ) ?1 :0 , + (ev.severity_detail &0x2 ) ?1 :0 , + (ev.severity_detail &0x4 ) ?1 :0 , + (ev.severity_detail &0x8 ) ?1 :0 , + ev.address, +err_mask (ev.pa_mask_lsb), +ccix_link_err_cper_data (ev.cper_data)); + +ras_store_ccix_link_event (ras, &ev); + +return 0 ; +}
ras-ccix-handler.h +19 -0
@@ -30,6 +30,9 @@ int ras_ccix_atc_event_handler(struct trace_seq *s,int ras_ccix_port_event_handler (struct trace_seq *s,struct pevent_record *record,struct event_format *event,void *context); +int ras_ccix_link_event_handler (struct trace_seq *s, +struct pevent_record *record, +struct event_format *event,void *context);/* Perhaps unnecessary paranoia, but the tracepoint structure is packed */ #pragma pack(1)
@@ -74,6 +77,15 @@ struct cper_ccix_port_err_compact {uint8_t err_type;uint8_t op_type; }; + +struct cper_ccix_link_err_compact { +uint32_t validation_bits; +uint32_t message[8 ]; +uint8_t err_type; +uint8_t op_type; +uint8_t link_id; +uint8_t credit_type; +};#pragma pack()#define CCIX_MEM_ERR_GENERIC_MEM_VALID 0x0001
@@ -109,4 +121,11 @@ struct cper_ccix_port_err_compact {#define CCIX_PORT_ERR_MESSAGE_VALID 0x0004#define CCIX_PORT_ERR_VENDOR_DATA_VALID 0x0008 +#define CCIX_LINK_ERR_OP_VALID 0x0001 +#define CCIX_LINK_ERR_TYPE_VALID 0x0002 +#define CCIX_LINK_ERR_LINK_ID_VALID 0x0004 +#define CCIX_LINK_ERR_CREDIT_TYPE_VALID 0x0008 +#define CCIX_LINK_ERR_MESSAGE_VALID 0x0010 +#define CCIX_LINK_ERR_VENDOR_DATA_VALID 0x0020 +#endif
ras-events.c +9 -0
@@ -208,6 +208,7 @@ int toggle_ras_mc_event(int enable) rc |=__toggle_ras_mc_event (ras,"ras" ,"ccix_cache_event" , enable); rc |=__toggle_ras_mc_event (ras,"ras" ,"ccix_atc_event" , enable); rc |=__toggle_ras_mc_event (ras,"ras" ,"ccix_port_event" , enable); + rc |=__toggle_ras_mc_event (ras,"ras" ,"ccix_link_event" , enable);#endif #ifdef HAVE_MCE
@@ -727,6 +728,14 @@ int handle_ras_events(int record_events) else log(ALL, LOG_ERR, "Can't get traces from %s:%s\n", "ras", "ccix_port_event"); + rc =add_event_handler (ras, pevent, page_size,"ras" , +"ccix_link_error_event" , + ras_ccix_link_event_handler); +if (!rc) + num_events++; +else +log (ALL ,LOG_ERR ,"Can't get traces from %s:%s\n" , +"ras" ,"ccix_link_event" );#endif #ifdef HAVE_NON_STANDARD
ras-record.c +87 -0
99 lines not on this page · raw message
ras-record.h +3 -0
@@ -118,6 +118,7 @@ struct sqlite3_priv {sqlite3_stmt *stmt_ccix_cache_record;sqlite3_stmt *stmt_ccix_atc_record;sqlite3_stmt *stmt_ccix_port_record; +sqlite3_stmt *stmt_ccix_link_record;#endif #ifdef HAVE_NON_STANDARD sqlite3_stmt *stmt_non_standard_record;
@@ -136,6 +137,7 @@ int ras_store_ccix_memory_event(struct ras_events *ras, struct ras_ccix_event *eint ras_store_ccix_cache_event (struct ras_events *ras,struct ras_ccix_event *ev);int ras_store_ccix_atc_event (struct ras_events *ras,struct ras_ccix_event *ev);int ras_store_ccix_port_event (struct ras_events *ras,struct ras_ccix_event *ev); +int ras_store_ccix_link_event (struct ras_events *ras,struct ras_ccix_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);
@@ -149,6 +151,7 @@ static inline int ras_store_ccix_memory_event(struct ras_events *ras, struct rasstatic inline int ras_store_ccix_cache_event (struct ras_events *ras,struct ras_ccix_event *ev) {return 0 ; };static inline int ras_store_ccix_atc_event (struct ras_events *ras,struct ras_ccix_event *ev) {return 0 ; };static inline int ras_store_ccix_port_event (struct ras_events *ras,struct ras_ccix_event *ev) {return 0 ; }; +static inline int ras_store_ccix_link_event (struct ras_events *ras,struct ras_ccix_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 ; };
Signature · 1 line
2.20.1
RFC PATCH 4/6 rasdaemon: CCIX: Port error handling
In reply to Jonathan CameronAdd support for reporting and storing to sqlite3 for CCIX Port errors.
--- ras-ccix-handler.c | 93 ++++++++++++++++++++++++++++++++++++++++++++++ ras-ccix-handler.h | 14 +++++++ ras-events.c | 9 +++++ ras-record.c | 75 +++++++++++++++++++++++++++++++++++++ ras-record.h | 3 ++ 5 files changed, 194 insertions(+)
ras-ccix-handler.c +93 -0
@@ -220,6 +220,58 @@ static char *ccix_atc_err_cper_data(const char *c)return buf; } +static char *ccix_port_op (uint8_t op) +{ +switch (op) { +case 0 :return "command" ; +case 1 :return "read" ; +case 2 :return "write" ; + } +return "unknown" ; +} + +static char *ccix_port_err_type (uint8_t type) +{ +switch (type) { +case 0 :return "generic bus / slave error" ; +case 1 :return "bus parity / ECC error" ; +case 2 :return "BDF not present" ; +case 3 :return "invalid address" ; +case 4 :return "invalid agent ID" ; +case 5 :return "bus timeout" ; +case 6 :return "hang" ; +case 7 :return "egress blocked" ; + } +return "unknown-type" ; +}; + +static char *ccix_port_err_cper_data (const char *c) +{ +const struct cper_ccix_port_err_compact *cpd = + (struct cper_ccix_port_err_compact *)c; +static char buf[1024 ]; +char *p = buf; +int i; + +if (!cpd->validation_bits) +return "" ; + + p +=sprintf (p," (" ); +if (cpd->validation_bits &CCIX_PORT_ERR_TYPE_VALID ) + p +=sprintf (p,"error: %s " , +ccix_port_err_type (cpd->err_type)); +if (cpd->validation_bits &CCIX_PORT_ERR_OP_VALID ) + p +=sprintf (p,"op: %s " ,ccix_port_op (cpd->op_type)); +if (cpd->validation_bits &CCIX_PORT_ERR_MESSAGE_VALID ) { + p +=sprintf (p,"message: " ); +for (i =0 ; i <8 ; i++) + p +=sprintf (p,"0x%08x " , cpd->message[i]); + } + p +=sprintf (p -1 ,")" ); + +return buf; +} +static char *ccix_component_type (int type) {switch (type) {
@@ -417,3 +469,44 @@ int ras_ccix_atc_event_handler(struct trace_seq *s,return 0 ; } + +int ras_ccix_port_event_handler (struct trace_seq *s, +struct pevent_record *record, +struct event_format *event,void *context) +{ +struct ras_events *ras = context; +struct tm *tm; +struct ras_ccix_event ev; +time_t now; +int ret; + +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); + ret =ras_ccix_common_parse (s, record, event, context, &ev); +if (ret) +return ret; + +trace_seq_printf (s,"%d %s id:%d CCIX Port error: %s ue:%d nocomm:%d degraded:%d deferred:%d physical addr: 0x%llx mask: 0x%llx %s" , + ev.error_seq,err_severity (ev.severity), + ev.source,ccix_component_type (ev.component), + (ev.severity_detail &0x1 ) ?1 :0 , + (ev.severity_detail &0x2 ) ?1 :0 , + (ev.severity_detail &0x4 ) ?1 :0 , + (ev.severity_detail &0x8 ) ?1 :0 , + ev.address, +err_mask (ev.pa_mask_lsb), +ccix_port_err_cper_data (ev.cper_data)); + +ras_store_ccix_port_event (ras, &ev); + +return 0 ; +}
ras-ccix-handler.h +14 -0
@@ -27,6 +27,9 @@ int ras_ccix_cache_event_handler(struct trace_seq *s,int ras_ccix_atc_event_handler (struct trace_seq *s,struct pevent_record *record,struct event_format *event,void *context); +int ras_ccix_port_event_handler (struct trace_seq *s, +struct pevent_record *record, +struct event_format *event,void *context);/* Perhaps unnecessary paranoia, but the tracepoint structure is packed */ #pragma pack(1)
@@ -65,6 +68,12 @@ struct cper_ccix_atc_err_compact {uint8_t instance; }; +struct cper_ccix_port_err_compact { +uint32_t validation_bits; +uint32_t message[8 ]; +uint8_t err_type; +uint8_t op_type; +};#pragma pack()#define CCIX_MEM_ERR_GENERIC_MEM_VALID 0x0001
@@ -95,4 +104,9 @@ struct cper_ccix_atc_err_compact {#define CCIX_ATC_ERR_INSTANCE_ID_VALID 0x0002#define CCIX_ATC_ERR_VENDOR_DATA_VALID 0x0004 +#define CCIX_PORT_ERR_OP_VALID 0x0001 +#define CCIX_PORT_ERR_TYPE_VALID 0x0002 +#define CCIX_PORT_ERR_MESSAGE_VALID 0x0004 +#define CCIX_PORT_ERR_VENDOR_DATA_VALID 0x0008 +#endif
ras-events.c +9 -0
@@ -207,6 +207,7 @@ int toggle_ras_mc_event(int enable) rc |=__toggle_ras_mc_event (ras,"ras" ,"ccix_memory_event" , enable); rc |=__toggle_ras_mc_event (ras,"ras" ,"ccix_cache_event" , enable); rc |=__toggle_ras_mc_event (ras,"ras" ,"ccix_atc_event" , enable); + rc |=__toggle_ras_mc_event (ras,"ras" ,"ccix_port_event" , enable);#endif #ifdef HAVE_MCE
@@ -718,6 +719,14 @@ int handle_ras_events(int record_events) else log(ALL, LOG_ERR, "Can't get traces from %s:%s\n", "ras", "ccix_atc_event"); + rc =add_event_handler (ras, pevent, page_size,"ras" , +"ccix_port_error_event" , + ras_ccix_port_event_handler); +if (!rc) + num_events++; +else +log (ALL ,LOG_ERR ,"Can't get traces from %s:%s\n" , +"ras" ,"ccix_port_event" );#endif #ifdef HAVE_NON_STANDARD
ras-record.c +75 -0
87 lines not on this page · raw message
ras-record.h +3 -0
@@ -117,6 +117,7 @@ struct sqlite3_priv {sqlite3_stmt *stmt_ccix_mem_record;sqlite3_stmt *stmt_ccix_cache_record;sqlite3_stmt *stmt_ccix_atc_record; +sqlite3_stmt *stmt_ccix_port_record;#endif #ifdef HAVE_NON_STANDARD sqlite3_stmt *stmt_non_standard_record;
@@ -134,6 +135,7 @@ int ras_store_extlog_mem_record(struct ras_events *ras, struct ras_extlog_eventint ras_store_ccix_memory_event (struct ras_events *ras,struct ras_ccix_event *ev);int ras_store_ccix_cache_event (struct ras_events *ras,struct ras_ccix_event *ev);int ras_store_ccix_atc_event (struct ras_events *ras,struct ras_ccix_event *ev); +int ras_store_ccix_port_event (struct ras_events *ras,struct ras_ccix_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);
@@ -146,6 +148,7 @@ static inline int ras_store_extlog_mem_record(struct ras_events *ras, struct rasstatic inline int ras_store_ccix_memory_event (struct ras_events *ras,struct ras_ccix_event *ev) {return 0 ; };static inline int ras_store_ccix_cache_event (struct ras_events *ras,struct ras_ccix_event *ev) {return 0 ; };static inline int ras_store_ccix_atc_event (struct ras_events *ras,struct ras_ccix_event *ev) {return 0 ; }; +static inline int ras_store_ccix_port_event (struct ras_events *ras,struct ras_ccix_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 ; };
Signature · 1 line
2.20.1
Em Sat, 15 Jun 2019 01:55:11 +0800
Jonathan Cameron <[email protected]> escreveu:
Quoted 4 lines
This is an RFC because the kernel side is currently under review and may change with obvious follow through effects on this.
Yeah, we should wait for it to be merged upstream before adding them to rasdaemon ;-)
Quoted 5 lines
There are a few additional questions around this:
1. Divide between specifity of DB fields vs blobs. Where possible I have tried to fully describe the contents via separate fields rather than large blobs.
OK!
Quoted 3 lines
One common SQL convention
that doesn't seem to have been previously done in rasdaemon is to use explicit NULL entries for elements where data is missing.
We tried to be a simple as possible when we added the dB option.
We even opted to use sqllite, instead of having support for MySQL or Postgres - Not only due to simplicity, but also because, if a machine has problems, a database at the same machine may crash.
That's said, with MySQL/Postgres support, the logs could be done via a remote machine, with would be safer.
-
I don't see much problem on adding such things to new tables or even add optional support for other dB types, but Changing the existing dBs can be a problem.
Perhaps it could have a table somewhere storing the Rasdaemon version, in order to be able to detect if a table has missing something. If Rasdaemon version is bigger than the one at the server, it could do some database changes in order to support new features - including things like replacing empty fields by NULL.
If you think such changes would be useful, feel free to submit patches.
Quoted 2 lines
2. Should we split
ras-record.cand have the ccix handling in a separateras-record-ccix.cfile or similar as that one is getting rather large.
Makes sense to me. As all projects, it started small. As things are getting bigger, it makes sense to split some features on separate files.
Thanks,
Mauro