]> www.infradead.org Git - users/mchehab/rasdaemon.git/commitdiff
rasdaemon: fix mce numfield decoded error
authorXie XiuQi <xiexiuqi@huawei.com>
Thu, 8 May 2014 12:07:19 +0000 (20:07 +0800)
committerMauro Carvalho Chehab <m.chehab@samsung.com>
Thu, 26 Jun 2014 12:30:35 +0000 (09:30 -0300)
Some fields are missing in mce decode information, as below:
...
rasdaemon: register inserted at db
           <...>-31568 [000]  4023.214080: mce_record:
2014-05-07 15:51:16 +0800 bank=2, status= bd000000000000c0, MEMORY
CONTROLLER MS_CHANNEL0_ERR Transaction: Memory scrubbing error %s: %Lu
 %s: %Lx
 %s: %Lx
 %s: %Lu
 %s: %Lu
 %s: %Lx
, mci=Uncorrected_error Error_enabled SRAO, n_errors=0 channel=0,
dimm=0, cpu_type= Intel Xeon 5500 series / Core i3/5/7
("Nehalem/Westmere"), cpu= 0, socketid= 0, ip= 1eadbabe (INEXACT), cs=
73, misc= 8c, addr= 62b000, mcgstatus= 5 RIPV MCIP, mcgcap= 1c09,
apicid= 0

"f->name" & "v" are missed to print in decode_numfield(), so fix it.

Signed-off-by: Xie XiuQi <xiexiuqi@huawei.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
bitfield.c

index b2895b425d33554293728555bff07e4a16b85e30..07795a91a63e065f1fab4be2e96eebbdcc890f8e 100644 (file)
@@ -92,8 +92,9 @@ void decode_numfield(struct mce_event *e, uint64_t status,
                uint64_t mask = (1ULL << (f->end - f->start + 1)) - 1;
                uint64_t v = (status >> f->start) & mask;
                if (v > 0 || f->force) {
-                       mce_snprintf(e->error_msg, "%%s: %s\n",
-                                    f->fmt ? f->fmt : "%Lu");
+                       char fmt[32] = {0};
+                       snprintf(fmt, 32, "%%s: %s\n", f->fmt ? f->fmt : "%Lu");
+                       mce_snprintf(e->error_msg, fmt, f->name, v);
                }
        }
 }