[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-devel] [PATCH for-next 6/9] kconfig: add llvm coverage option
Just add the Kconfig option and modify the makefiles so the llvm coverage specific code can be added in a follow up patch. Signed-off-by: Roger Pau Monné <roger.pau@xxxxxxxxxx> --- Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx> Cc: George Dunlap <George.Dunlap@xxxxxxxxxxxxx> Cc: Ian Jackson <ian.jackson@xxxxxxxxxxxxx> Cc: Jan Beulich <jbeulich@xxxxxxxx> Cc: Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx> Cc: Stefano Stabellini <sstabellini@xxxxxxxxxx> Cc: Tim Deegan <tim@xxxxxxx> Cc: Wei Liu <wei.liu2@xxxxxxxxxx> --- xen/Kconfig.debug | 16 ++++++++++++++++ xen/Rules.mk | 4 ++++ xen/common/Makefile | 2 +- xen/common/coverage/Makefile | 4 ++++ xen/common/sysctl.c | 2 +- xen/include/xen/coverage.h | 2 +- 6 files changed, 27 insertions(+), 3 deletions(-) diff --git a/xen/Kconfig.debug b/xen/Kconfig.debug index 8d70f63743..46c72ea8bb 100644 --- a/xen/Kconfig.debug +++ b/xen/Kconfig.debug @@ -28,10 +28,17 @@ config FRAME_POINTER maybe slower, but it gives very useful debugging information in case of any Xen bugs. +# Hidden option enabled when either GCOV or LLVM coverage support is enabled. +# This allows to enable the shared coverage bits in Xen without having to +# check for each possible coverage implementation. +config COVERAGE + bool + config GCOV bool "Gcov Support" depends on !LIVEPATCH select SUPPRESS_DUPLICATE_SYMBOL_WARNINGS + select COVERAGE ---help--- Enable gcov (a test coverage program in GCC) support. @@ -83,6 +90,15 @@ config GCOV_FORMAT_3_4 endchoice +config LLVM_COVERAGE + bool "LLVM coverage support" + depends on !LIVEPATCH && !GCOV + select COVERAGE + ---help--- + Enable LLVM coverage support. + + If unsure, say N here. + config LOCK_PROFILE bool "Lock Profiling" ---help--- diff --git a/xen/Rules.mk b/xen/Rules.mk index 2659f8a4d1..076ba93185 100644 --- a/xen/Rules.mk +++ b/xen/Rules.mk @@ -119,6 +119,10 @@ ifeq ($(CONFIG_GCOV),y) $(filter-out %.init.o $(nogcov-y),$(obj-y) $(obj-bin-y) $(extra-y)): CFLAGS += -fprofile-arcs -ftest-coverage endif +ifeq ($(CONFIG_LLVM_COVERAGE),y) +$(filter-out %.init.o $(nogcov-y),$(obj-y) $(obj-bin-y) $(extra-y)): CFLAGS += -fprofile-instr-generate -fcoverage-mapping +endif + ifeq ($(CONFIG_UBSAN),y) $(filter-out %.init.o $(noubsan-y),$(obj-y) $(obj-bin-y) $(extra-y)): CFLAGS += -fsanitize=undefined endif diff --git a/xen/common/Makefile b/xen/common/Makefile index ad181636f6..3a349f478b 100644 --- a/xen/common/Makefile +++ b/xen/common/Makefile @@ -74,7 +74,7 @@ tmem-y := tmem.o tmem_xen.o tmem_control.o tmem-$(CONFIG_COMPAT) += compat/tmem_xen.o obj-$(CONFIG_TMEM) += $(tmem-y) -subdir-$(CONFIG_GCOV) += coverage +subdir-$(CONFIG_COVERAGE) += coverage subdir-$(CONFIG_UBSAN) += ubsan subdir-y += libelf diff --git a/xen/common/coverage/Makefile b/xen/common/coverage/Makefile index 0e0510679e..e4541a1233 100644 --- a/xen/common/coverage/Makefile +++ b/xen/common/coverage/Makefile @@ -1,3 +1,4 @@ +ifeq ($(CONFIG_GCOV),y) obj-y += gcov_base.o gcov.o coverage.o obj-$(CONFIG_GCOV_FORMAT_3_4) += gcc_3_4.o obj-$(CONFIG_GCOV_FORMAT_4_7) += gcc_4_7.o @@ -9,3 +10,6 @@ obj-$(CONFIG_GCOV_FORMAT_AUTODETECT) += $(call cc-ifversion,lt,0x040700, \ gcc_4_7.o, $(call cc-ifversion,lt,0x050000, \ gcc_4_9.o, $(call cc-ifversion,lt,0x070000, \ gcc_5.o, gcc_7.o)))) +else +obj-y += coverage.o +endif diff --git a/xen/common/sysctl.c b/xen/common/sysctl.c index da3e1246b1..e989b2711d 100644 --- a/xen/common/sysctl.c +++ b/xen/common/sysctl.c @@ -396,7 +396,7 @@ long do_sysctl(XEN_GUEST_HANDLE_PARAM(xen_sysctl_t) u_sysctl) } break; -#ifdef CONFIG_GCOV +#ifdef CONFIG_COVERAGE case XEN_SYSCTL_cov_op: ret = sysctl_cov_op(&op->u.cov_op); copyback = 1; diff --git a/xen/include/xen/coverage.h b/xen/include/xen/coverage.h index de400620bf..666bf624f9 100644 --- a/xen/include/xen/coverage.h +++ b/xen/include/xen/coverage.h @@ -1,7 +1,7 @@ #ifndef _XEN_GCOV_H #define _XEN_GCOV_H -#ifdef CONFIG_GCOV +#ifdef CONFIG_COVERAGE #include <public/sysctl.h> struct cov_sysctl_ops { -- 2.13.5 (Apple Git-94) _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx https://lists.xen.org/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |