⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ksymoops.8

📁 kdb-v4.3-2.4.20-common-1.bz2 键盘的驱动啊 克里斯蒂警方可死了地方军
💻 8
📖 第 1 页 / 共 3 页
字号:
unavailable.Do you detect a slight note of inconsistency in the above?.SH ADDRESS TO SYMBOL CONVERSION.PAddresses are converted to symbols based on the symbols in vmlinux,/proc/ksyms, object files for modules and System.map, or as many ofthose sources as ksymoops was told to read.  ksymoops uses as manysymbol sources as you can provide, does cross checks between thevarious sources to identify any discrepancies and builds a merged mapcontaining all symbols, including loaded modules where possible..PSymbols which end in _R_xxxxxxxx (8 hex digits) or _R_smp_xxxxxxxx aresymbol versioned, see genksyms(8).  ksymoops strips the _R_... whenbuilding its internal system map..PModule symbols do not appear in vmlinux nor System.map and onlyexported symbols from modules appear in /proc/ksyms.  Thereforeksymoops tries to read module symbols from the object files specifiedby \fB-o\fR.  Without these module symbols, diagnosing a problem in amodule is almost impossible..PThere are many problems with module symbols, especially with versionsof insmod(8) up to and including 2.1.121.  Some modules do not export\fIany\fR symbols, there is no sign of them in /proc/ksyms so they areeffectively invisible.  Even when a module exports symbols, ittypically only exports one or two, not the complete list that is reallyneeded for Oops diagnosis.  ksymoops can build a complete symbol tablefrom the object module but it has to.HP 4m(a)\ Know that the module is loaded..HP 4m(b)\ Find the correct object file for that module..HP 4m(c)\ Convert section and symbol data from the module into kerneladdresses..PIf a module exports no symbols then there is no way for ksymoops toobtain any information about that module.  lsmod says it is loaded butwithout symbols, ksymoops cannot find the corresponding object file normap offsets to addresses.  Sorry but that is the way it is, if you Oopsin a module that displays no symbols in ksyms, forget it\ :(..PWhen a module exports symbols, the next step is to find the object filefor that module.  In most cases the loaded module and the object filehas the same basename but that is not guaranteed.  For example,  insmod uart401 -o xyz.brwill load uart401.o from your module directories but store it as xyz.Both ksyms and lsmod say module name 'xyz' with no indication that theoriginal object file was uart401.  So ksymoops cannot just use themodule name from ksyms or lsmod, it has to do a lot more work to findthe correct object.  It does this by looking for a unique match betweenexported symbols and symbols in the module objects..PFor every file obtained from the \fB-o\fR option(s), ksymoops extractsall symbols (both static and external), using nm(1).  It then runs theexported module symbols in ksyms and, for every exported module symbol,it does a string compare of that symbol against every symbol in everyobject.  When ksymoops finds a module symbol that is exported in ksymsand appears exactly \fBonce\fR amongst all the \fB-o\fR objects then ithas to assume that the object is the one used to load the module.  Ifksymoops cannot find any match for any exported symbol in a module orfinds more than one match for every exported symbol in a module then itcannot determine which object was actually loaded..PAfter ksymoops has matched a loaded module against an object using aunique symbol, it still has to calculate addresses for the symbols fromthe object.  To do this, ksymoops first needs the start address of thetext, data and read only data sections in the loaded module.  Given thestart address of a section, ksymoops can calculate the kernel addressof every symbol in that section and add the symbols to the combinedsystem map, this includes symbols that are not exported.  Unfortunatelythe start address of a section is only available if the module exportsat least one symbol from that section.  For example, if a module onlyexports text symbols (the most common case) then ksymoops can onlycalculate the start of the text section and has to discard symbols fromthe data and read only data sections for that module, reducing theinformation available for diagnosis..PWhen multiple symbol sources are available and those symbol sourcescontain a kernel version number, ksymoops compares all the versionnumbers.  It flags a warning if there is any mismatch.  One of the morecommon causes of problems is force loading a module from one kernelinto a different kernel.  Even if it was deliberate, it needs to behighlighted for diagnosis..PWhen both ksyms and lsmod are available, the list of modules extractedfrom ksyms is compared against the list of modules from lsmod.  Anydifference is flagged as a warning, it typically indicates invisiblemodules.  However it can also be caused by a mismatch between ksyms andlsmod..PWhen multiple symbol sources are available, ksymoops does cross checksbetween them.  Each check is only performed if both symbol sources arepresent and non-empty.  Every symbol in the first source should appearin the second source and should have the same address.  Where there isany discrepancy, one of the sources takes precedence, the precedence issomewhat arbitrary.  Some discrepancies are silently ignored becausethey are special cases but the vast majority of symbols are expected tomatch..HP 2m*\ Exported module symbols in ksyms are compared against the symbolsin the corresponding object file.  ksyms takes precedence..HP 2m*\ The kernel (non module) symbols from ksyms are compared againstvmlinux.  vmlinux takes precedence..HP 2m*\ The symbols from System.map are compared against vmlinux.  vmlinuxtakes precedence..HP 2m*\ The symbols from vmlinux are compared against System.map.  vmlinuxtakes precedence.  These two sources are compared in both directions,they should be identical..HP 2m*\ The kernel (non module) symbols from ksyms are compared againstSystem.map.  System.map takes precedence..PAfter reading and cross checking all the symbol sources, they aremerged into a single system map.  Duplicate symbols, registers (type a)and static 'gcc2_compiled.' symbols are dropped from the merged map.Any symbols with an address below 4096 are discarded, these are symbolslike Using_Versions which has an address of 0..PGiven all the above processing and deduction, it is obvious that themerged system map cannot be 100% reliable, which means that conversionof addresses to symbols cannot be reliable.  The addresses are validbut the symbol conversion is only as good as the symbol sources you fedinto ksymoops..P/proc/ksyms and /proc/lsmod are volatile so unless ksymoops gets thecurrent ksyms, you always have to question the validity of the moduleinformation.  The only way I know to (almost) guarantee valid ksyms isto use ksymoops in one shot mode (see option \fI-1\fR).  Then ksymoopsreads the log and decodes Oops in real time..SH KSYMOOPS SUPPORT IN MODUTILS.PModutils 2.3.1 onwards has support to make oops debugging easier,especially for modules.  See insmod(8) for details.  If you wantautomatic snapshots of ksyms and lsmod data as modules are loaded andunloaded, create /var/log/ksymoops, it should be owned by root withmode 644 or 600.  If you do not want automatic snapshots, do not createthe directory.  A script (insmod_ksymoops_clean) is provided bymodutils to delete old versions, this should be run by cron once a day..SH OUTPUT.Pksymoops prints all lines that contain text which might indicate akernel problem.  Due the complete lack of standards in kernel errormessages, I cannot guarantee that all problem lines are printed.  Ifyou see a line in your logs which ksymoops should extract but does not,contact the maintainer..PWhen ksymoops sees EIP/PC/NIP/TPC lines, call trace lines or codelines, it prints them and stores them for later processing.  When thecode line is detected, ksymoops converts the EIP/PC/NIP/TPC address andthe call trace addresses to symbols.  These lines have ';' after theheader instead of ':', just in case anybody wants to feed ksymoopsoutput back into ksymoops, these generated lines are ignored..PFormatted data for the program counter, trace and code is only outputwhen the Code: line is seen.  If any data has been stored for laterformatting and more than 5 lines other than Oops text or end of fileare encountered then ksymoops assumes that the Code: line is missing orgarbled and dumps the formatted data anyway.  That should be fail safebecause the Code: line (or its equivalent) signals the end of the Oopsreport.  Except for sparc64 on SMP which has a register dump\fIafter\fR the code.  ksymoops tries to cater for this exception.Sigh..PAddresses are converted to symbols wherever possible.  For example.nf  >>EIP; c0113f8c <sys_init_module+49c/4d0>  Trace; c011d3f5 <sys_mremap+295/370>  Trace; c011af5f <do_generic_file_read+5bf/5f0>  Trace; c011afe9 <file_read_actor+59/60>  Trace; c011d2bc <sys_mremap+15c/370>  Trace; c010e80f <do_sigaltstack+ff/1a0>  Trace; c0107c39 <overflow+9/c>  Trace; c0107b30 <tracesys+1c/23>  Trace; 00001000 Before first symbol.fi.PEach converted address is followed by the nearest symbol below thataddress.  That symbol is followed by the offset of the address from thesymbol.  The value after '/' is the "size" of the symbol, thedifference between the symbol and the next known symbol.  So  >>EIP; c0113f8c <sys_init_module+49c/4d0>means that the program counter was c0113f8c.  The previous symbol issys_init_module, the address is 0x49c bytes from the start of thesymbol, sys_init_module is 0x4d0 bytes long.  If you prefer decimaloffsets and lengths see option \fB-x\fR.  If the symbol comes from amodule, it is prefixed by '[\fImodule_name\fR]', several modules havethe same procedure names..PThe use of 'EIP' for program counter above is for ix86.  ksymoops triesto use the correct acronym for the program counter (PC, NIP, TPC etc.)but if it does not recognize the target hardware, it defaults to EIP..PWhen a Code: line is read, ksymoops extracts the code bytes.  It usesthe program counter line together with the code bytes to generate asmall object file in the target architecture.  ksymoops then invokesobjdump(1) to disassemble this object file.  The human readableinstructions are extracted from the objdump output and printed withaddress to symbol conversion.  If the disassembled code does not looksensible, see the \fI-e\fR, \fI-a\fR and \fI-t\fR options..P\fBTAKE ALL SYMBOLS, OFFSETS AND LENGTHS WITH A PINCH OF SALT!\fRThe addresses are valid but the symbol conversion is only as good asthe input you gave ksymoops.  See all the problems in "ADDRESS TO SYMBOLCONVERSION" above.  Also the stack trace is potentially ambiguous.  Thekernel prints any addresses on the stack that \fBmight\fR be validaddresses.  The kernel has no way of telling which (if any) of theseaddresses are real and which are just lying on the stack from previousprocedures.  ksymoops just decodes what the kernel prints..SH ENVIRONMENT VARIABLES.TPKSYMOOPS_NMPath for nm, defaults to ${INSTALL_PREFIX}/bin/${CROSS}nm..TPKSYMOOPS_FINDPath for find, defaults to /usr/bin/find..TPKSYMOOPS_OBJDUMPPath for objdump, defaults to ${INSTALL_PREFIX}/bin/${CROSS}objdump..SH CROSS SYSTEM OOPS DIAGNOSIS.PTo process an Oops from one system on another, you need access to allthe symbol sources, including modules, System.map, ksyms etc.  If thetwo systems are different hardware, you also need versions of the nmand objdump commands that run on your system but handle the targetsystem.  You also need versions of libbfd, libopcodes, and libibertythat handle the target system.  Consult the binutils documentationfor instructions on how to build cross system versions of theseutilities..PTo override the default versions of nm and find, use the environmentvariables above.  To use different versions of libbfd and libiberty,use the --rpath option when linking ksymoops or the LD_LIBRARY_PATHenvironment variable when running ksymoops.  See the info pages for ldand /usr/doc/glibc*/FAQ.You can also build a version of ksymoops that is dedicated to the crosscompile environment by using the BFD_PREFIX, DEF_TARGET, DEF_ARCH andCROSS options at build time.See INSTALL in the ksymoops source package for more details..SH DIAGNOSTICS.HP 4m0\ -\ normal..HP 4m1\ -\ error(s) or warning(s) issued, results may not be reliable..HP 4m2\ -\ fatal error, no useful results..HP 4m3\ -\ One shot mode, end of input was reached without seeing an Oops..SH BUGSBecause of the plethora of possible kernel error and informationstrings, ksymoops's pattern matching sometimes prints lines that arenot errors at all.  For example, a line starting with 3c589 matches thepattern for a call trace line, both start with at least 4 hex digits.Humans are smarter than programs, ignore spurious lines..SH AUTHORSKeith Owens <kaos@ocs.com.au> - maintainer.Patches from Jakub Jelinek <jj@sunsite.mff.cuni.cz>, Richard Henderson<rth@twiddle.net>..SH HISTORYThe original ksymoops.cc was written by Greg McGary<gkm@magilla.cichlid.com> and updated by Andreas Schwab<schwab@issan.informatik.uni-dortmund.de>.  That version required C++and supported only ix86 and m68k..PTo get the equivalent of the old ksymoops.cc (no vmlinux, no modules,no ksyms, no System.map) use ksymoops\ -VKLOM.  Or to just readSystem.map, ksymoops\ -VKLO\ -m\ mapfile..SH SEE ALSO.Pfind(1),  insmod(8), nm(1), objdump(1), rmmod(8), dmesg(8),genksyms(8), syslogd(8).  bfd info files.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -