Re: [PATCH] BUG preserve registers

From: Linus Torvalds (torvalds@transmeta.com)
Date: Sun Feb 10 2002 - 00:03:00 EST


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

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Fri Feb 15 2002 - 21:00:30 EST