From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mukesh Rathor Subject: Re: [PATCH 2/4] dbg_rw_guest_mem: Enable debug log output Date: Mon, 6 Jan 2014 17:04:18 -0800 Message-ID: <20140106170418.55208f82@mantra.us.oracle.com> References: <1388857936-664-1-git-send-email-dslutz@verizon.com> <1388857936-664-3-git-send-email-dslutz@verizon.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1388857936-664-3-git-send-email-dslutz@verizon.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Don Slutz Cc: Keir Fraser , Ian Campbell , Stefano Stabellini , George Dunlap , Ian Jackson , xen-devel@lists.xen.org, Jan Beulich List-Id: xen-devel@lists.xenproject.org On Sat, 4 Jan 2014 12:52:14 -0500 Don Slutz wrote: > This also fixes the old debug output to compile and work if DBGP1 > and DBGP2 are defined like DBGP3. > > Signed-off-by: Don Slutz > --- > xen/arch/x86/debug.c | 41 +++++++++++++++++++++++++++++++---------- > 1 file changed, 31 insertions(+), 10 deletions(-) > > diff --git a/xen/arch/x86/debug.c b/xen/arch/x86/debug.c > index eceb805..2e0a05a 100644 > --- a/xen/arch/x86/debug.c > +++ b/xen/arch/x86/debug.c > @@ -41,6 +41,12 @@ > #define DBGP2(...) ((void)0) > #endif > > +#ifdef XEN_GDBSX_DEBUG3 > +#define DBGP3(...) gdprintk(XENLOG_DEBUG, __VA_ARGS__) > +#else > +#define DBGP3(...) ((void)0) > +#endif > + Umm... some hostorical perspective... this file is shared by both gdbsx, and kdb, and possibly any future debug type tools. While gdbsx got merged, kdb did not. So how about, just define say dbg_debug to replace kdbdbg, (please don't call it "debug" - I hate using words that grep million results), and then just change DBGP*. Also looks like DBGP is not used anywhere, so we only need two... static volatile int dbg_debug; #define DBGP(...) {(dbg_debug) ? printk(__VA_ARGS__) : 0;} #define DBGP1(...) {(dbg_debug > 1) ? printk(__VA_ARGS__) : 0;} This allows us to not need XEN_GDBSX_DEBUG3, and also the debug can be enabled dynamically without recompile (in my case, via kdb). thanks, mukesh