A more accurate System.map, including modules

Keith Owens (kaos@ocs.com.au)
Mon, 22 Sep 1997 03:26:37 +1000


ftp://ftp.ocs.com.au/make_System_map.pl.gz (3.5K) builds a more
accurate map from your existing System.map, the information from
/proc/ksyms and your modules directories. It is a quick and dirty
prototype which will be recoded in C later. I'd like people to hit on
this and mail kaos@ocs.com.au with any bugs, not the kernel list
please.

Current oops processing suffers from some problems.
* ksymoops is written in C++ (the only program in the kernel that
is).
* ksymoops only reads System.map so it has no idea where modules are.
* klogd has not handled loaded modules on 2.1.x for some time (cannot
seek /dev/kmem).
* klogd cannot always decode the oops, some errors are so bad that
klogd is effectively dead.
* Even when klogd can run, /proc/ksyms only shows exported symbols
for modules so klogd cannot resolve addresses for static procs in
modules. In contrast, System.map shows all procs, both static and
extern.
* Decoding an oops on a machine other than the one it occurred on is
awkward, due to assumptions about where files are located.

To overcome these problems, this program reads System.map or
equivalent, /proc/ksyms or equivalent and the raw modules. It then
outputs a new, dynamic System.map containing the symbols from the
input map plus all the symbols from the currently loaded modules,
adjusted to where the modules were loaded. This map can then be fed
into your favourite oops decoder.

Typical invocation:

make_System_map.pl /proc/ksyms /System.map \
/lib/modules/`uname -r`/*/*.o > /tmp/map
/usr/src/linux/scripts/ksymoops /tmp/map < oops_log