Chinese translated version of Documentation/oops-tracing.txt
If you have any comment or update to the content, please contact the
original document maintainer directly. However, if you have a problem
communicating in English you can also ask the Chinese maintainer for
help. Contact the Chinese maintainer if this translation is outdated
or if there is a problem with the translation.
Chinese maintainer: Dave Young hidave.darkstar@gmail.com
Documentation/oops-tracing.txt çä¸æç¿»è¯
å¦ææ³è¯è®ºææ´æ°æ¬æçå
容ï¼è¯·ç´æ¥èç³»åææ¡£çç»´æ¤è
ãå¦æä½ ä½¿ç¨è±æ
交æµæå°é¾çè¯ï¼ä¹å¯ä»¥åä¸æçç»´æ¤è
æ±å©ãå¦ææ¬ç¿»è¯æ´æ°ä¸åæ¶æè
ç¿»
è¯åå¨é®é¢ï¼è¯·èç³»ä¸æçç»´æ¤è
ã
ä¸æçç»´æ¤è
ï¼ æ¨ç Dave Young hidave.darkstar@gmail.com
ä¸æçç¿»è¯è
ï¼ æ¨ç Dave Young hidave.darkstar@gmail.com
ä¸æçæ ¡è¯è
ï¼ æé³ Li Yang leo@zh-kernel.org
çèª Wang Cong xiyou.wangcong@gmail.com
以ä¸ä¸ºæ£æ
注æï¼ ksymoops å¨2.6ä¸æ¯æ²¡æç¨çã 请以åææ ¼å¼ä½¿ç¨Oops(æ¥èªdmesgï¼çç)ã
忽ç¥ä»»ä½è¿æ ·é£æ ·å
³äºâ解ç Oopsâæè
âéè¿ksymoopsè¿è¡âçææ¡£ã å¦æä½ è´´åºè¿è¡è¿
ksymoopsçæ¥èª2.6çOopsï¼äººä»¬åªä¼è®©ä½ éè´´ä¸æ¬¡ã
å¿«éæ»ç»
åç°Oops并åéç»çä¼¼ç¸å
³çå
æ ¸é¢åçç»´æ¤è
ãå«å¤ªæ
å¿å¯¹ä¸ä¸å·ãå¦æä½ ä¸ç¡®å®å°±åç»
åä½ æåçäºæ
ç¸å
³ç代ç çè´è´£äººã å¦æå¯éç°è¯çæè¿°ææ ·éæã é£çè³æ¯oopsæ´æ
ä»·å¼ã
å¦æä½ å¯¹äºåéç»è°ä¸æ æç¥ï¼ åç»linux-kernel@vger.kernel.orgãæè°¢ä½ å¸®å©Linux
å°½å¯è½å°ç¨³å®ã
Oopså¨åªé?
é常Oopsææ¬ç±klogdä»å
æ ¸ç¼å²åºé读åå¹¶ä¼ ç»syslogdï¼ç±syslogdåå°syslogæ件ä¸ï¼
å
¸åå°æ¯/var/log/messages(ä¾èµäº/etc/syslog.conf)ãææ¶klogdå´©æºäº,è¿ç§æ
åµä¸ä½
è½å¤è¿è¡dmesg > fileæ¥ä»å
æ ¸ç¼å²åºä¸è¯»åæ°æ®å¹¶ä¿åä¸æ¥ã å¦åä½ å¯ä»¥
cat /proc/kmsg > fileï¼ ç¶èä½ å¿
é¡»ä»å
¥ä¸æ¢ä¼ è¾ï¼ kmsgæ¯ä¸ä¸ªâæ°¸ä¸ç»æçæ件âãå¦
ææºå¨å´©æºåå°ä½ ä¸è½è¾å
¥å½ä»¤æè
ç£çä¸å¯ç¨é£ä¹ä½ æä¸ç§éæ©:-
ï¼1ï¼ ææå±å¹ä¸çææ¬å¾
æºå¨éå¯ååè¾å
¥è®¡ç®æºã 麻ç¦ä½å¦æ没æé对崩æºçåå¤ï¼
è¿æ¯ä»
æçéæ©ã å¦å¤ï¼ä½ å¯ä»¥ç¨æ°ç ç¸æºæå±å¹æä¸æ¥-ä¸å¤ªå¥½ï¼ä½æ¯æ²¡æ强ã å¦æä¿¡
æ¯æ»å¨å°äºç»ç«¯çä¸é¢ï¼ä½ ä¼åç°ä»¥é«å辩çå¯å¨ï¼æ¯å¦ï¼vga=791ï¼ä¼è®©ä½ 读å°æ´å¤çæ
æ¬ãï¼æ³¨æï¼è¿éè¦vesafbï¼æ以对âæ©æâçoops没æ帮å©ï¼
ï¼2ï¼ç¨ä¸²å£ç»ç«¯å¯å¨ï¼è¯·åçDocumentation/serial-console.txtï¼ï¼è¿è¡ä¸ä¸ªnull
modemå°å¦ä¸å°æºå¨å¹¶ç¨ä½ å欢çé讯工å
·è·åè¾åºãMinicomå·¥ä½å°å¾å¥½ã
ï¼3ï¼ä½¿ç¨Kdumpï¼è¯·åçDocumentation/kdump/kdump.txtï¼ï¼
使ç¨å¨Documentation/kdump/gdbmacros.txtä¸å®ä¹çdmesg gdbå®ï¼ä»æ§çå
åä¸æåå
æ ¸
ç¯å½¢ç¼å²åºã
å®æ´ä¿¡æ¯
注æï¼ä»¥ä¸æ¥èªäºLinusçé®ä»¶éç¨äº2.4å
æ ¸ã æå 为åå²åå ä¿çäºå®ï¼å¹¶ä¸å 为å
¶ä¸
ä¸äºä¿¡æ¯ä»ç¶éç¨ã ç¹å«æ³¨æçæ¯ï¼è¯·å¿½ç¥ä»»ä½ksymoopsçå¼ç¨ã
From: Linus Torvalds torvalds@osdl.org
ææ ·è·è¸ªOops.. [ååå°linux-kernelçä¸å°é®ä»¶]
主è¦ççªé¨æ¯æäºå¹´åè¿äºç¦äººçoopsæ¶æ¯æ交éçç»éª;-)
å®é ä¸ï¼ä½ æåæ³ä½¿å®æ´ç®åãææ两个ä¸åçæ¹æ³ï¼
gdb /usr/src/linux/vmlinux
gdb> disassemble <offending_function>
é£æ¯åç°é®é¢çç®ååæ³ï¼è³å°å¦æbugæ¥ååç好çæ
åµä¸ï¼è±¡è¿ä¸ªä¸æ ·-è¿è¡ksymoops
å¾å°oopsåççå½æ°åå½æ°å
çå移ï¼ã
å¦ï¼å¦ææ¥ååççå æ ¸ä»¥ç¸åçç¼è¯å¨åç¸ä¼¼çé ç½®ç¼è¯å®ä¼æ帮å©çã
å¦ä¸ä»¶è¦åçäºæ¯åæ±ç¼bugæ¥åçâCodeâé¨åï¼ksymoopsä¹ä¼ç¨æ£ç¡®çå·¥å
·æ¥åè¿ä»¶äºï¼
ä½å¦æ没æé£äºå·¥å
·ä½ å¯ä»¥åä¸ä¸ªå»ç¨åºï¼
char str[] = "\xXX\xXX\xXX...";
main(){}
并ç¨gcc -gç¼è¯å®ç¶åæ§è¡âdisassemble strâï¼XXé¨åæ¯ç±Oopsæ¥åçå¼-ä½ å¯ä»¥ä»
åªå
ç²è´´å¹¶ç¨â\xâæ¿æ¢ç©ºæ ¼-æå°±æ¯è¿ä¹åçï¼å 为ææå¾åç¨åºèªå¨åè¿ä¸åï¼ã
å¦å¤ï¼ä½ å¯ä»¥ç¨scripts/decodecodeè¿ä¸ªshellèæ¬ãå®ç使ç¨æ¹æ³æ¯ï¼
decodecode < oops.txt
âCodeâä¹åçåå
è¿å¶åèå¯è½ï¼å¨æäºæ¶æä¸ï¼æä¸äºå½åæ令ä¹åçæ令åè以å
å½ååä¹åçæ令åè
Code: f9 0f 8d f9 00 00 00 8d 42 0c e8 dd 26 11 c7 a1 60 ea 2b f9 8b 50 08 a1
64 ea 2b f9 8d 34 82 8b 1e 85 db 74 6d 8b 15 60 ea 2b f9 <8b> 43 04 39 42 54
7e 04 40 89 42 54 8b 43 04 3b 05 00 f6 52 c0
æåï¼å¦æä½ æ³ç¥é代ç æ¥èªåªéï¼ä½ å¯ä»¥ï¼
cd /usr/src/linux
make fs/buffer.s # æä»»ä½äº§çBUGçæ件
ç¶åä½ ä¼æ¯gdbåæ±ç¼æ´æ¸ æ¥çç¥éåçäºä»ä¹ã
ç°å¨ï¼é®é¢æ¯æä½ ææ¥æçæææ°æ®ç»åèµ·æ¥ï¼Cæºç ï¼å
³äºå®åºè¯¥ææ ·çä¸è¬ç¥è¯ï¼ï¼
æ±ç¼ä»£ç åå
¶åæ±ç¼å¾å°ç代ç ï¼å¦å¤è¿æä»âoopsâæ¶æ¯å¾å°çå¯åå¨ç¶æ-对äºè§£æ¯åç
æéæç¨ï¼èä¸å½ä½ æäºæ±ç¼ä»£ç ä½ ä¹è½æ¿å
¶å®çå¯åå¨åä»»ä½å®ä»¬å¯¹åºçC表达å¼åå¹é
ï¼ã
å®é
ä¸ï¼ä½ ä»
éççåªéä¸å¹é
ï¼è¿ä¸ªä¾åæ¯âCodeâåæ±ç¼åç¼è¯å¨çæç代ç ä¸å¹é
ï¼ã
ç¶åä½ é¡»è¦æ¾åºä¸ºä»ä¹ä¸å¹é
ãé常å¾ç®å-ä½ çå°ä»£ç 使ç¨äºç©ºæéç¶åä½ ç代ç æ³ç¥é
空æéæ¯æä¹åºç°çï¼è¿ææ£æ¥å®æ¯å¦åæ³..
ç°å¨ï¼å¦ææç½è¿æ¯ä¸é¡¹èæ¶çå·¥ä½èä¸éè¦ä¸ä¸ç¹å¿çä¸å¿ï¼æ²¡éãè¿å°±æ¯æ为ä»ä¹å¤§å¤
åªæ¯å¿½ç¥é£äºæ²¡æ符å·è¡¨ä¿¡æ¯çå´©æºæ¥åçåå ï¼ç®åç说太é¾æ¥æ¾äºï¼ææä¸äº
ç¨åºç¨äºå¨å
æ ¸ä»£ç 段ä¸æç´¢ç¹å®ç模å¼ï¼èä¸ææ¶æä¹å·²ç»è½æ¾åºé£äºå´©æºçå°æ¹ï¼ä½æ¯
ä»
ä»
æ¯æ¾åºæ£ç¡®çåºåä¹ç¡®å®éè¦ç¸å½æå®çå
æ ¸ç¥è¯ï¼
_ææ¶_ä¼åçè¿ç§æ
åµï¼æä»
çå°å´©æºä¸çåæ±ç¼ä»£ç åºåï¼ ç¶åæ马ä¸å°±æç½é®é¢åºå¨
åªéãè¿æ¶æææè¯å°èªå·±å¹²è¿ä¸ªå·¥ä½å·²ç»å¤ªé¿æ¶é´äº;-)
Linus
å ³äºOopsè·è¸ªç注解ï¼
为äºå¸®å©Linusåå
¶å®å
æ ¸å¼åè
ï¼klogd纳å
¥äºå¤§éçæ¯ææ¥å¤çä¿æ¤é误ã为äºæ¥æ对
å°å解æçå®æ´æ¯æè³å°åºè¯¥ä½¿ç¨1.3-pl3çsysklogdå
ã
å½ä¿æ¤é误åçæ¶ï¼klogdå®æ¤è¿ç¨èªå¨æå
æ ¸æ¥å¿ä¿¡æ¯ä¸çéè¦å°åç¿»è¯æå®ä»¬ç¸åºç符
å·ã
klogdæ§è¡ä¸¤ç§ç±»åçå°å解æãé¦å
æ¯éæç¿»è¯å
¶æ¬¡æ¯å¨æç¿»è¯ãéæç¿»è¯åksymoops
ä¸æ ·ä½¿ç¨System.mapæ件ã为äºåéæç¿»è¯klogdå®æ¤è¿ç¨å¿
é¡»å¨åå§åæ¶è½æ¾å°system
mapæ件ãå
³äºklogdææ ·æç´¢mapæ件请åçklogdæå页ã
å¨æå°åç¿»è¯å¨ä½¿ç¨å
æ ¸å¯è£
载模åæ¶å¾éè¦ã å 为å
æ ¸æ¨¡åçå
åæ¯ä»å
æ ¸å¨æå
åæ±
éåé
çï¼æ以ä¸ç®¡æ¯æ¨¡åå¼å§ä½ç½®è¿æ¯æ¨¡åä¸å½æ°å符å·çä½ç½®é½ä¸æ¯åºå®çã
å
æ ¸æ¯æå
许ç¨åºå³å®è£
è½½åªäºæ¨¡ååå®ä»¬å¨å
åä¸ä½ç½®çç³»ç»è°ç¨ã使ç¨è¿äºç³»ç»è°ç¨
klogdå®æ¤è¿ç¨çæä¸å¼ 符å·è¡¨ç¨äºè°è¯åçå¨å¯è£
载模åä¸çä¿æ¤é误ã
è³å°klogdä¼æä¾äº§çä¿æ¤é误ç模ååãè¿å¯æé¢å¤ç符å·ä¿¡æ¯ä¾å¯è£
载模åå¼åè
éæ©
以ä»æ¨¡åä¸è¾åºç¬¦å·ä¿¡æ¯ã
å 为å
æ ¸æ¨¡åç¯å¢å¯è½æ¯å¨æçï¼æ以å¿
é¡»æä¸ç§æºå¶å½æ¨¡åç¯å¢åçæ¹åæ¶æ¥éç¥klogd
å®æ¤è¿ç¨ã æä¸äºå¯ç¨çå½ä»¤è¡é项å
许klogdåå½åæ§è¡ä¸çå®æ¤è¿ç¨åéä¿¡å·ï¼åç¥ç¬¦
å·ä¿¡æ¯åºè¯¥è¢«å·æ°äºã æ´å¤ä¿¡æ¯è¯·åçklogdæå页ã
sysklogdåå¸æ¶å
å«ä¸ä¸ªè¡¥ä¸ä¿®æ¹äºmodules-2.0.0å
ï¼æ 论ä½æ¶ä¸ä¸ªæ¨¡åè£
è½½æè
å¸è½½é½
ä¼èªå¨åklogdåéä¿¡å·ãæä¸è¿ä¸ªè¡¥ä¸æä¾äºå¿
è¦ç对è°è¯åçäºå
æ ¸å¯è£
载模åçä¿æ¤
é误çæ ç¼æ¯æã
以ä¸æ¯è¢«klogdå¤çè¿çåçå¨å¯è£ 载模åä¸çä¸ä¸ªä¿æ¤é误ä¾åï¼
Aug 29 09:51:01 blizard kernel: Unable to handle kernel paging request at virtual address f15e97cc
Aug 29 09:51:01 blizard kernel: current->tss.cr3 = 0062d000, %cr3 = 0062d000
Aug 29 09:51:01 blizard kernel: *pde = 00000000
Aug 29 09:51:01 blizard kernel: Oops: 0002
Aug 29 09:51:01 blizard kernel: CPU: 0
Aug 29 09:51:01 blizard kernel: EIP: 0010:[oops:_oops+16/3868]
Aug 29 09:51:01 blizard kernel: EFLAGS: 00010212
Aug 29 09:51:01 blizard kernel: eax: 315e97cc ebx: 003a6f80 ecx: 001be77b edx: 00237c0c
Aug 29 09:51:01 blizard kernel: esi: 00000000 edi: bffffdb3 ebp: 00589f90 esp: 00589f8c
Aug 29 09:51:01 blizard kernel: ds: 0018 es: 0018 fs: 002b gs: 002b ss: 0018
Aug 29 09:51:01 blizard kernel: Process oops_test (pid: 3374, process nr: 21, stackpage=00589000)
Aug 29 09:51:01 blizard kernel: Stack: 315e97cc 00589f98 0100b0b4 bffffed4 0012e38e 00240c64 003a6f80 00000001
Aug 29 09:51:01 blizard kernel: 00000000 00237810 bfffff00 0010a7fa 00000003 00000001 00000000 bfffff00
Aug 29 09:51:01 blizard kernel: bffffdb3 bffffed4 ffffffda 0000002b 0007002b 0000002b 0000002b 00000036
Aug 29 09:51:01 blizard kernel: Call Trace: [oops:_oops_ioctl+48/80] [_sys_ioctl+254/272] [_system_call+82/128]
Aug 29 09:51:01 blizard kernel: Code: c7 00 05 00 00 00 eb 08 90 90 90 90 90 90 90 90 89 ec 5d c3
Dr. G.W. Wettstein Oncology Research Div. Computing Facility
Roger Maris Cancer Center INTERNET: greg@wind.rmcc.com
820 4th St. N.
Fargo, ND 58122
Phone: 701-234-7556
å污æçå æ ¸
ä¸äºoopsæ¥åå¨ç¨åºè®°æ°å¨ä¹åå
å«å符串’Tainted: ‘ãè¿è¡¨æå
æ ¸å·²ç»è¢«ä¸äºä¸è¥¿ç»æ±¡
æäºã 该å符串ä¹åç´§è·çä¸ç³»åçä½ç½®ææçå符ï¼æ¯ä¸ªä»£è¡¨ä¸ä¸ªç¹å®ç污æå¼ã
1ï¼’G’å¦æææè£
è½½ç模åé½æGPLæç¸å®¹ç许å¯è¯ï¼’P’å¦æè£
è½½äºä»»ä½çä¸æ模åã
没æ模åMODULE_LICENSEæè
带æinsmod认为æ¯ä¸GPLä¸ç¸å®¹ççMODULE_LICENSEç模å被
认å®æ¯ä¸æçã
2ï¼’F’å¦ææä»»ä½éè¿âinsmod -fâ被强å¶è£ è½½ç模åï¼’ ‘å¦æææ模åé½è¢«æ£å¸¸è£ è½½ã
3ï¼’S’å¦æoopsåçå¨SMPå
æ ¸ä¸ï¼è¿è¡äºæ²¡æè¯æå®å
¨è¿è¡å¤å¤çå¨ç硬件ã å½åè¿ç§
æ
åµä»
éäºå ç§ä¸æ¯æSMPçéé¾å¤çå¨ã
4ï¼’R’å¦æ模åéè¿âinsmod -fâ被强å¶è£ 载2 ‘å¦æææ模åé½è¢«æ£å¸¸è£ è½½ã
5ï¼’M’å¦æä»»ä½å¤çå¨æ¥åäºæºå¨æ£æ¥å¼å¸¸ï¼’ ‘å¦æ没æåçæºå¨æ£æ¥å¼å¸¸ã
6ï¼’B’å¦æ页éæ¾å½æ°åç°äºä¸ä¸ªé误ç页å¼ç¨æè ä¸äºéé¢æç页æ å¿ã
7ï¼’U’å¦æç¨æ·æè ç¨æ·åºç¨ç¨åºç¹å«è¯·æ±è®¾ç½®æ±¡ææ å¿ï¼å¦å’ ‘ã
8ï¼’D’å¦æå æ ¸ååæ»æï¼æ¯å¦æOOPSæè BUGã
使稒Tainted: ‘å符串ç主è¦åå æ¯è¦åè¯å
æ ¸è°è¯è
ï¼è¿æ¯å¦æ¯ä¸ä¸ªå¹²åçå
æ ¸äº¦æå
çäºä»»ä½çä¸æ£å¸¸çäºã污ææ¯æ°¸ä¹
çï¼å³ä½¿åºéç模åå·²ç»è¢«å¸è½½äºï¼æ±¡æå¼ä»ç¶åå¨ï¼
以表æå
æ ¸ä¸åå¼å¾ä¿¡ä»»ã