xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Doug Goldstein <cardoe@cardoe.com>
To: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
	Keir Fraser <keir@xen.org>, Jan Beulich <jbeulich@suse.com>,
	xen-devel@lists.xen.org
Subject: Re: [RFC PATCH 2/2] build: convert crash_debug to Kconfig
Date: Fri, 25 Mar 2016 16:02:56 -0500	[thread overview]
Message-ID: <56F5A780.9080502@cardoe.com> (raw)
In-Reply-To: <20160325194927.GD14689@char.us.oracle.com>


[-- Attachment #1.1.1: Type: text/plain, Size: 4345 bytes --]

On 3/25/16 2:49 PM, Konrad Rzeszutek Wilk wrote:
> On Thu, Mar 24, 2016 at 11:48:19AM -0500, Doug Goldstein wrote:
>> Convert the crash_debug option to Kconfig as CONFIG_CRASH_DEBUG. This
>> was previously togglable on the command line so this adds a message for
>> users enabling it from the command line to tell them to enable it from
>> make menuconfig.
>>
>> Signed-off-by: Doug Goldstein <cardoe@cardoe.com>
>> ---
>> This is an example of using the debug menu.
>>
>>
>> CC: Keir Fraser <keir@xen.org>
>> CC: Jan Beulich <jbeulich@suse.com>
>> CC: Andrew Cooper <andrew.cooper3@citrix.com>
>> ---
>>  docs/misc/crashdb.txt          |  4 ++--
>>  xen/Kconfig.debug              | 11 +++++++++++
>>  xen/Rules.mk                   |  5 +++--
>>  xen/arch/x86/Makefile          |  3 +--
>>  xen/arch/x86/x86_64/Makefile   |  2 +-
>>  xen/common/Makefile            |  2 +-
>>  xen/include/asm-x86/debugger.h |  2 +-
>>  xen/include/xen/gdbstub.h      |  2 +-
>>  8 files changed, 21 insertions(+), 10 deletions(-)
>>
>> diff --git a/docs/misc/crashdb.txt b/docs/misc/crashdb.txt
>> index b41a538..9733666 100644
>> --- a/docs/misc/crashdb.txt
>> +++ b/docs/misc/crashdb.txt
>> @@ -5,7 +5,7 @@ Xen has a simple gdb stub for doing post-mortem debugging i.e. once
>>  you've crashed it, you get to poke around and find out why.  There's
>>  also a special key handler for making it crash, which is handy.
>>  
>> -You need to have crash_debug=y set when compiling , and you also need
>> +You need to have CRASH_DEBUG=y set when compiling, and you also need
>>  to enable it on the Xen command line, eg by gdb=com1.
>>  
>>  If you need to have a serial port shared between gdb and the console,
>> @@ -19,7 +19,7 @@ if you have a simple null modem connection between the test box and
>>  the workstation, and aren't using a H/L split console:
>>  
>>    * Set debug=y in Config.mk
>> -  * Set crash_debug=y in xen/Rules.mk
>> +  * Set CRASH_DEBUG=y with `make -C xen menuconfig`
>>    * Make the changes in the attached patch, and build.
>>    * Arrange to pass gdb=com1 as a hypervisor command line argument
>>      (I already have com1=38400,8n1 console=com1,vga sync_console)
>> diff --git a/xen/Kconfig.debug b/xen/Kconfig.debug
>> index 36890bd..3336a64 100644
>> --- a/xen/Kconfig.debug
>> +++ b/xen/Kconfig.debug
>> @@ -4,3 +4,14 @@ menuconfig DEBUG
>>  	---help---
>>  	  If you want to debug Xen say Y and select any additional debugging
>>  	  support options.
>> +
>> +if DEBUG
> 
> Perhaps if !defined then atuomatically enable it? Looking at Config.mk
> it seems you could do crash_debug without debug=y?

debug=y unfortunately is more than just a "meta" option that selects
verbose=y and frame_pointer=y. It also turns off NDEBUG so that debug
messages appear. I'm not sure how that should be mapped in the context
of this patch. Should the messages be enabled when DEBUG is enabled or
should there be another option?

If debug messages are enabled with DEBUG that would certainly be a
behavior change since now someone could have crash_debug=y debug=n but
I'm not sure if that's desired?

> 
> Why is this called crash_debug and not 'crash_gdb' ..? Ah [after reading the docs]
> it can't do breakpoints or any of that. Just to pour over the data after a crash.
> Ah, you can resume the hypervisor after this. OK, definitly not for field
> analysis.
> 
> And kexec/kdump is much more powerful than this.

yeah I wondered that myself as well and came to the conclusion it was
limited. Good point about kexec/kdump. I should definitely update the
description to be more verbose.

> 
> 
>> +
>> +config CRASH_DEBUG
>> +	bool "Crash Debugging Support"
>> +	depends on X86
>> +	---help---
>> +	  If you want to be able to attach gdb to Xen to be able to debug
>> +	  Xen if it crashes then say Y.
> 
> Should it have a link to the docs ? On how to use it?

yeah I think maybe just pointing someone to docs/misc/crashdb.txt cause
its not immediately obvious that's the doc file to go with crash_debug.

> 
> And maybe mention that kexec/kdump is better suited for capturing the whole
> machine and one can do post-mortem analysis much more intensly?

Yeah that's a really good point. I didn't think of that.


-- 
Doug Goldstein


[-- Attachment #1.2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 959 bytes --]

[-- Attachment #2: Type: text/plain, Size: 126 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

  reply	other threads:[~2016-03-25 21:02 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-24 16:48 [RFC PATCH 1/2] build: add debug menu to Kconfig Doug Goldstein
2016-03-24 16:48 ` [RFC PATCH 2/2] build: convert crash_debug " Doug Goldstein
2016-03-25 19:49   ` Konrad Rzeszutek Wilk
2016-03-25 21:02     ` Doug Goldstein [this message]
2016-03-29  8:50       ` Jan Beulich
2016-03-30 15:38         ` Doug Goldstein
2016-04-08 23:24       ` Jan Beulich
2016-04-08 23:30         ` Jan Beulich
2016-03-25 19:42 ` [RFC PATCH 1/2] build: add debug menu " Konrad Rzeszutek Wilk
2016-03-25 20:59   ` Doug Goldstein
2016-03-30 15:29     ` Dario Faggioli
2016-04-08 23:18 ` Jan Beulich

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=56F5A780.9080502@cardoe.com \
    --to=cardoe@cardoe.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=jbeulich@suse.com \
    --cc=keir@xen.org \
    --cc=konrad.wilk@oracle.com \
    --cc=xen-devel@lists.xen.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).