]> www.infradead.org Git - users/mchehab/rasdaemon.git/commitdiff
rasdaemon:print non-standard error data if not decoded
authorShiju Jose <shiju.jose@huawei.com>
Mon, 17 Jun 2019 14:28:47 +0000 (15:28 +0100)
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Fri, 21 Jun 2019 18:37:49 +0000 (15:37 -0300)
This patch change printing non-standard error data
only if not decoded.

Suggested-by: Xiaofei Tan <tanxiaofei@huawei.com>
Signed-off-by: Shiju Jose <shiju.jose@huawei.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
ras-non-standard-handler.c

index 21e6a764f4d1aa57c3affb4fee3d233c522c99bf..d343a2ab2eb16d1a1f8fbc0856bbdd0b877ef24f 100644 (file)
@@ -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);