Re: [PATCH] BUG preserve registers

Linus Torvalds
2002-02-10T03:17:46Z

On Sun, 10 Feb 2002, Alan Cox wrote:
>
> I also don't understand what the problem you are trying to solve is. If you
> want to debug the kernel you build with debug verbose. If not you don't.

No.

With the old stupid code, if you wanted to debug the kernel, you had to
make sure that the VERBOSE flag was _off_.

Because if it wasn't off, the printk's that triggered would totally
destroy the register state at the point of the BUG, which often hides real
information (the register state is what tends to contain the exact flags
that were tested for the bug).

> With the symbol table you can still easily trace down BUG events.

.. and with VERBOSE it end sup often being much simpler.

Also note that if you want to save space, what you should do is disable
BUG() altogether. In a real embedded device where memory is that tight,
the output generally won't make it anywhere anyway.

That will speed up the kernel a bit too (don't test for conditions that
cannot happen).

So don't be a proponent for stupidity. Which the old CONFIG_DEBUG_VERBOSE
was.

Linus