Re: A more accurate System.map, including modules

Richard Gooch (rgooch@atnf.CSIRO.AU)
Mon, 22 Sep 1997 09:01:56 +1000


Keith Owens writes:
> 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

This is a good step forward, but it requires that after you get an
oops enough of the system is still left running that you can run
ksymoops. I've had a few cases where syslogd is still logging, but I
can't run commands. Going back later (after a reboot) and running
make_System_map.pl doesn't work because the location of modules has
changed. This is especially the case for people running kerneld.
What about modifying klogd to do the things ksymoops does?

Regards,

Richard....