qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] ohci: Fix compile errors without --enable-trace-backend
@ 2014-09-23 10:19 Alexey Kardashevskiy
  2014-09-23 10:52 ` Gerd Hoffmann
  2014-09-24  9:47 ` Stefan Hajnoczi
  0 siblings, 2 replies; 6+ messages in thread
From: Alexey Kardashevskiy @ 2014-09-23 10:19 UTC (permalink / raw)
  To: qemu-devel; +Cc: Alexey Kardashevskiy, Gerd Hoffmann

This adds a stub for ohci_td_pkt() function (which traces packets)
when configured without --enable-trace-backend

Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
---

It should probably be squashed to
[PATCH] ohci: Convert fprint/DPRINTF/print to traces

Sorry about that...

---
 hw/usb/hcd-ohci.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/hw/usb/hcd-ohci.c b/hw/usb/hcd-ohci.c
index 4a4dd02..7ea871d 100644
--- a/hw/usb/hcd-ohci.c
+++ b/hw/usb/hcd-ohci.c
@@ -920,6 +920,7 @@ static int ohci_service_iso_td(OHCIState *ohci, struct ohci_ed *ed,
     return 1;
 }
 
+#ifdef trace_event_get_state
 static void ohci_td_pkt(const char *msg, const uint8_t *buf, size_t len)
 {
     bool print16 = !!trace_event_get_state(TRACE_USB_OHCI_TD_PKT_SHORT);
@@ -950,6 +951,11 @@ static void ohci_td_pkt(const char *msg, const uint8_t *buf, size_t len)
         p += sprintf(p, " %.2x", buf[i]);
     }
 }
+#else
+static void ohci_td_pkt(const char *msg, const uint8_t *buf, size_t len)
+{
+}
+#endif
 
 /* Service a transport descriptor.
    Returns nonzero to terminate processing of this endpoint.  */
-- 
2.0.0

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [Qemu-devel] [PATCH] ohci: Fix compile errors without --enable-trace-backend
  2014-09-23 10:19 [Qemu-devel] [PATCH] ohci: Fix compile errors without --enable-trace-backend Alexey Kardashevskiy
@ 2014-09-23 10:52 ` Gerd Hoffmann
  2014-09-25  0:17   ` Alexey Kardashevskiy
  2014-09-24  9:47 ` Stefan Hajnoczi
  1 sibling, 1 reply; 6+ messages in thread
From: Gerd Hoffmann @ 2014-09-23 10:52 UTC (permalink / raw)
  To: Alexey Kardashevskiy; +Cc: qemu-devel

On Di, 2014-09-23 at 20:19 +1000, Alexey Kardashevskiy wrote:
> This adds a stub for ohci_td_pkt() function (which traces packets)
> when configured without --enable-trace-backend

Ah, cool.  Just noticed that, while doing usb patch queue test builds
for the next pull req.

> It should probably be squashed to
> [PATCH] ohci: Convert fprint/DPRINTF/print to traces

Done.

thanks,
  Gerd

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Qemu-devel] [PATCH] ohci: Fix compile errors without --enable-trace-backend
  2014-09-23 10:19 [Qemu-devel] [PATCH] ohci: Fix compile errors without --enable-trace-backend Alexey Kardashevskiy
  2014-09-23 10:52 ` Gerd Hoffmann
@ 2014-09-24  9:47 ` Stefan Hajnoczi
  2014-09-25  0:19   ` Alexey Kardashevskiy
  1 sibling, 1 reply; 6+ messages in thread
From: Stefan Hajnoczi @ 2014-09-24  9:47 UTC (permalink / raw)
  To: Alexey Kardashevskiy; +Cc: qemu-devel, Gerd Hoffmann

