@@ -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:
@@ -15,7 +15,7 @@
#include <unistd.h>
#include <xen/xen.h>
-#include "x86_emulate.h"
+#include "x86_emulate_user.h"
#define MSR_INDEX_MAX 16
@@ -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)
@@ -3,7 +3,7 @@
#include <stdio.h>
#include <sys/mman.h>
-#include "x86_emulate.h"
+#include "x86_emulate_user.h"
#include "blowfish.h"
#include "sse.h"
#include "sse2.h"
similarity index 99%
rename from tools/tests/x86_emulator/x86_emulate.c
rename to tools/tests/x86_emulator/x86_emulate_user.c
@@ -1,4 +1,4 @@
-#include "x86_emulate.h"
+#include "x86_emulate_user.h"
#include <sys/mman.h>
similarity index 100%
rename from tools/tests/x86_emulator/x86_emulate.h
rename to tools/tests/x86_emulator/x86_emulate_user.h
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 <george.dunlap@citrix.com> --- NB: I discovered the `-p` option to gcov after writing this patch. But I think the patch itself still makes sense. CC: Ian Jackson <ian.jackson@citrix.com> CC: Wei Liu <wei.liu2@citrix.com> CC: Andrew Cooper <andrew.cooper3@citrix.com> CC: Jan Beulich <jbeulich@suse.com> --- 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%)