All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] compile failure if I enable guest_mem_before trace event
@ 2017-03-23 19:08 Peter Maydell
  2017-03-24  2:39 ` Emilio G. Cota
  0 siblings, 1 reply; 3+ messages in thread
From: Peter Maydell @ 2017-03-23 19:08 UTC (permalink / raw)
  To: QEMU Developers; +Cc: Lluís Vilanova

Hi; I thought I'd have a look at the guest_mem_before trace event,
but if I enable it (by deleting "disable" from the line in trace-events)
QEMU doesn't compile:

  CC      arm-softmmu/tcg/tcg-op.o
In file included from
/home/petmay01/linaro/qemu-from-laptop/qemu/include/trace-tcg.h:4:0,
                 from
/home/petmay01/linaro/qemu-from-laptop/qemu/tcg/tcg-op.c:31:
../trace/generated-tcg-tracers.h: In function ‘trace_guest_mem_before_tcg’:
../trace/generated-tcg-tracers.h:11:5: error: implicit declaration of
function ‘trace_guest_mem_before_trans’
[-Werror=implicit-function-declaration]
     trace_guest_mem_before_trans(__cpu, info);
     ^
../trace/generated-tcg-tracers.h:11:5: error: nested extern
declaration of ‘trace_guest_mem_before_trans’ [-Werror=nested-externs]

Am I doing something wrong, or is this a bug?

thanks
-- PMM

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

* Re: [Qemu-devel] compile failure if I enable guest_mem_before trace event
  2017-03-23 19:08 [Qemu-devel] compile failure if I enable guest_mem_before trace event Peter Maydell
@ 2017-03-24  2:39 ` Emilio G. Cota
  2017-03-27 13:17   ` Stefan Hajnoczi
  0 siblings, 1 reply; 3+ messages in thread
From: Emilio G. Cota @ 2017-03-24  2:39 UTC (permalink / raw)
  To: Peter Maydell
  Cc: QEMU Developers, Lluís Vilanova, Daniel P. Berrange,
	Stefan Hajnoczi

On Thu, Mar 23, 2017 at 19:08:11 +0000, Peter Maydell wrote:
> Hi; I thought I'd have a look at the guest_mem_before trace event,
> but if I enable it (by deleting "disable" from the line in trace-events)
> QEMU doesn't compile:
> 
>   CC      arm-softmmu/tcg/tcg-op.o
> In file included from
> /home/petmay01/linaro/qemu-from-laptop/qemu/include/trace-tcg.h:4:0,
>                  from
> /home/petmay01/linaro/qemu-from-laptop/qemu/tcg/tcg-op.c:31:
> ../trace/generated-tcg-tracers.h: In function ‘trace_guest_mem_before_tcg’:
> ../trace/generated-tcg-tracers.h:11:5: error: implicit declaration of
> function ‘trace_guest_mem_before_trans’
> [-Werror=implicit-function-declaration]
>      trace_guest_mem_before_trans(__cpu, info);
>      ^
> ../trace/generated-tcg-tracers.h:11:5: error: nested extern
> declaration of ‘trace_guest_mem_before_trans’ [-Werror=nested-externs]
> 
> Am I doing something wrong, or is this a bug?

It doesn't work for me either. I bisected it to:

0ab8ed18 "trace: switch to modular code generation for sub-directories"

It seems that after that commit no appropriate include is added
to the generated tcg tracing .h files. The 'header' variable isn't used
in the generation scripts for TCG, which is suspicious, e.g.:

--- a/scripts/tracetool/format/tcg_h.py
+++ b/scripts/tracetool/format/tcg_h.py
@@ -28,13 +28,17 @@ def vcpu_transform_args(args):


 def generate(events, backend, group):
+    if group == "root":
+        header = "trace-root.h"
+    else:
+        header = "trace.h"
+
     out('/* This file is autogenerated by tracetool, do not edit. */',
         '/* You must include this file after the inclusion of helper.h */',
         '',
         '#ifndef TRACE_%s_GENERATED_TCG_TRACERS_H' % group.upper(),
         '#define TRACE_%s_GENERATED_TCG_TRACERS_H' % group.upper(),
         '',
-        '#include "trace.h"',
         '#include "exec/helper-proto.h"',
         '',
         )


The appended fixes it for me; I hope it's enough for the tracing
people to come quickly to a proper fix (sorry, I didn't even know
what the tracing features were only a few minutes ago!).

Thanks,

		Emilio

diff --git a/scripts/tracetool/format/tcg_h.py b/scripts/tracetool/format/tcg_h.py
index 7ddc4a5..d020e9d 100644
--- a/scripts/tracetool/format/tcg_h.py
+++ b/scripts/tracetool/format/tcg_h.py
@@ -28,10 +28,7 @@ def vcpu_transform_args(args):
 
 
 def generate(events, backend, group):
-    if group == "root":
-        header = "trace-root.h"
-    else:
-        header = "trace.h"
+    header = "trace-root.h"
 
     out('/* This file is autogenerated by tracetool, do not edit. */',
         '/* You must include this file after the inclusion of helper.h */',
@@ -40,6 +37,7 @@ def generate(events, backend, group):
         '#define TRACE_%s_GENERATED_TCG_TRACERS_H' % group.upper(),
         '',
         '#include "exec/helper-proto.h"',
+        '#include "%s"' % header,
         '',
         )
 
diff --git a/scripts/tracetool/format/tcg_helper_c.py b/scripts/tracetool/format/tcg_helper_c.py
index 7dccd8c..be7c71b 100644
--- a/scripts/tracetool/format/tcg_helper_c.py
+++ b/scripts/tracetool/format/tcg_helper_c.py
@@ -41,10 +41,7 @@ def vcpu_transform_args(args, mode):
 
 
 def generate(events, backend, group):
-    if group == "root":
-        header = "trace-root.h"
-    else:
-        header = "trace.h"
+    header = "trace-root.h"
 
     events = [e for e in events
               if "disable" not in e.properties]
@@ -55,6 +52,7 @@ def generate(events, backend, group):
         '#include "qemu-common.h"',
         '#include "cpu.h"',
         '#include "exec/helper-proto.h"',
+        '#include "%s"' % header,
         '',
         )
 

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

* Re: [Qemu-devel] compile failure if I enable guest_mem_before trace event
  2017-03-24  2:39 ` Emilio G. Cota
