From: "Emilio G. Cota" <cota@braap.org>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: "QEMU Developers" <qemu-devel@nongnu.org>,
"Lluís Vilanova" <vilanova@ac.upc.edu>,
"Daniel P. Berrange" <berrange@redhat.com>,
"Stefan Hajnoczi" <stefanha@redhat.com>
Subject: Re: [Qemu-devel] compile failure if I enable guest_mem_before trace event
Date: Thu, 23 Mar 2017 22:39:43 -0400 [thread overview]
Message-ID: <20170324023943.GA21650@flamenco> (raw)
In-Reply-To: <CAFEAcA-ej2CMRBHoOG4gO34wgP01Q==O8jtEDMnNjOJZrs6ncg@mail.gmail.com>
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,
'',
)
next prev parent reply other threads:[~2017-03-24 2:39 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
2017-03-27 13:17 ` Stefan Hajnoczi
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=20170324023943.GA21650@flamenco \
--to=cota@braap.org \
--cc=berrange@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@redhat.com \
--cc=vilanova@ac.upc.edu \
/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).