1
11138 2014-04-22 19:45:31 +08:00 1
cat kern.log | perl -ne '/CPU(\d+), BANK(\d+), addr (\S+), state (\S+)/; print "CPU $1 BANK $2 TSC 00000000000000\nMISC 0000000000000000 ADDR $3 \nSTATUS $4\n"' > mce_fmtd.log
|
2
terry OP 其实我只要知道
cat kern.log | perl -ne '/CPU(\d+), BANK(\d+), addr (\S+), state (\S+)/; print "CPU $1 BANK $2 TSC 00000000000000\nMISC 0000000000000000 ADDR $3 \nSTATUS $4\n" 是要把下面的文本弄成什么样的目标格式就行了 CPU8, BANK0, addr db484ffc0, state cc0000c00001009f 转成 CPU 8, BANK 0, TSC 00000000000000 MISC 0000000000000000 ADDR $3 STATUS $4 这样么? 谢谢先 |
4
terry OP 给感兴趣的人看一下结果
decode 之后 sudo mcelog --cpu=westmere --ascii --no-dmi --ignorenodev --file mce_fmtd.log > mce_decoded.log CPU 8 BANK 0 TSC 00000000000000 MISC 0000000000000000 ADDR db484ef40 Hardware event. This is not a software error. CPU 8 BANK 0 MISC 0 ADDR db484ef40 MCG status: MCi status: Error overflow Corrected error MCi_MISC register valid MCi_ADDR register valid MCA: MEMORY CONTROLLER RD_CHANNELunspecified_ERR Transaction: Memory read error Memory read ECC error Memory corrected error count (CORE_ERR_CNT): 10 Memory transaction Tracker ID (RTId): 0 Memory DIMM ID of error: 0 Memory channel ID of error: 0 Memory ECC syndrome: 0 STATUS cc0002800001009f MCGSTATUS 0 STATUS cc0002800001009f] CPU 8 BANK 0 TSC 00000000000000 MISC 0000000000000000 ADDR db484ef40 Hardware event. This is not a software error. 知道的一看就明白是什么问题了... |
5
ngn999 2014-04-22 21:04:55 +08:00
cat kern.log | perl -ne 'print "CPU $1 BANK $2 TSC 00000000000000\nMISC 0000000000000000 ADDR $3 \nSTATUS $4\n" if /CPU(\d+), BANK(\d+), addr (\S+), state (\S+)/' > mce_fmtd.log
|
6
ngn999 2014-04-22 21:05:39 +08:00
perl在命令行下当 sed + awk用
|
7
leoYu 2014-04-23 14:05:34 +08:00
用sed也可以解决的,lz可以邮件我
|