@ 2017-03-27 13:17   ` Stefan Hajnoczi
  0 siblings, 0 replies; 3+ messages in thread
From: Stefan Hajnoczi @ 2017-03-27 13:17 UTC (permalink / raw)
  To: Emilio G. Cota
  Cc: Peter Maydell, QEMU Developers, Stefan Hajnoczi,
	Lluís Vilanova, Daniel Berrange

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

On Thu, Mar 23, 2017 at 10:39:43PM -0400, Emilio G. Cota wrote:
> On Thu, Mar 23, 2017 at 19:08:11 +0000, Peter Maydell wrote:
> > Hi; I thought I'd have a look at the guest_mem_before trace event,
> > but if I enable it (by deleting "disable" from the line in trace-events)
> > QEMU doesn't compile:
> > 
> >   CC      arm-softmmu/tcg/tcg-op.o
> > In file included from
> > /home/petmay01/linaro/qemu-from-laptop/qemu/include/trace-tcg.h:4:0,
> >                  from
> > /home/petmay01/linaro/qemu-from-laptop/qemu/tcg/tcg-op.c:31:
> > ../trace/generated-tcg-tracers.h: In function ‘trace_guest_mem_before_tcg’:
> > ../trace/generated-tcg-tracers.h:11:5: error: implicit declaration of
> > function ‘trace_guest_mem_before_trans’
> > [-Werror=implicit-function-declaration]
> >      trace_guest_mem_before_trans(__cpu, info);
> >      ^
> > ../trace/generated-tcg-tracers.h:11:5: error: nested extern
> > declaration of ‘trace_guest_mem_before_trans’ [-Werror=nested-externs]
> > 
> > Am I doing something wrong, or is this a bug?
> 
> It doesn't work for me either. I bisected it to:
> 
> 0ab8ed18 "trace: switch to modular code generation for sub-directories"
> 
> It seems that after that commit no appropriate include is added
> to the generated tcg tracing .h files. The 'header' variable isn't used
> in the generation scripts for TCG, which is suspicious, e.g.:
> 
> --- a/scripts/tracetool/format/tcg_h.py
> +++ b/scripts/tracetool/format/tcg_h.py
> @@ -28,13 +28,17 @@ def vcpu_transform_args(args):
> 
> 
>  def generate(events, backend, group):
> +    if group == "root":
> +        header = "trace-root.h"
> +    else:
> +        header = "trace.h"
> +
>      out('/* This file is autogenerated by tracetool, do not edit. */',
>          '/* You must include this file after the inclusion of helper.h */',
>          '',
>          '#ifndef TRACE_%s_GENERATED_TCG_TRACERS_H' % group.upper(),
>          '#define TRACE_%s_GENERATED_TCG_TRACERS_H' % group.upper(),
>          '',
> -        '#include "trace.h"',
>          '#include "exec/helper-proto.h"',
>          '',
>          )
> 
> 
> The appended fixes it for me; I hope it's enough for the tracing
> people to come quickly to a proper fix (sorry, I didn't even know
> what the tracing features were only a few minutes ago!).

Thanks for looking into this.  I have sent a patch.

Stefan

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 455 bytes --]

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

end of thread, other threads:[~2017-03-27 13:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-23 19:08 [Qemu-devel] compile failure if I enable guest_mem_before trace event Peter Maydell
2017-03-24  2:39 ` Emilio G. Cota
2017-03-27 13:17   ` Stefan Hajnoczi

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.