* Re: [PATCH] Plumb through xen-platform device logging
2013-07-11 12:07 ` Paul Durrant
@ 2013-07-11 12:25 ` Don Slutz
2013-07-11 12:28 ` Don Slutz
` (2 subsequent siblings)
3 siblings, 0 replies; 12+ messages in thread
From: Don Slutz @ 2013-07-11 12:25 UTC (permalink / raw)
To: Paul Durrant; +Cc: Ian Campbell, xen-devel@lists.xen.org
On 07/11/13 08:07, Paul Durrant wrote:
>> -----Original Message-----
>> From: Ian Campbell [mailto:ian.campbell@citrix.com]
>> Sent: 11 July 2013 12:44
>> To: Paul Durrant
>> Cc: xen-devel@lists.xen.org
>> Subject: Re: [Xen-devel] [PATCH] Plumb through xen-platform device logging
>>
>> On Thu, 2013-07-11 at 08:23 +0000, Paul Durrant wrote:
>>>> diff --git a/tools/Makefile b/tools/Makefile
>>>> index e44a3e9..2d791a4 100644
>>>> --- a/tools/Makefile
>>>> +++ b/tools/Makefile
>>>> @@ -202,7 +202,8 @@ subdir-all-qemu-xen-dir: qemu-xen-dir-find
>>>> --disable-kvm \
>>>> --disable-docs \
>>>> --python=$(PYTHON) \
>>>> - $(IOEMU_CONFIGURE_CROSS); \
>>>> + $(IOEMU_CONFIGURE_CROSS) \
>>>> + --enable-trace-backend=stderr; \
I have done this in a more flexable way:
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -187,8 +185,7 @@ subdir-all-qemu-xen-dir: qemu-xen-dir-find
source=.; \
fi; \
cd qemu-xen-dir; \
- $$source/configure --enable-xen --target-list=i386-softmmu \
- --prefix=$(PREFIX) \
+ $$source/configure --enable-xen $(QEMU_UPSTREAM_EXTRA_CONFIG)
--target-list=i386-softmmu \
--source-path=$$source \
--extra-cflags="-I$(XEN_ROOT)/tools/include \
-I$(XEN_ROOT)/tools/libxc \
I.E by adding QEMU_UPSTREAM_EXTRA_CONFIG which I add to .config when I
want to turn on tracing.
>> Is this the only way to do this?
>>
>> It is likely that many distros will use their standard qemu packages
>> which may or may not have this option enabled.
>>
> That's true.
>
>> I'm not sure if this is a static always on option or if this is simply
>> making a trace backend available for use.
>>
> It's a static selection as far as I can tell. The tracing backend is not selectable at runtime :-(
It is static and adds a lot of code. So you want a way to not configure
it also. However what trace output happens is changeable while running.
>> Looking at http://wiki.qemu.org/Features/Tracing is the tracing
>> interface really the right way to be logging this particular class of
>> information? I'd have thought a simple logfile support in the platform
>> device would be a much more natural fit.
>>
> That makes sense to me, but whoever coded up the platform device obviously believed tracing to be the correct way to log. I don't know the history of that decision.
> It doesn't change the fact though that, currently, xen builds of QEMU don't configure any form of tracing backend at all which doesn't seem particularly helpful, and I did introduce platform logging as an example of an event to log so I think the patch is useful as far as it goes, but maybe another patch to the platform device in QEMU would also be considered a good idea.
>
> Paul
>
>>>> $(MAKE) all
>>>>
>>>> diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c
>>>> index 2924298..35f71cc 100644
>>>> --- a/tools/libxl/libxl_dm.c
>>>> +++ b/tools/libxl/libxl_dm.c
>>>> @@ -370,6 +370,13 @@ static char **
>>>> libxl__build_device_model_args_new(libxl__gc *gc,
>>>> "-xen-domid",
>>>> libxl__sprintf(gc, "%d", guest_domid), NULL);
>>>>
>>>> + flexarray_vappend(dm_args,
>>>> + "-trace",
>>>> + libxl__sprintf(gc,
>>>> + "events=%s/qemu-trace-events",
>>>> + libxl__xen_config_dir_path()),
>>>> + NULL);
>> Doesn't this end up logging to /etc/xen? Not what we want I think.
>>
>> or maybe this is just the config file, which, apart from my comments
>> about the suitability of the interface above, makes me wonder where the
>> logs do go? Ideally they would go to /var/log/xen/qemu-blah-name.log not
>> to xl stdout.
>>
Using --enable-trace-backend=stderr, the output ends up in
/var/log/xen/qemu-dm-P-1-0.log
I.E. where all stderr from qemu does.
-Don Slutz
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 12+ messages in thread* Re: [PATCH] Plumb through xen-platform device logging
2013-07-11 12:07 ` Paul Durrant
2013-07-11 12:25 ` Don Slutz
@ 2013-07-11 12:28 ` Don Slutz
2013-07-11 13:15 ` Paul Durrant
2013-07-11 12:50 ` Ian Campbell
2013-07-11 14:01 ` Ian Campbell
3 siblings, 1 reply; 12+ messages in thread
From: Don Slutz @ 2013-07-11 12:28 UTC (permalink / raw)
To: Paul Durrant; +Cc: Ian Campbell, xen-devel@lists.xen.org
On 07/11/13 08:07, Paul Durrant wrote:
>> -----Original Message-----
>> From: Ian Campbell [mailto:ian.campbell@citrix.com]
>> Sent: 11 July 2013 12:44
>> To: Paul Durrant
>> Cc: xen-devel@lists.xen.org
>> Subject: Re: [Xen-devel] [PATCH] Plumb through xen-platform device logging
>>
>> On Thu, 2013-07-11 at 08:23 +0000, Paul Durrant wrote:
>>>> diff --git a/tools/Makefile b/tools/Makefile
>>>> index e44a3e9..2d791a4 100644
>>>> --- a/tools/Makefile
>>>> +++ b/tools/Makefile
>>>> @@ -202,7 +202,8 @@ subdir-all-qemu-xen-dir: qemu-xen-dir-find
>>>> --disable-kvm \
>>>> --disable-docs \
>>>> --python=$(PYTHON) \
>>>> - $(IOEMU_CONFIGURE_CROSS); \
>>>> + $(IOEMU_CONFIGURE_CROSS) \
>>>> + --enable-trace-backend=stderr; \
I have done this in a more flexable way:
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -187,8 +185,7 @@ subdir-all-qemu-xen-dir: qemu-xen-dir-find
source=.; \
fi; \
cd qemu-xen-dir; \
- $$source/configure --enable-xen --target-list=i386-softmmu \
- --prefix=$(PREFIX) \
+ $$source/configure --enable-xen $(QEMU_UPSTREAM_EXTRA_CONFIG)
--target-list=i386-softmmu \
--source-path=$$source \
--extra-cflags="-I$(XEN_ROOT)/tools/include \
-I$(XEN_ROOT)/tools/libxc \
I.E by adding QEMU_UPSTREAM_EXTRA_CONFIG which I add to .config when I
want to turn on tracing.
>> Is this the only way to do this?
>>
>> It is likely that many distros will use their standard qemu packages
>> which may or may not have this option enabled.
>>
> That's true.
>
>> I'm not sure if this is a static always on option or if this is simply
>> making a trace backend available for use.
>>
> It's a static selection as far as I can tell. The tracing backend is not selectable at runtime :-(
It is static and adds a lot of code. So you want a way to not configure
it also. However what trace output happens is changeable while running.
>> Looking at http://wiki.qemu.org/Features/Tracing is the tracing
>> interface really the right way to be logging this particular class of
>> information? I'd have thought a simple logfile support in the platform
>> device would be a much more natural fit.
>>
> That makes sense to me, but whoever coded up the platform device obviously believed tracing to be the correct way to log. I don't know the history of that decision.
> It doesn't change the fact though that, currently, xen builds of QEMU don't configure any form of tracing backend at all which doesn't seem particularly helpful, and I did introduce platform logging as an example of an event to log so I think the patch is useful as far as it goes, but maybe another patch to the platform device in QEMU would also be considered a good idea.
>
> Paul
>
>>>> $(MAKE) all
>>>>
>>>> diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c
>>>> index 2924298..35f71cc 100644
>>>> --- a/tools/libxl/libxl_dm.c
>>>> +++ b/tools/libxl/libxl_dm.c
>>>> @@ -370,6 +370,13 @@ static char **
>>>> libxl__build_device_model_args_new(libxl__gc *gc,
>>>> "-xen-domid",
>>>> libxl__sprintf(gc, "%d", guest_domid), NULL);
>>>>
>>>> + flexarray_vappend(dm_args,
>>>> + "-trace",
>>>> + libxl__sprintf(gc,
>>>> + "events=%s/qemu-trace-events",
>>>> + libxl__xen_config_dir_path()),
>>>> + NULL);
I handle this by adjusting device_model_args_hvm like:
device_model_args_hvm = [ "-trace", "events=/etc/xen/qemu-trace-events" ]
in the config.
>> Doesn't this end up logging to /etc/xen? Not what we want I think.
>>
>> or maybe this is just the config file, which, apart from my comments
>> about the suitability of the interface above, makes me wonder where the
>> logs do go? Ideally they would go to /var/log/xen/qemu-blah-name.log not
>> to xl stdout.
>>
Using --enable-trace-backend=stderr, the output ends up in
/var/log/xen/qemu-dm-P-1-0.log
I.E. where all stderr from qemu does.
-Don Slutz
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 12+ messages in thread* Re: [PATCH] Plumb through xen-platform device logging
2013-07-11 12:28 ` Don Slutz
@ 2013-07-11 13:15 ` Paul Durrant
0 siblings, 0 replies; 12+ messages in thread
From: Paul Durrant @ 2013-07-11 13:15 UTC (permalink / raw)
To: Don Slutz; +Cc: Ian Campbell, xen-devel@lists.xen.org
> -----Original Message-----
> From: Don Slutz [mailto:dslutz@verizon.com]
> Sent: 11 July 2013 13:29
> To: Paul Durrant
> Cc: Ian Campbell; xen-devel@lists.xen.org
> Subject: Re: [Xen-devel] [PATCH] Plumb through xen-platform device logging
>
> On 07/11/13 08:07, Paul Durrant wrote:
> >> -----Original Message-----
> >> From: Ian Campbell [mailto:ian.campbell@citrix.com]
> >> Sent: 11 July 2013 12:44
> >> To: Paul Durrant
> >> Cc: xen-devel@lists.xen.org
> >> Subject: Re: [Xen-devel] [PATCH] Plumb through xen-platform device
> logging
> >>
> >> On Thu, 2013-07-11 at 08:23 +0000, Paul Durrant wrote:
> >>>> diff --git a/tools/Makefile b/tools/Makefile
> >>>> index e44a3e9..2d791a4 100644
> >>>> --- a/tools/Makefile
> >>>> +++ b/tools/Makefile
> >>>> @@ -202,7 +202,8 @@ subdir-all-qemu-xen-dir: qemu-xen-dir-find
> >>>> --disable-kvm \
> >>>> --disable-docs \
> >>>> --python=$(PYTHON) \
> >>>> - $(IOEMU_CONFIGURE_CROSS); \
> >>>> + $(IOEMU_CONFIGURE_CROSS) \
> >>>> + --enable-trace-backend=stderr; \
> I have done this in a more flexable way:
>
> --- a/tools/Makefile
> +++ b/tools/Makefile
>
> @@ -187,8 +185,7 @@ subdir-all-qemu-xen-dir: qemu-xen-dir-find
> source=.; \
> fi; \
> cd qemu-xen-dir; \
> - $$source/configure --enable-xen --target-list=i386-softmmu \
> - --prefix=$(PREFIX) \
> + $$source/configure --enable-xen
> $(QEMU_UPSTREAM_EXTRA_CONFIG)
> --target-list=i386-softmmu \
> --source-path=$$source \
> --extra-cflags="-I$(XEN_ROOT)/tools/include \
> -I$(XEN_ROOT)/tools/libxc \
>
> I.E by adding QEMU_UPSTREAM_EXTRA_CONFIG which I add to .config
> when I
> want to turn on tracing.
>
Perhaps we should have that, and maybe a dedicated QEMU_TRACE_BACKEND that defaults to stderr?
Paul
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH] Plumb through xen-platform device logging
2013-07-11 12:07 ` Paul Durrant
2013-07-11 12:25 ` Don Slutz
2013-07-11 12:28 ` Don Slutz
@ 2013-07-11 12:50 ` Ian Campbell
2013-07-11 13:54 ` Anthony PERARD
2013-07-11 14:01 ` Ian Campbell
3 siblings, 1 reply; 12+ messages in thread
From: Ian Campbell @ 2013-07-11 12:50 UTC (permalink / raw)
To: Paul Durrant; +Cc: Anthony Perard, Stefano Stabellini, xen-devel@lists.xen.org
On Thu, 2013-07-11 at 13:07 +0100, Paul Durrant wrote:
> > Looking at http://wiki.qemu.org/Features/Tracing is the tracing
> > interface really the right way to be logging this particular class of
> > information? I'd have thought a simple logfile support in the platform
> > device would be a much more natural fit.
> >
>
> That makes sense to me, but whoever coded up the platform device
> obviously believed tracing to be the correct way to log. I don't know
> the history of that decision.
I guess either Anthony or Stefano knows. Do you guys know why we log the
platform device I/O port debug via the trace subsystems? It doesn't seem
like a good fit.
A better fit would be the qemu chr subsystem (I think that's the name, I
mean the thing which lets you direct serial/parallel etc to
file,tcp,sockets etc etc.)
> It doesn't change the fact though that, currently, xen builds of QEMU
> don't configure any form of tracing backend at all which doesn't seem
> particularly helpful, and I did introduce platform logging as an
> example of an event to log so I think the patch is useful as far as it
> goes, but maybe another patch to the platform device in QEMU would
> also be considered a good idea.
>
> Paul
>
> > > > $(MAKE) all
> > > >
> > > > diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c
> > > > index 2924298..35f71cc 100644
> > > > --- a/tools/libxl/libxl_dm.c
> > > > +++ b/tools/libxl/libxl_dm.c
> > > > @@ -370,6 +370,13 @@ static char **
> > > > libxl__build_device_model_args_new(libxl__gc *gc,
> > > > "-xen-domid",
> > > > libxl__sprintf(gc, "%d", guest_domid), NULL);
> > > >
> > > > + flexarray_vappend(dm_args,
> > > > + "-trace",
> > > > + libxl__sprintf(gc,
> > > > + "events=%s/qemu-trace-events",
> > > > + libxl__xen_config_dir_path()),
> > > > + NULL);
> >
> > Doesn't this end up logging to /etc/xen? Not what we want I think.
> >
> > or maybe this is just the config file, which, apart from my comments
> > about the suitability of the interface above, makes me wonder where the
> > logs do go? Ideally they would go to /var/log/xen/qemu-blah-name.log not
> > to xl stdout.
> >
>
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH] Plumb through xen-platform device logging
2013-07-11 12:50 ` Ian Campbell
@ 2013-07-11 13:54 ` Anthony PERARD
2013-07-11 13:59 ` Paul Durrant
0 siblings, 1 reply; 12+ messages in thread
From: Anthony PERARD @ 2013-07-11 13:54 UTC (permalink / raw)
To: Ian Campbell; +Cc: Paul Durrant, Stefano Stabellini, xen-devel@lists.xen.org
On 11/07/13 13:50, Ian Campbell wrote:
> On Thu, 2013-07-11 at 13:07 +0100, Paul Durrant wrote:
>
>>> > > Looking at http://wiki.qemu.org/Features/Tracing is the tracing
>>> > > interface really the right way to be logging this particular class of
>>> > > information? I'd have thought a simple logfile support in the platform
>>> > > device would be a much more natural fit.
>>> > >
>> >
>> > That makes sense to me, but whoever coded up the platform device
>> > obviously believed tracing to be the correct way to log. I don't know
>> > the history of that decision.
> I guess either Anthony or Stefano knows. Do you guys know why we log the
> platform device I/O port debug via the trace subsystems? It doesn't seem
> like a good fit.
It seams that I made this choice long time ago.
http://marc.info/?l=xen-devel&m=129864357001108&w=2
But I never try to use it, that was maybe not a great choice. After a
quick look into the qemu tree, using the trace thing those not seams bad
as well. There is just few step:
- compile qemu with traces enable
- adding to the vm-xl-config this:
device_model_args_hvm = [ '-trace', 'events=/tmp/traces' ]
(with "xen_platform_log" in /tmp/traces)
So, about the patch, I don't feel a good idea to have it enable all the
time for all the guest. Also, QEMU will refuse to start if it's compiled
without trace support.
> A better fit would be the qemu chr subsystem (I think that's the name, I
> mean the thing which lets you direct serial/parallel etc to
> file,tcp,sockets etc etc.)
This can maybe be done using a property, which could be set via the
command line by using the -device options.
--
Anthony PERARD
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH] Plumb through xen-platform device logging
2013-07-11 13:54 ` Anthony PERARD
@ 2013-07-11 13:59 ` Paul Durrant
0 siblings, 0 replies; 12+ messages in thread
From: Paul Durrant @ 2013-07-11 13:59 UTC (permalink / raw)
To: Anthony Perard, Ian Campbell; +Cc: Stefano Stabellini, xen-devel@lists.xen.org
> -----Original Message-----
> From: Anthony PERARD [mailto:anthony.perard@citrix.com]
> Sent: 11 July 2013 14:54
> To: Ian Campbell
> Cc: Paul Durrant; xen-devel@lists.xen.org; Stefano Stabellini
> Subject: Re: [Xen-devel] [PATCH] Plumb through xen-platform device logging
>
> On 11/07/13 13:50, Ian Campbell wrote:
> > On Thu, 2013-07-11 at 13:07 +0100, Paul Durrant wrote:
> >
> >>> > > Looking at http://wiki.qemu.org/Features/Tracing is the tracing
> >>> > > interface really the right way to be logging this particular class of
> >>> > > information? I'd have thought a simple logfile support in the platform
> >>> > > device would be a much more natural fit.
> >>> > >
> >> >
> >> > That makes sense to me, but whoever coded up the platform device
> >> > obviously believed tracing to be the correct way to log. I don't know
> >> > the history of that decision.
> > I guess either Anthony or Stefano knows. Do you guys know why we log
> the
> > platform device I/O port debug via the trace subsystems? It doesn't seem
> > like a good fit.
>
> It seams that I made this choice long time ago.
> http://marc.info/?l=xen-devel&m=129864357001108&w=2
>
> But I never try to use it, that was maybe not a great choice. After a
> quick look into the qemu tree, using the trace thing those not seams bad
> as well. There is just few step:
>
> - compile qemu with traces enable
> - adding to the vm-xl-config this:
> device_model_args_hvm = [ '-trace', 'events=/tmp/traces' ]
> (with "xen_platform_log" in /tmp/traces)
>
Yeah, that's what I had before :-)
>
> So, about the patch, I don't feel a good idea to have it enable all the
> time for all the guest. Also, QEMU will refuse to start if it's compiled
> without trace support.
>
That’s a good point. Should probably just have a minimal patch to the xen build to enable a tracing backend (under config control) and leave the libxl stuff out.
Paul
> > A better fit would be the qemu chr subsystem (I think that's the name, I
> > mean the thing which lets you direct serial/parallel etc to
> > file,tcp,sockets etc etc.)
>
> This can maybe be done using a property, which could be set via the
> command line by using the -device options.
>
> --
> Anthony PERARD
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH] Plumb through xen-platform device logging
2013-07-11 12:07 ` Paul Durrant
` (2 preceding siblings ...)
2013-07-11 12:50 ` Ian Campbell
@ 2013-07-11 14:01 ` Ian Campbell
2013-07-11 14:49 ` Paul Durrant
3 siblings, 1 reply; 12+ messages in thread
From: Ian Campbell @ 2013-07-11 14:01 UTC (permalink / raw)
To: Paul Durrant; +Cc: xen-devel@lists.xen.org
On Thu, 2013-07-11 at 13:07 +0100, Paul Durrant wrote:
> It doesn't change the fact though that, currently, xen builds of QEMU
> don't configure any form of tracing backend at all which doesn't seem
> particularly helpful, and I did introduce platform logging as an
> example of an event to log so I think the patch is useful as far as it
> goes, but maybe another patch to the platform device in QEMU would
> also be considered a good idea.
I think if we do anything we should do it properly (i.e. fix qemu to do
sensible logging) rather than layering more stuff on top of the wrong
thing.
Ian.
^ permalink raw reply [flat|nested] 12+ messages in thread* Re: [PATCH] Plumb through xen-platform device logging
2013-07-11 14:01 ` Ian Campbell
@ 2013-07-11 14:49 ` Paul Durrant
0 siblings, 0 replies; 12+ messages in thread
From: Paul Durrant @ 2013-07-11 14:49 UTC (permalink / raw)
To: Ian Campbell; +Cc: xen-devel@lists.xen.org
> -----Original Message-----
> From: Ian Campbell [mailto:ian.campbell@citrix.com]
> Sent: 11 July 2013 15:02
> To: Paul Durrant
> Cc: xen-devel@lists.xen.org
> Subject: Re: [Xen-devel] [PATCH] Plumb through xen-platform device logging
>
> On Thu, 2013-07-11 at 13:07 +0100, Paul Durrant wrote:
> > It doesn't change the fact though that, currently, xen builds of QEMU
> > don't configure any form of tracing backend at all which doesn't seem
> > particularly helpful, and I did introduce platform logging as an
> > example of an event to log so I think the patch is useful as far as it
> > goes, but maybe another patch to the platform device in QEMU would
> > also be considered a good idea.
>
> I think if we do anything we should do it properly (i.e. fix qemu to do
> sensible logging) rather than layering more stuff on top of the wrong
> thing.
>
Sure. I'll get together a patch to allow QEMU tracing to be configured in a xen build anyway, but then I'll do a QEMU patch to take a logfile parameter into the platform device model.
Paul
^ permalink raw reply [flat|nested] 12+ messages in thread