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 -- diff -r 1da8f53ce65b xen/include/xen/lib.h --- a/xen/include/xen/lib.h Tue Jun 27 18:24:08 2006 +0100 +++ b/xen/include/xen/lib.h Wed Jun 28 09:56:34 2006 -0400 @@ -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 ) _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
In article <E1Fvahf-0001xr-ME@localhost.localdomain> 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. -- Horms H: http://www.vergenet.net/~horms/ W: http://www.valinux.co.jp/en/ _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Jimi Xenidis
2006-Jun-29 11:22 UTC
[Xen-devel] Re: [RFC][PATCH] synchronize console on BUG()
On Jun 29, 2006, at 6:01 AM, Horms wrote:> In article <E1Fvahf-0001xr-ME@localhost.localdomain> 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. >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 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
On Thu, Jun 29, 2006 at 07:22:52AM -0400, Jimi Xenidis wrote:> > On Jun 29, 2006, at 6:01 AM, Horms wrote: > > >In article <E1Fvahf-0001xr-ME@localhost.localdomain> 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. > > > > 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. -- Horms H: http://www.vergenet.net/~horms/ W: http://www.valinux.co.jp/en/ _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel