synchronize console on BUG()
RFC PATCH 1/1 synchronize console on BUG()
The following patch syncs (and unsync) the console while we are in the BUG() macro.
The separate externs (which I dislike) for these console calls are there because including <xen/console.h> breaks all sorts of files, any suggestions on how to solve this is welcome.
-JX
--
xen/include/xen/lib.h +6 -2
@@ -8,10 +8,14 @@#include <xen/xmalloc.h> #include <xen/string.h> -#define BUG () do { \ +extern void console_start_sync (void ); +extern void console_end_sync (void ); +#define BUG () do { \ + console_start_sync(); \ debugtrace_dump(); \ - printk("BUG at %s:%d\n", __FILE__, __LINE__); \ + printk("BUG at %s:%d\n", __FILE__, __LINE__); \ FORCE_CRASH(); \ + console_end_sync(); \ } while ( 0 )#define BUG_ON (_p) do { if (_p) BUG(); } while ( 0 )
Quoted 7 lines · In article <[email protected]> you wrote:
The following patch syncs (and unsync) the console while we are in the
BUG()macro.The separate externs (which I dislike) for these console calls are there because including <
xen/console.h> breaks all sorts of files, any suggestions on how to solve this is welcome.
Is this breakage because <xen/console.h> doesn't #include all the headers for the stuff it uses itself? If so could someone coment on if that is intentional, or if it is something that (generally) wants fixing.
Signature · 2 lines
Horms H: http://www.vergenet.net/~horms/ W: http://www.valinux.co.jp/en/
Quoted 5 lines · Horms
Quoted 4 lines · In article <[email protected]> you wrote:
The following patch syncs (and unsync) the console while we are in the
BUG()macro.
Quoted 9 lines
Quoted 3 lines
The separate externs (which I dislike) for these console calls are there because including <
xen/console.h> breaks all sorts of files, any suggestions on how to solve this is welcome.Is this breakage because <
xen/console.h> doesn't #include all the headers for the stuff it uses itself? If so could someone coment on if that is intentional, or if it is something that (generally) wants fixing.
Methinks it includes to much, for some of the more finikier files.
My suggestion is that we should have a minimal header that contains prototypes for console_sync(), panic(), ASSERT, BUG, and whatever else there is (perhaps remove the redundant ones if there are any).
thoughts?
-JX
Quoted 20 lines · Jimi Xenidis
Quoted 11 lines · Horms
Quoted 9 lines · In article <[email protected]> you wrote:
The following patch syncs (and unsync) the console while we are in the
BUG()macro.The separate externs (which I dislike) for these console calls are there because including <
xen/console.h> breaks all sorts of files, any
suggestions on how to solve this is welcome.Quoted 5 lines
Is this breakage because <
xen/console.h> doesn't #include all the headers for the stuff it uses itself? If so could someone coment on if that is intentional, or if it is something that (generally) wants fixing.
Quoted 4 lines
Methinks it includes to much, for some of the more finikier files. My suggestion is that we should have a minimal header that contains prototypes for
console_sync(),panic(), ASSERT, BUG, and whatever else there is (perhaps remove the redundant ones if there are any).
That sounds reasonable, and may even speed up builds to some small extent. However, regardless of the size of an include, it really ought to be includable.
Signature · 2 lines
Horms H: http://www.vergenet.net/~horms/ W: http://www.valinux.co.jp/en/