From patchwork Thu Feb 11 12:11:21 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Campbell X-Patchwork-Id: 8278371 Return-Path: X-Original-To: patchwork-xen-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 6B960BEEE5 for ; Thu, 11 Feb 2016 12:14:34 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7815120364 for ; Thu, 11 Feb 2016 12:14:33 +0000 (UTC) Received: from lists.xen.org (lists.xenproject.org [50.57.142.19]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 91DEC2035D for ; Thu, 11 Feb 2016 12:14:32 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xen.org) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1aTq65-0007Wx-EC; Thu, 11 Feb 2016 12:11:45 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1aTq63-0007Ws-Rf for xen-devel@lists.xen.org; Thu, 11 Feb 2016 12:11:43 +0000 Received: from [85.158.137.68] by server-2.bemta-3.messagelabs.com id 4D/26-21201-F7A7CB65; Thu, 11 Feb 2016 12:11:43 +0000 X-Env-Sender: prvs=842d64d66=Ian.Campbell@citrix.com X-Msg-Ref: server-15.tower-31.messagelabs.com!1455192701!21434305!1 X-Originating-IP: [66.165.176.89] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAyMDMwMDc=\n, received_headers: No Received headers X-StarScan-Received: X-StarScan-Version: 7.35.1; banners=-,-,- X-VirusChecked: Checked Received: (qmail 2929 invoked from network); 11 Feb 2016 12:11:42 -0000 Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89) by server-15.tower-31.messagelabs.com with RC4-SHA encrypted SMTP; 11 Feb 2016 12:11:42 -0000 X-IronPort-AV: E=Sophos;i="5.22,430,1449532800"; d="scan'208";a="331063319" From: Ian Campbell To: , , , Date: Thu, 11 Feb 2016 12:11:21 +0000 Message-ID: <1455192681-13003-1-git-send-email-ian.campbell@citrix.com> X-Mailer: git-send-email 2.1.4 MIME-Version: 1.0 X-DLP: MIA2 Cc: Anthony PERARD , Paul Durrant , Ian Campbell Subject: [Xen-devel] [PATCH v2] tools: probe for existence of qemu-xen stderr trace backend. X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP QEMU upstream commit ed7f5f1d8db0 ("trace: convert stderr backend to log") renamed the "stderr" trace backend to "log", which breaks the xen build when pointed at a QEMU tree after that point: ./configure of QEMU fail with: "ERROR: invalid trace backends Please choose supported trace backends." Upstream also changed, in baf86d6b3ca0 ("trace: switch default backend to "log""), to use "log" as the default backend (previously it was "nop"). Use ./scripts/tracetool.py to check for the presence of the stderr backend and if it is present then explicitly enable it. If the stderr backend is not present then assume a newer QEMU which defaults to "log" and simply accept that default (there is a 1 commit window upstream where this would result in no trace backend being enabled). The check is done using the older (deprecated?) --check-backend/--backend variant of the tracetool.py options rather than the new plural versions since the singular was supported even by very old versions of QEMU. New QEMU has compatibility code but if/when that is removed we will still do the right thing i.e. no explict configuiration resulting in the upstream default (currently "log"). If the explicit selection of the "stderr" backend is required then it is now done unconditionally (not depending on debug=y), which is simpler to arrange here but also matches the newer upstream's default to "log" which is not conditional on debug being enabled either. Tested with current qemu-xen-unstable (e9d8252) and current QEMU upstream master (88c73d1), both out of tree via QEMU_UPSTREAM_URL=/path/to/qemu-xen.git. Signed-off-by: Ian Campbell Cc: Paul Durrant Cc: Anthony PERARD Reviewed-by: Paul Durrant Reviewed-by: Stefano Stabellini Acked-by: Wei Liu --- v2: Just probe for stderr, otherwise assume the new upstream default of log is what we will get anyway. Substantially rewrite commit message. --- tools/Makefile | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tools/Makefile b/tools/Makefile index cb8652c..3f45fb9 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -228,7 +228,7 @@ qemu-xen-dir-force-update: qemu-xen-dir-find fi ifeq ($(debug),y) -QEMU_XEN_ENABLE_DEBUG := --enable-debug --enable-trace-backend=stderr +QEMU_XEN_ENABLE_DEBUG := --enable-debug else QEMU_XEN_ENABLE_DEBUG := endif @@ -240,8 +240,14 @@ subdir-all-qemu-xen-dir: qemu-xen-dir-find source=.; \ fi; \ cd qemu-xen-dir; \ + if $$source/scripts/tracetool.py --check-backend --backend stderr ; then \ + enable_trace_backend='--enable-trace-backend=stderr'; \ + else \ + enable_trace_backend='' ; \ + fi ; \ $$source/configure --enable-xen --target-list=i386-softmmu \ $(QEMU_XEN_ENABLE_DEBUG) \ + $$enable_trace_backend \ --prefix=$(LIBEXEC) \ --libdir=$(LIBEXEC_LIB) \ --includedir=$(LIBEXEC_INC) \