Re: Hardwired drivers are going away?

Keith Owens
2002-01-21T01:54:11Z

On Sun, 20 Jan 2002 17:30:12 -0800,
Andrew Morton <akpm@zip.com.au> wrote:
>I suspect none of these "Heads" spend much time in protracted
>email debug sessions. Because the *first* thing you do is
>ask the tester to compile the relevant driver into the
>kernel.
>
>The problems which the removal of this option will cause include:
>
>1: Inability to look up symbols in the kernel elf image.
>2: Breaks the kernel profiler
>3: breaks kgdb
>4: breaks ksymoops.
>
>How often have we seen nonsensical backtraces here because
>modules were involved? Possibly we can include a table
>of module base addresses in the Oops output and teach ksymoops
>about it.

You see nonsensical backtraces because people persist in using the oops
decode option of klogd which is broken when faced with modules. Turn
off klogd oops (klogd -x) and you get a raw backtrace which ksymoops
can handle. Guess why these entries are in /proc/ksyms?

c48a2300 __insmod_3c589_cs_S.bss_L4 [3c589_cs]
c48a0000 __insmod_3c589_cs_O/lib/modules/2.4.17-xfs/kernel/drivers/net/pcmcia/3c589_cs.o_M3C332CFF_V132113 [3c589_cs]
c48a22a0 __insmod_3c589_cs_S.data_L96 [3c589_cs]
c48a1820 __insmod_3c589_cs_S.rodata_L1152 [3c589_cs]
c48a0060 __insmod_3c589_cs_S.text_L6064 [3c589_cs]

ksymoops uses the __insmod entries to work out exactly where each
module is, it gives an accurate backtrace with modules. man insmod for
details.

Kernel debuggers like kgdb and kdb use kallsyms which has full support
for modules. kgdb can also use the __insmod entries in /proc/ksyms to
tell gdb where each module was loaded.

ksymoops has a save map option (-s) which writes out the combined
system map, including the kernel and all symbols from all modules.

Sure, a dynamic system requires a little more work, but it has all been
done. Just kill the broken klogd code so it stops corrupting log data.