From: Don Slutz <dslutz@verizon.com>
To: Ian Campbell <Ian.Campbell@citrix.com>
Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>,
George Dunlap <george.dunlap@eu.citrix.com>,
Don Slutz <Don@CloudSwitch.com>,
Ian Jackson <ian.jackson@eu.citrix.com>,
Don Slutz <dslutz@verizon.com>,
xen-devel@lists.xen.org
Subject: Re: [PATCH] Add xentrace/xen_crash.
Date: Tue, 15 Oct 2013 11:25:13 -0400 [thread overview]
Message-ID: <525D5E59.8030102@terremark.com> (raw)
In-Reply-To: <1381763583.24708.124.camel@kazak.uk.xensource.com>
On 10/14/13 11:13, Ian Campbell wrote:
> On Mon, 2013-10-14 at 10:07 -0400, Don Slutz wrote:
>> From: Don Slutz <Don@CloudSwitch.com>
>>
>> This allows crash to connect to a domU. Usage:
>>
>> usage: xen_crash <domid> [<optional port>]
>>
>> xen_crash 1&
>> crash localhost:5001 /usr/lib/debug/lib/modules/3.8.11-100.fc17.x86_64/vmlinux
>>
>> The domU will be paused while crash is connected. Currently the code exits when crash disconnects.
> Could you supply some docs please, ideally a simple man page but a txt
> would do too. Under docs/ probably so they get published on xenbits etc.
Sure.
>> diff --git a/tools/xentrace/Makefile b/tools/xentrace/Makefile
>> index 63b09c0..a2313c6 100644
>> --- a/tools/xentrace/Makefile
>> +++ b/tools/xentrace/Makefile
>> @@ -7,7 +7,7 @@ CFLAGS += $(CFLAGS_libxenctrl)
>> LDLIBS += $(LDLIBS_libxenctrl)
>>
>> BIN = xentrace xentrace_setsize
>> -LIBBIN = xenctx
>> +LIBBIN = xenctx xen_crash
> It appears to be x86 specific, at least right now.
>
> So please do something like:
> LIBBIN-$(CONFIG_X86) += xen_crash
> ...
>
> LIBBIN += $(LIBBIN-y)
Sure.
>> diff --git a/tools/xentrace/xen_crash.c b/tools/xentrace/xen_crash.c
>> new file mode 100644
>> index 0000000..6a4bb34
>> --- /dev/null
>> +++ b/tools/xentrace/xen_crash.c
>> @@ -0,0 +1,697 @@
>> +/******************************************************************************
>> + * tools/xentrace/xen_crash.c
>> + *
>> + * Connect crash to DOMu.
>> + *
>> + * Copyright (C) 2012 by Cloud Switch, Inc.
>> + *
>> + */
>> +
>> +#include <ctype.h>
>> +#include <time.h>
>> +#include <stdlib.h>
>> +#include <sys/mman.h>
>> +#include <stdio.h>
>> +#include <sys/types.h>
>> +#include <sys/socket.h>
>> +#include <sys/ioctl.h>
>> +#include <sys/time.h>
>> +#include <sys/stat.h>
>> +#include <netinet/in.h>
>> +#include <netdb.h>
>> +#include <fcntl.h>
>> +#include <unistd.h>
>> +#include <errno.h>
>> +#include <signal.h>
>> +#include <string.h>
>> +#include <inttypes.h>
>> +#include <getopt.h>
>> +
>> +#include "xenctrl.h"
>> +#include <xen/foreign/x86_32.h>
>> +#include <xen/foreign/x86_64.h>
>> +#include <xen/hvm/save.h>
>> +
>> +xc_interface *xc_handle = 0;
>> +int domid = 0;
>> +int debug = 0;
>> +
>> +typedef unsigned long long guest_word_t;
>> +#define FMT_32B_WORD "%08llx"
>> +#define FMT_64B_WORD "%016llx"
>> +
>> +/* Word-length of the guest's own data structures */
>> +int guest_word_size = sizeof (unsigned long);
>> +/* Word-length of the context record we get from xen */
>> +int ctxt_word_size = sizeof (unsigned long);
>> +int guest_protected_mode = 1;
>> +
>> +#define MACHINE_TYPE "X86_64"
> This looks to be used regardless of the type of the guest?
Ah, this needs to be changed. Something I was planning to do but forgot
about it.
>> +
>> +#define STRNEQ(A, B) (B && \
>> + (strncmp((char *)(A), (char *)(B), strlen((char *)(B))) == 0))
>> +#define FAILMSG "FAIL "
>> +#define DONEMSG "DONE "
>> +#define DATAMSG "DATA "
>> +
>> +#define DATA_HDRSIZE 13 /* strlen("XXXX ") + strlen("0131072") + NULL */
> I think you could use the strlen calls, which should be statically
> evaluated directly and avoid the possibility of having miscounted.
Will change.
> Is this some protocol defined by crash? Can you include a reference to
> their specification somewhere please. Is it intended for consumption
> externally to the crash tools -- i.e. is it a stable protocol? (it
> smells a bit ad-hoc is why I'm asking).
So far I have not found a specification. Will keep looking. I had
assumed it was, will work with the crash tools person to see.
> If it's not intended to be consumed like this perhaps the tool would be
> better off living in the crash source base?
Maybe. Since this has code that needs the XEN headers and crash is
currently one program with extension modules, it does not fit as well there.
> Ian.
>
-Don Slutz
next prev parent reply other threads:[~2013-10-15 15:25 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-14 14:07 [PATCH] Add xentrace/xen_crash Don Slutz
2013-10-14 14:11 ` Don Slutz
2013-10-14 15:03 ` Andrew Cooper
2013-10-15 14:53 ` Don Slutz
2013-10-14 15:13 ` Ian Campbell
2013-10-15 15:25 ` Don Slutz [this message]
2013-10-15 15:47 ` Ian Campbell
2013-10-15 16:26 ` Don Slutz
2013-10-14 16:56 ` David Vrabel
2013-10-15 14:50 ` Don Slutz
2013-10-23 17:24 ` Konrad Rzeszutek Wilk
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=525D5E59.8030102@terremark.com \
--to=dslutz@verizon.com \
--cc=Don@CloudSwitch.com \
--cc=Ian.Campbell@citrix.com \
--cc=george.dunlap@eu.citrix.com \
--cc=ian.jackson@eu.citrix.com \
--cc=stefano.stabellini@eu.citrix.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).