From: Shiju Jose Date: Mon, 17 Jun 2019 14:28:47 +0000 (+0100) Subject: rasdaemon:print non-standard error data if not decoded X-Git-Tag: v0.6.3~13 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=ad4e33a09f61708de79802d87f78ac16a2a86393;p=users%2Fmchehab%2Frasdaemon.git rasdaemon:print non-standard error data if not decoded This patch change printing non-standard error data only if not decoded. Suggested-by: Xiaofei Tan Signed-off-by: Shiju Jose Signed-off-by: Mauro Carvalho Chehab --- diff --git a/ras-non-standard-handler.c b/ras-non-standard-handler.c index 21e6a76..d343a2a 100644 --- a/ras-non-standard-handler.c +++ b/ras-non-standard-handler.c @@ -160,20 +160,6 @@ int ras_non_standard_event_handler(struct trace_seq *s, 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]; @@ -187,6 +173,23 @@ int ras_non_standard_event_handler(struct trace_seq *s, } } + if (!dec_done) { + 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, " "); + } + } + /* Insert data into the SGBD */ #ifdef HAVE_SQLITE3 ras_store_non_standard_record(ras, &ev);