From patchwork Fri Aug 25 16:43:36 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: George Dunlap X-Patchwork-Id: 9922505 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 24BF36022E for ; Fri, 25 Aug 2017 16:46:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 14A1D281D2 for ; Fri, 25 Aug 2017 16:46:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0945F283CF; Fri, 25 Aug 2017 16:46:31 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 778DA281D2 for ; Fri, 25 Aug 2017 16:46:30 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dlHiG-00054o-EY; Fri, 25 Aug 2017 16:44:04 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dlHiF-00050A-Ct for xen-devel@lists.xenproject.org; Fri, 25 Aug 2017 16:44:03 +0000 Received: from [85.158.139.211] by server-12.bemta-5.messagelabs.com id 27/43-01731-3D350A95; Fri, 25 Aug 2017 16:44:03 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFuplkeJIrShJLcpLzFFi42JxWrrBXvdi8IJ Ig4M/NSy+b5nM5MDocfjDFZYAxijWzLyk/IoE1oxvR48wFizUrfh/9wlrA+NT9S5GTg4JAX+J 3Uv2soDYbAJ6EvOOfwWyOThEBFQkbu816GLk4mAW2M8o0fv1BxtIXFggRGLDsySQchYBVYnG/ i42EJtXwFbi044lrBAj5SXOPbjNDFLOKWAnseskF4gpBFTy4oweSIUQUOfiB0fZIToFJU7OfA J2ALOAhMTBFy+YJzDyzkKSmoUktYCRaRWjenFqUVlqka6JXlJRZnpGSW5iZo6uoYGpXm5qcXF iempOYlKxXnJ+7iZGYNAwAMEOxlt9zocYJTmYlER5rV/OjxTiS8pPqcxILM6ILyrNSS0+xCjD waEkwSsXtCBSSLAoNT21Ii0zBxi+MGkJDh4lEV4ukDRvcUFibnFmOkTqFKMux4bV678wCbHk5 eelSonz/gkEKhIAKcoozYMbAYulS4yyUsK8jEBHCfEUpBblZpagyr9iFOdgVBLmtQVZxZOZVw K36RXQEUxAR0w6MQfkiJJEhJRUA6PBrRPKdwruW0i4bXCYMfP/mvU/1N7eiXv76a7hF4f/y1S Yq7dujLocG1J82LcwiHFLhW9Liyvr+u/btq82/34mbKpemogdT6Pw5J03Oyv364iH+Z3t+WzS x9+Woe2yUiy9K03pyZtJTmf4AysePwuxT898/+1hyqWWDSv3NSXLNzcfXju/K1uJpTgj0VCLu ag4EQAqwBeRoAIAAA== X-Env-Sender: prvs=4030414b0=George.Dunlap@citrix.com X-Msg-Ref: server-11.tower-206.messagelabs.com!1503679437!87780548!4 X-Originating-IP: [66.165.176.63] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAzMDYwNDg=\n, received_headers: No Received headers X-StarScan-Received: X-StarScan-Version: 9.4.45; banners=-,-,- X-VirusChecked: Checked Received: (qmail 36874 invoked from network); 25 Aug 2017 16:44:01 -0000 Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63) by server-11.tower-206.messagelabs.com with RC4-SHA encrypted SMTP; 25 Aug 2017 16:44:01 -0000 X-IronPort-AV: E=Sophos;i="5.41,426,1498521600"; d="scan'208";a="445163894" From: George Dunlap To: Date: Fri, 25 Aug 2017 17:43:36 +0100 Message-ID: <20170825164343.29015-7-george.dunlap@citrix.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20170825164343.29015-1-george.dunlap@citrix.com> References: <20170825164343.29015-1-george.dunlap@citrix.com> MIME-Version: 1.0 Cc: Ian Jackson , Wei Liu , George Dunlap , Jan Beulich , Andrew Cooper Subject: [Xen-devel] [PATCH 07/14] fuzz/x86_emulate: Rename the file containing the wrapper code X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP When generating coverage output, by default gcov generates output filenames based only on the coverage file and the "leaf" source file, not the full path. As a result, it uses the same name for x86_emulate.c and x86_emulate/x86_emulate.c, generally overwriting the second (which we actually are about) with the first (which is just a wrapper). Rename the user-space wrapper helpers to x86_emulate_user.[ch], so that it generates separate files. There is actually an option to gcov, `--preserve-paths`, which will cause the full path name to be included in the filename, properly distinguishing between the two. However, given that the user-space wrapper doesn't actually do any emulation (and the poor state of gcov documentation making it difficult to find the option in the first place), it seems to make more sense to rename the file anyway. Signed-off-by: George Dunlap --- NB: I discovered the `-p` option to gcov after writing this patch. But I think the patch itself still makes sense. CC: Ian Jackson CC: Wei Liu CC: Andrew Cooper CC: Jan Beulich --- tools/fuzz/x86_instruction_emulator/Makefile | 12 ++++++------ tools/fuzz/x86_instruction_emulator/fuzz-emul.c | 2 +- tools/tests/x86_emulator/Makefile | 6 +++--- tools/tests/x86_emulator/test_x86_emulator.c | 2 +- .../tests/x86_emulator/{x86_emulate.c => x86_emulate_user.c} | 2 +- .../tests/x86_emulator/{x86_emulate.h => x86_emulate_user.h} | 0 6 files changed, 12 insertions(+), 12 deletions(-) rename tools/tests/x86_emulator/{x86_emulate.c => x86_emulate_user.c} (99%) rename tools/tests/x86_emulator/{x86_emulate.h => x86_emulate_user.h} (100%) diff --git a/tools/fuzz/x86_instruction_emulator/Makefile b/tools/fuzz/x86_instruction_emulator/Makefile index a3f6b2c754..10009dc08f 100644 --- a/tools/fuzz/x86_instruction_emulator/Makefile +++ b/tools/fuzz/x86_instruction_emulator/Makefile @@ -18,22 +18,22 @@ asm: asm/%: asm ; -x86_emulate.c x86_emulate.h: %: +x86_emulate_user.c x86_emulate_user.h: %: [ -L $* ] || ln -sf $(XEN_ROOT)/tools/tests/x86_emulator/$* CFLAGS += $(CFLAGS_xeninclude) -D__XEN_TOOLS__ -I. x86.h := asm/x86-vendors.h asm/x86-defns.h asm/msr-index.h -x86_emulate.h := x86_emulate.h x86_emulate/x86_emulate.h $(x86.h) +x86_emulate.h := x86_emulate_user.h x86_emulate/x86_emulate.h $(x86.h) -x86_emulate.o: x86_emulate.c x86_emulate/x86_emulate.c $(x86_emulate.h) +x86_emulate_user.o: x86_emulate_user.c x86_emulate/x86_emulate.c $(x86_emulate.h) fuzz-emul.o: $(x86_emulate.h) -x86-insn-fuzzer.a: fuzz-emul.o x86_emulate.o +x86-insn-fuzzer.a: fuzz-emul.o x86_emulate_user.o $(AR) rc $@ $^ -afl-harness: afl-harness.o fuzz-emul.o x86_emulate.o +afl-harness: afl-harness.o fuzz-emul.o x86_emulate_user.o $(CC) $(CFLAGS) $^ -o $@ # Common targets @@ -42,7 +42,7 @@ all: x86-insn-fuzz-all .PHONY: distclean distclean: clean - rm -f x86_emulate x86_emulate.c x86_emulate.h asm + rm -f x86_emulate x86_emulate_user.c x86_emulate_user.h asm .PHONY: clean clean: diff --git a/tools/fuzz/x86_instruction_emulator/fuzz-emul.c b/tools/fuzz/x86_instruction_emulator/fuzz-emul.c index 0f5ff0b265..746e7989af 100644 --- a/tools/fuzz/x86_instruction_emulator/fuzz-emul.c +++ b/tools/fuzz/x86_instruction_emulator/fuzz-emul.c @@ -15,7 +15,7 @@ #include #include -#include "x86_emulate.h" +#include "x86_emulate_user.h" #define MSR_INDEX_MAX 16 diff --git a/tools/tests/x86_emulator/Makefile b/tools/tests/x86_emulator/Makefile index fd13ab53b1..888495a6a2 100644 --- a/tools/tests/x86_emulator/Makefile +++ b/tools/tests/x86_emulator/Makefile @@ -75,7 +75,7 @@ $(addsuffix .h,$(TESTCASES)): %.h: %.c testcase.mk Makefile $(addsuffix .c,$(SIMD)) $(addsuffix -avx.c,$(filter sse%,$(SIMD))): ln -sf simd.c $@ -$(TARGET): x86_emulate.o test_x86_emulator.o +$(TARGET): x86_emulate_user.o test_x86_emulator.o $(HOSTCC) -o $@ $^ .PHONY: clean @@ -101,9 +101,9 @@ asm/%: asm ; HOSTCFLAGS += $(CFLAGS_xeninclude) -I. x86.h := asm/x86-vendors.h asm/x86-defns.h asm/msr-index.h -x86_emulate.h := x86_emulate.h x86_emulate/x86_emulate.h $(x86.h) +x86_emulate.h := x86_emulate_user.h x86_emulate/x86_emulate.h $(x86.h) -x86_emulate.o: x86_emulate.c x86_emulate/x86_emulate.c $(x86_emulate.h) +x86_emulate_user.o: x86_emulate_user.c x86_emulate/x86_emulate.c $(x86_emulate.h) $(HOSTCC) $(HOSTCFLAGS) -D__XEN_TOOLS__ -c -g -o $@ $< test_x86_emulator.o: test_x86_emulator.c $(addsuffix .h,$(TESTCASES)) $(x86_emulate.h) diff --git a/tools/tests/x86_emulator/test_x86_emulator.c b/tools/tests/x86_emulator/test_x86_emulator.c index 76665abda5..0d8cba1ad5 100644 --- a/tools/tests/x86_emulator/test_x86_emulator.c +++ b/tools/tests/x86_emulator/test_x86_emulator.c @@ -3,7 +3,7 @@ #include #include -#include "x86_emulate.h" +#include "x86_emulate_user.h" #include "blowfish.h" #include "sse.h" #include "sse2.h" diff --git a/tools/tests/x86_emulator/x86_emulate.c b/tools/tests/x86_emulator/x86_emulate_user.c similarity index 99% rename from tools/tests/x86_emulator/x86_emulate.c rename to tools/tests/x86_emulator/x86_emulate_user.c index 79661d5c2b..adae6950c8 100644 --- a/tools/tests/x86_emulator/x86_emulate.c +++ b/tools/tests/x86_emulator/x86_emulate_user.c @@ -1,4 +1,4 @@ -#include "x86_emulate.h" +#include "x86_emulate_user.h" #include diff --git a/tools/tests/x86_emulator/x86_emulate.h b/tools/tests/x86_emulator/x86_emulate_user.h similarity index 100% rename from tools/tests/x86_emulator/x86_emulate.h rename to tools/tests/x86_emulator/x86_emulate_user.h