📄 post_mortem.html
字号:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html><head> <title></title> <link rel="stylesheet" media="screen" type="text/css" href="./style.css" /> <link rel="stylesheet" media="screen" type="text/css" href="./design.css" /> <link rel="stylesheet" media="print" type="text/css" href="./print.css" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /></head><body><a href=start.html>start</a></br><h1><a name="linux_post_mortem_analysis" id="linux_post_mortem_analysis">Linux Post Mortem Analysis</a></h1><div class="level1"><p> No one likes being in this position - the Linux kernel crashes or hangs without any output on the console. </p><p>The first attempt to get more information in such a situation is a dump of the log buffer - often the Linux kernel has already collected useful information in its console I/O buffer which just does not get printed because the kernel does not run until successful initialization of the console port.</p><p>Follow the below steps:</p><ol><li class="level1"><div class="li"> On your host, find out the virtual address of the log buffer:<pre class="code">rgetz@test:~/checkouts/kernel/uClinux-dist> grep __log_buf ./linux-2.6.x/System.map00144d80 b __log_buf</pre></div></li><li class="level1"><div class="li"> Reset your board - do not power-cycle it! </div></li><li class="level1"><div class="li"> Use U-Boot to print a memory dump of that memory area:<pre class="code">bf537> md 0x00144d8000144d80: 4c3e353c 78756e69 72657620 6e6f6973 <5>Linux version00144d90: 362e3220 2e36312e 412d3131 322d4944 2.6.16.11-ADI-200144da0: 52363030 72282031 7a746567 73657440 006R1 (rgetz@tes00144db0: 28202974 20636367 73726576 206e6f69 t) (gcc version00144dc0: 2e342e33 41282035 63204944 29297376 3.4.5 (ADI cvs))00144dd0: 20312320 206e6f4d 20677541 30312037 #1 Mon Aug 7 1000144de0: 3a35353a 45203434 32205444 0a363030 :55:44 EDT 2006.00144df0: 423e363c 6b63616c 206e6966 70707573 <6>Blackfin supp00144e00: 2074726f 20294328 34303032 3030322d ort (C) 2004-20000144e10: 6e412036 676f6c61 76654420 73656369 6 Analog Devices00144e20: 6e49202c 3c0a2e63 6f433e36 6c69706d , Inc..<6>Compil00144e30: 66206465 4120726f 2d505344 33354642 ed for ADSP-BF5300144e40: 65522037 30202e76 3c0a322e 6c423e36 7 Rev. 0.2.<6>Bl00144e50: 666b6361 75206e69 6e696c43 73207875 ackfin uClinux s00144e60: 6f707075 62207472 74682079 2f3a7074 upport by http:/00144e70: 616c622f 69666b63 63752e6e 756e696c /blackfin.uclinu00144e80: 726f2e78 3c0a2f67 72503e36 7365636f x.org/.<6>Proces00144e90: 20726f73 65657053 35203a64 4d203030 sor Speed: 500 M00144ea0: 63207a48 2065726f 636f6c63 6e61206b Hz core clock an00144eb0: 30312064 684d2030 7953207a 6d657473 d 100 Mhz System00144ec0: 6f6c4320 3c0a6b63 6f423e36 20647261 Clock.<6>Board.....</pre></div></li><li class="level1"><div class="li"> This buffer is a circular buffer, where the default size of this buffer is 16k, (this can be controlled by changing the configuration option by Kernel hacking → Kernel debugging → Kernel log buffer size). If the kernel has printed more information that 16k, and the buffer has wrapped, the start of the buffer can be found by looking at the pointer <code>_log_start</code>. <pre class="code">rgetz@test:~/checkouts/kernel/uClinux-dist> grep _log_start ./linux-2.6.x/System.map00144cf0 b _log_start</pre><p>This tells us the start/end of the circular buffer is pointed to by the value in <code>0x144cf0</code>.</p><pre class="code">bf537> md.l 144cf0 0x100144cf0: 00000b92 ....</pre><p>This tells us that <code>0x0b92</code> is the offset of the buffer.</p></div></li><li class="level1"><div class="li"> Have a peek at the end of the buffer <code>0x0b92 + 0x144d80</code> to see the last message that prints out.<pre class="code">bf537> md.w 0145912 0x10000145912: 303c 523e 7365 6174 7472 6e69 2067 7973 <0>Restarting sy00145922: 7473 6d65 0a2e 343c 2e3e 000a 0000 0000 stem..<4>.......00145932: 0000 0000 0000 0000 0000 0000 0000 0000 ................</pre></div></li></ol><p> <code>md.b</code> </p></div></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -