From ad4e33a09f61708de79802d87f78ac16a2a86393 Mon Sep 17 00:00:00 2001 From: Shiju Jose Date: Mon, 17 Jun 2019 15:28:47 +0100 Subject: [PATCH] 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 --- ras-non-standard-handler.c | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) 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); -- 2.50.1