[-- Attachment #1: Type: text/plain, Size: 1076 bytes --]

On Tue, Sep 23, 2014 at 08:19:41PM +1000, Alexey Kardashevskiy wrote:
> This adds a stub for ohci_td_pkt() function (which traces packets)
> when configured without --enable-trace-backend
> 
> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
> ---
> 
> It should probably be squashed to
> [PATCH] ohci: Convert fprint/DPRINTF/print to traces
> 
> Sorry about that...
> 
> ---
>  hw/usb/hcd-ohci.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/hw/usb/hcd-ohci.c b/hw/usb/hcd-ohci.c
> index 4a4dd02..7ea871d 100644
> --- a/hw/usb/hcd-ohci.c
> +++ b/hw/usb/hcd-ohci.c
> @@ -920,6 +920,7 @@ static int ohci_service_iso_td(OHCIState *ohci, struct ohci_ed *ed,
>      return 1;
>  }
>  
> +#ifdef trace_event_get_state
>  static void ohci_td_pkt(const char *msg, const uint8_t *buf, size_t len)
>  {
>      bool print16 = !!trace_event_get_state(TRACE_USB_OHCI_TD_PKT_SHORT);

The preferred define for this is CONFIG_TRACE_NOP.

Checking for trace_event_get_state could break if trace/control.h
changes in the future.

Stefan

[-- Attachment #2: Type: application/pgp-signature, Size: 473 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Qemu-devel] [PATCH] ohci: Fix compile errors without --enable-trace-backend
  2014-09-23 10:52 ` Gerd Hoffmann
@ 2014-09-25  0:17   ` Alexey Kardashevskiy
  0 siblings, 0 replies; 6+ messages in thread
From: Alexey Kardashevskiy @ 2014-09-25  0:17 UTC (permalink / raw)
  To: Gerd Hoffmann; +Cc: qemu-devel

On 09/23/2014 08:52 PM, Gerd Hoffmann wrote:
> On Di, 2014-09-23 at 20:19 +1000, Alexey Kardashevskiy wrote:
>> This adds a stub for ohci_td_pkt() function (which traces packets)
>> when configured without --enable-trace-backend
> 
> Ah, cool.  Just noticed that, while doing usb patch queue test builds
> for the next pull req.
> 
>> It should probably be squashed to
>> [PATCH] ohci: Convert fprint/DPRINTF/print to traces
> 
> Done.

Posted another patch for dtrace backend... Sorry for too much noise.


-- 
Alexey

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Qemu-devel] [PATCH] ohci: Fix compile errors without --enable-trace-backend
  2014-09-24  9:47 ` Stefan Hajnoczi
@ 2014-09-25  0:19   ` Alexey Kardashevskiy
  2014-09-26  8:32     ` Stefan Hajnoczi
  0 siblings, 1 reply; 6+ messages in thread
From: Alexey Kardashevskiy @ 2014-09-25  0:19 UTC (permalink / raw)
  To: Stefan Hajnoczi; +Cc: qemu-devel, Gerd Hoffmann

On 09/24/2014 07:47 PM, Stefan Hajnoczi wrote:
> On Tue, Sep 23, 2014 at 08:19:41PM +1000, Alexey Kardashevskiy wrote:
>> This adds a stub for ohci_td_pkt() function (which traces packets)
>> when configured without --enable-trace-backend
>>
>> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
>> ---
>>
>> It should probably be squashed to
>> [PATCH] ohci: Convert fprint/DPRINTF/print to traces
>>
>> Sorry about that...
>>
>> ---
>>  hw/usb/hcd-ohci.c | 6 ++++++
>>  1 file changed, 6 insertions(+)
>>
>> diff --git a/hw/usb/hcd-ohci.c b/hw/usb/hcd-ohci.c
>> index 4a4dd02..7ea871d 100644
>> --- a/hw/usb/hcd-ohci.c
>> +++ b/hw/usb/hcd-ohci.c
>> @@ -920,6 +920,7 @@ static int ohci_service_iso_td(OHCIState *ohci, struct ohci_ed *ed,
>>      return 1;
>>  }
>>  
>> +#ifdef trace_event_get_state
>>  static void ohci_td_pkt(const char *msg, const uint8_t *buf, size_t len)
>>  {
>>      bool print16 = !!trace_event_get_state(TRACE_USB_OHCI_TD_PKT_SHORT);
> 
> The preferred define for this is CONFIG_TRACE_NOP.
> 
> Checking for trace_event_get_state could break if trace/control.h
> changes in the future.

I am not familiar with "dtrace" - are traces configurable with it? With
--enable-trace-backend=dtrace, trace_event_get_state is not defined.



-- 
Alexey

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [Qemu-devel] [PATCH] ohci: Fix compile errors without --enable-trace-backend
  2014-09-25  0:19   ` Alexey Kardashevskiy
@ 2014-09-26  8:32     ` Stefan Hajnoczi
  0 siblings, 0 replies; 6+ messages in thread
From: Stefan Hajnoczi @ 2014-09-26  8:32 UTC (permalink / raw)
  To: Alexey Kardashevskiy; +Cc: qemu-devel, Gerd Hoffmann

[-- Attachment #1: Type: text/plain, Size: 1548 bytes --]

On Thu, Sep 25, 2014 at 10:19:32AM +1000, Alexey Kardashevskiy wrote:
> On 09/24/2014 07:47 PM, Stefan Hajnoczi wrote:
> > On Tue, Sep 23, 2014 at 08:19:41PM +1000, Alexey Kardashevskiy wrote:
> >> This adds a stub for ohci_td_pkt() function (which traces packets)
> >> when configured without --enable-trace-backend
> >>
> >> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
> >> ---
> >>
> >> It should probably be squashed to
> >> [PATCH] ohci: Convert fprint/DPRINTF/print to traces
> >>
> >> Sorry about that...
> >>
> >> ---
> >>  hw/usb/hcd-ohci.c | 6 ++++++
> >>  1 file changed, 6 insertions(+)
> >>
> >> diff --git a/hw/usb/hcd-ohci.c b/hw/usb/hcd-ohci.c
> >> index 4a4dd02..7ea871d 100644
> >> --- a/hw/usb/hcd-ohci.c
> >> +++ b/hw/usb/hcd-ohci.c
> >> @@ -920,6 +920,7 @@ static int ohci_service_iso_td(OHCIState *ohci, struct ohci_ed *ed,
> >>      return 1;
> >>  }
> >>  
> >> +#ifdef trace_event_get_state
> >>  static void ohci_td_pkt(const char *msg, const uint8_t *buf, size_t len)
> >>  {
> >>      bool print16 = !!trace_event_get_state(TRACE_USB_OHCI_TD_PKT_SHORT);
> > 
> > The preferred define for this is CONFIG_TRACE_NOP.
> > 
> > Checking for trace_event_get_state could break if trace/control.h
> > changes in the future.
> 
> I am not familiar with "dtrace" - are traces configurable with it? With
> --enable-trace-backend=dtrace, trace_event_get_state is not defined.

dtrace has its own tools for enabling/disabling trace events.  QEMU's
command cannot be used with dtrace.

[-- Attachment #2: Type: application/pgp-signature, Size: 473 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2014-09-26 10:56 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-23 10:19 [Qemu-devel] [PATCH] ohci: Fix compile errors without --enable-trace-backend Alexey Kardashevskiy
2014-09-23 10:52 ` Gerd Hoffmann
2014-09-25  0:17   ` Alexey Kardashevskiy
2014-09-24  9:47 ` Stefan Hajnoczi
2014-09-25  0:19   ` Alexey Kardashevskiy
2014-09-26  8:32     ` Stefan Hajnoczi

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).