From patchwork Fri Mar 24 02:39:43 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Emilio Cota X-Patchwork-Id: 743032 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3vq71r2HLYz9s3l for ; Fri, 24 Mar 2017 13:40:13 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=braap.org header.i=@braap.org header.b="ubMXYEzy"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="CdoPd2xX"; dkim-atps=neutral Received: from localhost ([::1]:59589 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1crF96-0008FS-EO for incoming@patchwork.ozlabs.org; Thu, 23 Mar 2017 22:40:08 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33257) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1crF8n-0008Dz-TG for qemu-devel@nongnu.org; Thu, 23 Mar 2017 22:39:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1crF8k-0004lp-Oy for qemu-devel@nongnu.org; Thu, 23 Mar 2017 22:39:49 -0400 Received: from out1-smtp.messagingengine.com ([66.111.4.25]:55036) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1crF8k-0004kn-B7 for qemu-devel@nongnu.org; Thu, 23 Mar 2017 22:39:46 -0400 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 0B32920BD3; Thu, 23 Mar 2017 22:39:44 -0400 (EDT) Received: from frontend2 ([10.202.2.161]) by compute4.internal (MEProxy); Thu, 23 Mar 2017 22:39:44 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=braap.org; h=cc :content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc:x-sasl-enc; s=mesmtp; bh=C7n4J7BDhQFIAb7 /xHHiPAQ+GP4fkHt55V6wYSZMnbU=; b=ubMXYEzyGeYs0BaCwBi24iGbME8QU4C cnlNvjVp700Mv20Ya6anVju/3K2vhogrEbyeVHrmG/6RM2ezNtzKa20Wytco92QD 0kIfypOLC8Tzx3NFRKwQH9XLs59jue/+0xTKklfRXfJJPt4UGVLa4Mebqg7szyTH bJFNRom/i7og= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc:x-sasl-enc; s= fm1; bh=C7n4J7BDhQFIAb7/xHHiPAQ+GP4fkHt55V6wYSZMnbU=; b=CdoPd2xX e8vmShVq17TL4atNTVQFZvpdfNEI3Ddv/H5qZFv0YPJwtgTNAVhzZPDOIZPMKvJ9 /uxTMGbHiGXLyUx/fAukKGFDiG+a4HjiXQyPLxV7S5iaXIMOmSf124SjOFVyX8JP u8q5eBSYZAGyl3iLH1TMLKs12w/KSdJSOrOllOFy+8V88v9rqp//qhX0IxPt+mDb no7LQs7QNiFgpjWXncoqRQaxeYvIHWqmd54OZkFA+aSgOHVkJnS6Ir6XyB/pEwgO l1n0SteqmdJ+y7Pcscthd6x1Z223vELnsK9ak7SQxEb1B2OmEb0BpZHN3kMGDOcS e0zy6pVIYg28kg== X-ME-Sender: X-Sasl-enc: hreQiC+3ayzGNOJdX0wDDruKWIlJdcTrlSEl5VQdoMAW 1490323183 Received: from localhost (flamenco.cs.columbia.edu [128.59.20.216]) by mail.messagingengine.com (Postfix) with ESMTPA id B1CA1242B6; Thu, 23 Mar 2017 22:39:43 -0400 (EDT) Date: Thu, 23 Mar 2017 22:39:43 -0400 From: "Emilio G. Cota" To: Peter Maydell Message-ID: <20170324023943.GA21650@flamenco> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 66.111.4.25 Subject: Re: [Qemu-devel] compile failure if I enable guest_mem_before trace event X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: QEMU Developers , Stefan Hajnoczi , =?iso-8859-1?Q?Llu=EDs?= Vilanova Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" 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, '', )