All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 for-next 0/9] LLVM coverage support for Xen
@ 2017-11-09 11:13 Roger Pau Monne
  2017-11-09 11:13 ` [PATCH v2 for-next 1/9] kconfig/gcov: remove gcc version choice from kconfig Roger Pau Monne
                   ` (8 more replies)
  0 siblings, 9 replies; 24+ messages in thread
From: Roger Pau Monne @ 2017-11-09 11:13 UTC (permalink / raw)
  To: xen-devel; +Cc: Roger Pau Monne

Hello,

The following patch series enables LLVM coverage support for the Xen
hypervisor. This first patches are a re-organization of the gcov
support, in order to make the support generic for all coverage
technologies. This is mostly a name change from gcov -> cov in several
places and files, together with the addition of a Kconfig option in
order to enable LLVM coverage.

Patch 7 introduces the actual LLVM coverage support code that allows
fetching the coverage data from Xen. Finally patch 9 adds the
documentation on how to use this feature.

A sample coverage report obtained after booting a PVHv2 Dom0 can be
found at:

http://xenbits.xen.org/people/royger/xen_profile/

Thanks, Roger.

Roger Pau Monne (9):
  kconfig/gcov: remove gcc version choice from kconfig
  gcov: rename folder and header to coverage
  gcov: rename sysctl and functions
  gcov: introduce hooks for the sysctl
  coverage: introduce generic file
  kconfig/gcov: rename to coverage
  coverage: introduce support for llvm profiling
  xsm: add bodge when compiling with llvm coverage support
  coverage: add documentation for LLVM coverage

 docs/misc/coverage.markdown               |  49 +++++++++-
 tools/misc/xencov.c                       |  28 +++---
 xen/Kconfig.debug                         |  53 +---------
 xen/Rules.mk                              |   6 +-
 xen/common/Makefile                       |   2 +-
 xen/common/coverage/Makefile              |  11 +++
 xen/common/coverage/coverage.c            |  73 ++++++++++++++
 xen/common/coverage/coverage.h            |  13 +++
 xen/common/{gcov => coverage}/gcc_3_4.c   |   0
 xen/common/{gcov => coverage}/gcc_4_7.c   |   0
 xen/common/{gcov => coverage}/gcc_4_9.c   |   0
 xen/common/{gcov => coverage}/gcc_5.c     |   0
 xen/common/{gcov => coverage}/gcc_7.c     |   0
 xen/common/{gcov => coverage}/gcov.c      |  42 ++------
 xen/common/{gcov => coverage}/gcov.h      |   0
 xen/common/{gcov => coverage}/gcov_base.c |   0
 xen/common/coverage/llvm.c                | 154 ++++++++++++++++++++++++++++++
 xen/common/gcov/Makefile                  |  11 ---
 xen/common/sysctl.c                       |   8 +-
 xen/include/public/sysctl.h               |  18 ++--
 xen/include/xen/coverage.h                |  14 +++
 xen/include/xen/gcov.h                    |   9 --
 xen/include/xsm/dummy.h                   |  14 +++
 23 files changed, 371 insertions(+), 134 deletions(-)
 create mode 100644 xen/common/coverage/Makefile
 create mode 100644 xen/common/coverage/coverage.c
 create mode 100644 xen/common/coverage/coverage.h
 rename xen/common/{gcov => coverage}/gcc_3_4.c (100%)
 rename xen/common/{gcov => coverage}/gcc_4_7.c (100%)
 rename xen/common/{gcov => coverage}/gcc_4_9.c (100%)
 rename xen/common/{gcov => coverage}/gcc_5.c (100%)
 rename xen/common/{gcov => coverage}/gcc_7.c (100%)
 rename xen/common/{gcov => coverage}/gcov.c (89%)
 rename xen/common/{gcov => coverage}/gcov.h (100%)
 rename xen/common/{gcov => coverage}/gcov_base.c (100%)
 create mode 100644 xen/common/coverage/llvm.c
 delete mode 100644 xen/common/gcov/Makefile
 create mode 100644 xen/include/xen/coverage.h
 delete mode 100644 xen/include/xen/gcov.h

-- 
2.13.6 (Apple Git-96)


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 24+ messages in thread

* [PATCH v2 for-next 1/9] kconfig/gcov: remove gcc version choice from kconfig
  2017-11-09 11:13 [PATCH v2 for-next 0/9] LLVM coverage support for Xen Roger Pau Monne
@ 2017-11-09 11:13 ` Roger Pau Monne
  2017-11-27 14:51   ` Jan Beulich
  2017-12-01 12:14   ` Wei Liu
  2017-11-09 11:13 ` [PATCH v2 for-next 2/9] gcov: rename folder and header to coverage Roger Pau Monne
                   ` (7 subsequent siblings)
  8 siblings, 2 replies; 24+ messages in thread
From: Roger Pau Monne @ 2017-11-09 11:13 UTC (permalink / raw)
  To: xen-devel
  Cc: Stefano Stabellini, Wei Liu, Konrad Rzeszutek Wilk,
	George Dunlap, Andrew Cooper, Ian Jackson, Tim Deegan,
	Jan Beulich, Roger Pau Monne

Use autodetect only.

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
---
Cc: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: George Dunlap <George.Dunlap@eu.citrix.com>
Cc: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: Jan Beulich <jbeulich@suse.com>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: Stefano Stabellini <sstabellini@kernel.org>
Cc: Tim Deegan <tim@xen.org>
Cc: Wei Liu <wei.liu2@citrix.com>
---
Changes since v1:
 - New in this version.
---
 xen/Kconfig.debug        | 46 ----------------------------------------------
 xen/common/gcov/Makefile | 15 +++++----------
 2 files changed, 5 insertions(+), 56 deletions(-)

diff --git a/xen/Kconfig.debug b/xen/Kconfig.debug
index 8d70f63743..7bb0465b5d 100644
--- a/xen/Kconfig.debug
+++ b/xen/Kconfig.debug
@@ -37,52 +37,6 @@ config GCOV
 
 	  If unsure, say N here.
 
-choice
-	prompt "Specify Gcov format"
-	depends on GCOV
-	default GCOV_FORMAT_AUTODETECT
-	---help---
-	  The gcov format is determined by gcc version.
-
-	  If unsure, choose "Autodetect".
-
-config GCOV_FORMAT_AUTODETECT
-	bool "Autodetect"
-	---help---
-	  Automatically select gcov format based on gcc version.
-
-config GCOV_FORMAT_7
-	bool "GCC 7 format"
-	---help---
-	  Select this option to use the format specified in GCC 7.
-	  Works in gcc version range [7, ...).
-
-config GCOV_FORMAT_5
-	bool "GCC 5 format"
-	---help---
-	  Select this option to use the format specified in GCC 5.
-	  Works in gcc version range [5, 7).
-
-config GCOV_FORMAT_4_9
-	bool "GCC 4.9 format"
-	---help---
-	  Select this option to use the format specified in GCC 4.9.
-	  Works in gcc version range [4.9, 5).
-
-config GCOV_FORMAT_4_7
-	bool "GCC 4.7 format"
-	---help---
-	  Select this option to use the format specified in GCC 4.7.
-	  Works in gcc version range [4.7, 4.9).
-
-config GCOV_FORMAT_3_4
-	bool "GCC 3.4 format"
-	---help---
-	  Select this option to use the format specified in GCC 3.4.
-	  Works in gcc version range [3.4, 4.7).
-
-endchoice
-
 config LOCK_PROFILE
 	bool "Lock Profiling"
 	---help---
diff --git a/xen/common/gcov/Makefile b/xen/common/gcov/Makefile
index f68d050eca..a7a48494ca 100644
--- a/xen/common/gcov/Makefile
+++ b/xen/common/gcov/Makefile
@@ -1,11 +1,6 @@
 obj-y += gcov_base.o gcov.o
-obj-$(CONFIG_GCOV_FORMAT_3_4) += gcc_3_4.o
-obj-$(CONFIG_GCOV_FORMAT_4_7) += gcc_4_7.o
-obj-$(CONFIG_GCOV_FORMAT_4_9) += gcc_4_9.o
-obj-$(CONFIG_GCOV_FORMAT_5)   += gcc_5.o
-obj-$(CONFIG_GCOV_FORMAT_7)   += gcc_7.o
-obj-$(CONFIG_GCOV_FORMAT_AUTODETECT) += $(call cc-ifversion,lt,0x040700, \
-						gcc_3_4.o, $(call cc-ifversion,lt,0x040900, \
-						gcc_4_7.o, $(call cc-ifversion,lt,0x050000, \
-						gcc_4_9.o, $(call cc-ifversion,lt,0x070000, \
-						gcc_5.o, gcc_7.o))))
+obj-y += $(call cc-ifversion,lt,0x040700, \
+		gcc_3_4.o, $(call cc-ifversion,lt,0x040900, \
+		gcc_4_7.o, $(call cc-ifversion,lt,0x050000, \
+		gcc_4_9.o, $(call cc-ifversion,lt,0x070000, \
+		gcc_5.o, gcc_7.o))))
-- 
2.13.6 (Apple Git-96)


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH v2 for-next 2/9] gcov: rename folder and header to coverage
  2017-11-09 11:13 [PATCH v2 for-next 0/9] LLVM coverage support for Xen Roger Pau Monne
  2017-11-09 11:13 ` [PATCH v2 for-next 1/9] kconfig/gcov: remove gcc version choice from kconfig Roger Pau Monne
@ 2017-11-09 11:13 ` Roger Pau Monne
  2017-11-16 22:24   ` Konrad Rzeszutek Wilk
  2017-11-09 11:13 ` [PATCH v2 for-next 3/9] gcov: rename sysctl and functions Roger Pau Monne
                   ` (6 subsequent siblings)
  8 siblings, 1 reply; 24+ messages in thread
From: Roger Pau Monne @ 2017-11-09 11:13 UTC (permalink / raw)
  To: xen-devel
  Cc: Stefano Stabellini, Wei Liu, Konrad Rzeszutek Wilk,
	George Dunlap, Andrew Cooper, Ian Jackson, Tim Deegan,
	Jan Beulich, Roger Pau Monne

Preparatory change before adding llvm profiling support.
No functional change.

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
---
Cc: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: George Dunlap <George.Dunlap@eu.citrix.com>
Cc: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: Jan Beulich <jbeulich@suse.com>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: Stefano Stabellini <sstabellini@kernel.org>
Cc: Tim Deegan <tim@xen.org>
Cc: Wei Liu <wei.liu2@citrix.com>
---
Changes since v1:
 - Rename guard in coverage.h header.
---
 xen/common/Makefile                       | 2 +-
 xen/common/{gcov => coverage}/Makefile    | 0
 xen/common/{gcov => coverage}/gcc_3_4.c   | 0
 xen/common/{gcov => coverage}/gcc_4_7.c   | 0
 xen/common/{gcov => coverage}/gcc_4_9.c   | 0
 xen/common/{gcov => coverage}/gcc_5.c     | 0
 xen/common/{gcov => coverage}/gcc_7.c     | 0
 xen/common/{gcov => coverage}/gcov.c      | 0
 xen/common/{gcov => coverage}/gcov.h      | 0
 xen/common/{gcov => coverage}/gcov_base.c | 0
 xen/common/sysctl.c                       | 2 +-
 xen/include/xen/{gcov.h => coverage.h}    | 4 ++--
 12 files changed, 4 insertions(+), 4 deletions(-)
 rename xen/common/{gcov => coverage}/Makefile (100%)
 rename xen/common/{gcov => coverage}/gcc_3_4.c (100%)
 rename xen/common/{gcov => coverage}/gcc_4_7.c (100%)
 rename xen/common/{gcov => coverage}/gcc_4_9.c (100%)
 rename xen/common/{gcov => coverage}/gcc_5.c (100%)
 rename xen/common/{gcov => coverage}/gcc_7.c (100%)
 rename xen/common/{gcov => coverage}/gcov.c (100%)
 rename xen/common/{gcov => coverage}/gcov.h (100%)
 rename xen/common/{gcov => coverage}/gcov_base.c (100%)
 rename xen/include/xen/{gcov.h => coverage.h} (76%)

diff --git a/xen/common/Makefile b/xen/common/Makefile
index 66cc2c8995..ad181636f6 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) += gcov
+subdir-$(CONFIG_GCOV) += coverage
 subdir-$(CONFIG_UBSAN) += ubsan
 
 subdir-y += libelf
diff --git a/xen/common/gcov/Makefile b/xen/common/coverage/Makefile
similarity index 100%
rename from xen/common/gcov/Makefile
rename to xen/common/coverage/Makefile
diff --git a/xen/common/gcov/gcc_3_4.c b/xen/common/coverage/gcc_3_4.c
similarity index 100%
rename from xen/common/gcov/gcc_3_4.c
rename to xen/common/coverage/gcc_3_4.c
diff --git a/xen/common/gcov/gcc_4_7.c b/xen/common/coverage/gcc_4_7.c
similarity index 100%
rename from xen/common/gcov/gcc_4_7.c
rename to xen/common/coverage/gcc_4_7.c
diff --git a/xen/common/gcov/gcc_4_9.c b/xen/common/coverage/gcc_4_9.c
similarity index 100%
rename from xen/common/gcov/gcc_4_9.c
rename to xen/common/coverage/gcc_4_9.c
diff --git a/xen/common/gcov/gcc_5.c b/xen/common/coverage/gcc_5.c
similarity index 100%
rename from xen/common/gcov/gcc_5.c
rename to xen/common/coverage/gcc_5.c
diff --git a/xen/common/gcov/gcc_7.c b/xen/common/coverage/gcc_7.c
similarity index 100%
rename from xen/common/gcov/gcc_7.c
rename to xen/common/coverage/gcc_7.c
diff --git a/xen/common/gcov/gcov.c b/xen/common/coverage/gcov.c
similarity index 100%
rename from xen/common/gcov/gcov.c
rename to xen/common/coverage/gcov.c
diff --git a/xen/common/gcov/gcov.h b/xen/common/coverage/gcov.h
similarity index 100%
rename from xen/common/gcov/gcov.h
rename to xen/common/coverage/gcov.h
diff --git a/xen/common/gcov/gcov_base.c b/xen/common/coverage/gcov_base.c
similarity index 100%
rename from xen/common/gcov/gcov_base.c
rename to xen/common/coverage/gcov_base.c
diff --git a/xen/common/sysctl.c b/xen/common/sysctl.c
index 08198b7150..56def766e6 100644
--- a/xen/common/sysctl.c
+++ b/xen/common/sysctl.c
@@ -27,7 +27,7 @@
 #include <xsm/xsm.h>
 #include <xen/pmstat.h>
 #include <xen/livepatch.h>
-#include <xen/gcov.h>
+#include <xen/coverage.h>
 
 long do_sysctl(XEN_GUEST_HANDLE_PARAM(xen_sysctl_t) u_sysctl)
 {
diff --git a/xen/include/xen/gcov.h b/xen/include/xen/coverage.h
similarity index 76%
rename from xen/include/xen/gcov.h
rename to xen/include/xen/coverage.h
index ef22eafc1f..b34c304cba 100644
--- a/xen/include/xen/gcov.h
+++ b/xen/include/xen/coverage.h
@@ -1,5 +1,5 @@
-#ifndef _XEN_GCOV_H
-#define _XEN_GCOV_H
+#ifndef _XEN_COV_H
+#define _XEN_COV_H
 
 #ifdef CONFIG_GCOV
 #include <public/sysctl.h>
-- 
2.13.6 (Apple Git-96)


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH v2 for-next 3/9] gcov: rename sysctl and functions
  2017-11-09 11:13 [PATCH v2 for-next 0/9] LLVM coverage support for Xen Roger Pau Monne
  2017-11-09 11:13 ` [PATCH v2 for-next 1/9] kconfig/gcov: remove gcc version choice from kconfig Roger Pau Monne
  2017-11-09 11:13 ` [PATCH v2 for-next 2/9] gcov: rename folder and header to coverage Roger Pau Monne
@ 2017-11-09 11:13 ` Roger Pau Monne
  2017-11-16 22:24   ` Konrad Rzeszutek Wilk
  2018-01-23  9:37   ` Jan Beulich
  2017-11-09 11:13 ` [PATCH v2 for-next 4/9] gcov: introduce hooks for the sysctl Roger Pau Monne
                   ` (5 subsequent siblings)
  8 siblings, 2 replies; 24+ messages in thread
From: Roger Pau Monne @ 2017-11-09 11:13 UTC (permalink / raw)
  To: xen-devel
  Cc: Stefano Stabellini, Wei Liu, Konrad Rzeszutek Wilk,
	George Dunlap, Andrew Cooper, Ian Jackson, Tim Deegan,
	Jan Beulich, Roger Pau Monne

Change gcov to cov (for internal interfaces) or coverage (for the
public ones).

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
---
Cc: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: Wei Liu <wei.liu2@citrix.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: George Dunlap <George.Dunlap@eu.citrix.com>
Cc: Jan Beulich <jbeulich@suse.com>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: Stefano Stabellini <sstabellini@kernel.org>
Cc: Tim Deegan <tim@xen.org>
---
Changes since v1:
 - Use coverage instead of cov in the public interface.
---
 tools/misc/xencov.c         | 28 ++++++++++++++--------------
 xen/common/coverage/gcov.c  |  8 ++++----
 xen/common/sysctl.c         |  4 ++--
 xen/include/public/sysctl.h | 12 ++++++------
 xen/include/xen/coverage.h  |  2 +-
 5 files changed, 27 insertions(+), 27 deletions(-)

diff --git a/tools/misc/xencov.c b/tools/misc/xencov.c
index 4130f425dc..e5b40dba9c 100644
--- a/tools/misc/xencov.c
+++ b/tools/misc/xencov.c
@@ -26,31 +26,31 @@
 
 static xc_interface *xch = NULL;
 
-int gcov_sysctl(int op, struct xen_sysctl *sysctl,
-                struct xc_hypercall_buffer *buf, uint32_t buf_size)
+int cov_sysctl(int op, struct xen_sysctl *sysctl,
+               struct xc_hypercall_buffer *buf, uint32_t buf_size)
 {
     DECLARE_HYPERCALL_BUFFER_ARGUMENT(buf);
 
     memset(sysctl, 0, sizeof(*sysctl));
-    sysctl->cmd = XEN_SYSCTL_gcov_op;
+    sysctl->cmd = XEN_SYSCTL_coverage_op;
 
-    sysctl->u.gcov_op.cmd = op;
-    sysctl->u.gcov_op.size = buf_size;
-    set_xen_guest_handle(sysctl->u.gcov_op.buffer, buf);
+    sysctl->u.coverage_op.cmd = op;
+    sysctl->u.coverage_op.size = buf_size;
+    set_xen_guest_handle(sysctl->u.coverage_op.buffer, buf);
 
     return xc_sysctl(xch, sysctl);
 }
 
-static void gcov_read(const char *fn)
+static void cov_read(const char *fn)
 {
     struct xen_sysctl sys;
     uint32_t total_len;
     DECLARE_HYPERCALL_BUFFER(uint8_t, p);
     FILE *f;
 
-    if (gcov_sysctl(XEN_SYSCTL_GCOV_get_size, &sys, NULL, 0) < 0)
+    if (cov_sysctl(XEN_SYSCTL_COVERAGE_get_size, &sys, NULL, 0) < 0)
         err(1, "getting total length");
-    total_len = sys.u.gcov_op.size;
+    total_len = sys.u.coverage_op.size;
 
     /* Shouldn't exceed a few hundred kilobytes */
     if (total_len > 8u * 1024u * 1024u)
@@ -61,7 +61,7 @@ static void gcov_read(const char *fn)
         err(1, "allocating buffer");
 
     memset(p, 0, total_len);
-    if (gcov_sysctl(XEN_SYSCTL_GCOV_read, &sys, HYPERCALL_BUFFER(p),
+    if (cov_sysctl(XEN_SYSCTL_COVERAGE_read, &sys, HYPERCALL_BUFFER(p),
                     total_len) < 0)
         err(1, "getting gcov data");
 
@@ -82,11 +82,11 @@ static void gcov_read(const char *fn)
     xc_hypercall_buffer_free(xch, p);
 }
 
-static void gcov_reset(void)
+static void cov_reset(void)
 {
     struct xen_sysctl sys;
 
-    if (gcov_sysctl(XEN_SYSCTL_GCOV_reset, &sys, NULL, 0) < 0)
+    if (cov_sysctl(XEN_SYSCTL_COVERAGE_reset, &sys, NULL, 0) < 0)
         err(1, "resetting gcov information");
 }
 
@@ -126,9 +126,9 @@ int main(int argc, char **argv)
         err(1, "opening xc interface");
 
     if (strcmp(argv[0], "reset") == 0)
-        gcov_reset();
+        cov_reset();
     else if (strcmp(argv[0], "read") == 0)
-        gcov_read(argc > 1 ? argv[1] : "-");
+        cov_read(argc > 1 ? argv[1] : "-");
     else
         usage(1);
 
diff --git a/xen/common/coverage/gcov.c b/xen/common/coverage/gcov.c
index 283d2eec86..798032cbbb 100644
--- a/xen/common/coverage/gcov.c
+++ b/xen/common/coverage/gcov.c
@@ -209,18 +209,18 @@ static int gcov_dump_all(XEN_GUEST_HANDLE_PARAM(char) buffer,
     return ret;
 }
 
-int sysctl_gcov_op(struct xen_sysctl_gcov_op *op)
+int sysctl_cov_op(struct xen_sysctl_coverage_op *op)
 {
     int ret;
 
     switch ( op->cmd )
     {
-    case XEN_SYSCTL_GCOV_get_size:
+    case XEN_SYSCTL_COVERAGE_get_size:
         op->size = gcov_get_size();
         ret = 0;
         break;
 
-    case XEN_SYSCTL_GCOV_read:
+    case XEN_SYSCTL_COVERAGE_read:
     {
         XEN_GUEST_HANDLE_PARAM(char) buf;
         uint32_t size = op->size;
@@ -233,7 +233,7 @@ int sysctl_gcov_op(struct xen_sysctl_gcov_op *op)
         break;
     }
 
-    case XEN_SYSCTL_GCOV_reset:
+    case XEN_SYSCTL_COVERAGE_reset:
         gcov_reset_all_counters();
         ret = 0;
         break;
diff --git a/xen/common/sysctl.c b/xen/common/sysctl.c
index 56def766e6..f2ae6295ff 100644
--- a/xen/common/sysctl.c
+++ b/xen/common/sysctl.c
@@ -397,8 +397,8 @@ long do_sysctl(XEN_GUEST_HANDLE_PARAM(xen_sysctl_t) u_sysctl)
     break;
 
 #ifdef CONFIG_GCOV
-    case XEN_SYSCTL_gcov_op:
-        ret = sysctl_gcov_op(&op->u.gcov_op);
+    case XEN_SYSCTL_coverage_op:
+        ret = sysctl_cov_op(&op->u.coverage_op);
         copyback = 1;
         break;
 #endif
diff --git a/xen/include/public/sysctl.h b/xen/include/public/sysctl.h
index 6140f1a059..3566f2eb69 100644
--- a/xen/include/public/sysctl.h
+++ b/xen/include/public/sysctl.h
@@ -646,11 +646,11 @@ struct xen_sysctl_scheduler_op {
 
 #define XEN_GCOV_FORMAT_MAGIC    0x58434f56 /* XCOV */
 
-#define XEN_SYSCTL_GCOV_get_size 0 /* Get total size of output data */
-#define XEN_SYSCTL_GCOV_read     1 /* Read output data */
-#define XEN_SYSCTL_GCOV_reset    2 /* Reset all counters */
+#define XEN_SYSCTL_COVERAGE_get_size 0 /* Get total size of output data */
+#define XEN_SYSCTL_COVERAGE_read     1 /* Read output data */
+#define XEN_SYSCTL_COVERAGE_reset    2 /* Reset all counters */
 
-struct xen_sysctl_gcov_op {
+struct xen_sysctl_coverage_op {
     uint32_t cmd;
     uint32_t size; /* IN/OUT: size of the buffer  */
     XEN_GUEST_HANDLE_64(char) buffer; /* OUT */
@@ -1065,7 +1065,7 @@ struct xen_sysctl {
 #define XEN_SYSCTL_numainfo                      17
 #define XEN_SYSCTL_cpupool_op                    18
 #define XEN_SYSCTL_scheduler_op                  19
-#define XEN_SYSCTL_gcov_op                       20
+#define XEN_SYSCTL_coverage_op                   20
 #define XEN_SYSCTL_psr_cmt_op                    21
 #define XEN_SYSCTL_pcitopoinfo                   22
 #define XEN_SYSCTL_psr_cat_op                    23
@@ -1095,7 +1095,7 @@ struct xen_sysctl {
         struct xen_sysctl_lockprof_op       lockprof_op;
         struct xen_sysctl_cpupool_op        cpupool_op;
         struct xen_sysctl_scheduler_op      scheduler_op;
-        struct xen_sysctl_gcov_op           gcov_op;
+        struct xen_sysctl_coverage_op       coverage_op;
         struct xen_sysctl_psr_cmt_op        psr_cmt_op;
         struct xen_sysctl_psr_cat_op        psr_cat_op;
         struct xen_sysctl_tmem_op           tmem_op;
diff --git a/xen/include/xen/coverage.h b/xen/include/xen/coverage.h
index b34c304cba..daddef37d3 100644
--- a/xen/include/xen/coverage.h
+++ b/xen/include/xen/coverage.h
@@ -3,7 +3,7 @@
 
 #ifdef CONFIG_GCOV
 #include <public/sysctl.h>
-int sysctl_gcov_op(struct xen_sysctl_gcov_op *op);
+int sysctl_cov_op(struct xen_sysctl_coverage_op *op);
 #endif
 
 #endif	/* _XEN_GCOV_H */
-- 
2.13.6 (Apple Git-96)


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH v2 for-next 4/9] gcov: introduce hooks for the sysctl
  2017-11-09 11:13 [PATCH v2 for-next 0/9] LLVM coverage support for Xen Roger Pau Monne
                   ` (2 preceding siblings ...)
  2017-11-09 11:13 ` [PATCH v2 for-next 3/9] gcov: rename sysctl and functions Roger Pau Monne
@ 2017-11-09 11:13 ` Roger Pau Monne
  2017-11-16 22:19   ` Konrad Rzeszutek Wilk
  2017-11-27 14:53   ` Jan Beulich
  2017-11-09 11:13 ` [PATCH v2 for-next 5/9] coverage: introduce generic file Roger Pau Monne
                   ` (4 subsequent siblings)
  8 siblings, 2 replies; 24+ messages in thread
From: Roger Pau Monne @ 2017-11-09 11:13 UTC (permalink / raw)
  To: xen-devel
  Cc: Stefano Stabellini, Wei Liu, Konrad Rzeszutek Wilk,
	George Dunlap, Andrew Cooper, Ian Jackson, Tim Deegan,
	Jan Beulich, Roger Pau Monne

So that other implementations of the sysctl can be added.

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
---
Cc: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: George Dunlap <George.Dunlap@eu.citrix.com>
Cc: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: Jan Beulich <jbeulich@suse.com>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: Stefano Stabellini <sstabellini@kernel.org>
Cc: Tim Deegan <tim@xen.org>
Cc: Wei Liu <wei.liu2@citrix.com>
---
Changes since v1:
 - Constify cov_ops.
 - Introduce a local coverage.h provate header and place the
   definition of cov_sysctl_ops there.
---
 xen/common/coverage/coverage.h | 12 ++++++++++++
 xen/common/coverage/gcov.c     | 13 ++++++++++---
 2 files changed, 22 insertions(+), 3 deletions(-)
 create mode 100644 xen/common/coverage/coverage.h

diff --git a/xen/common/coverage/coverage.h b/xen/common/coverage/coverage.h
new file mode 100644
index 0000000000..4613d5e6c1
--- /dev/null
+++ b/xen/common/coverage/coverage.h
@@ -0,0 +1,12 @@
+#ifndef _XEN_COV_PRIV_H
+#define _XEN_COV_PRIV_H
+
+#include <xen/types.h>
+
+struct cov_sysctl_ops {
+    uint32_t (*get_size)(void);
+    void     (*reset_counters)(void);
+    int      (*dump)(XEN_GUEST_HANDLE_PARAM(char), uint32_t *);
+};
+
+#endif
diff --git a/xen/common/coverage/gcov.c b/xen/common/coverage/gcov.c
index 798032cbbb..8627ef3355 100644
--- a/xen/common/coverage/gcov.c
+++ b/xen/common/coverage/gcov.c
@@ -22,6 +22,7 @@
 
 #include <public/sysctl.h>
 
+#include "coverage.h"
 #include "gcov.h"
 
 /**
@@ -209,6 +210,12 @@ static int gcov_dump_all(XEN_GUEST_HANDLE_PARAM(char) buffer,
     return ret;
 }
 
+static const struct cov_sysctl_ops cov_ops = {
+    .get_size = gcov_get_size,
+    .reset_counters = gcov_reset_all_counters,
+    .dump = gcov_dump_all,
+};
+
 int sysctl_cov_op(struct xen_sysctl_coverage_op *op)
 {
     int ret;
@@ -216,7 +223,7 @@ int sysctl_cov_op(struct xen_sysctl_coverage_op *op)
     switch ( op->cmd )
     {
     case XEN_SYSCTL_COVERAGE_get_size:
-        op->size = gcov_get_size();
+        op->size = cov_ops.get_size();
         ret = 0;
         break;
 
@@ -227,14 +234,14 @@ int sysctl_cov_op(struct xen_sysctl_coverage_op *op)
 
         buf = guest_handle_cast(op->buffer, char);
 
-        ret = gcov_dump_all(buf, &size);
+        ret = cov_ops.dump(buf, &size);
         op->size = size;
 
         break;
     }
 
     case XEN_SYSCTL_COVERAGE_reset:
-        gcov_reset_all_counters();
+        cov_ops.reset_counters();
         ret = 0;
         break;
 
-- 
2.13.6 (Apple Git-96)


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH v2 for-next 5/9] coverage: introduce generic file
  2017-11-09 11:13 [PATCH v2 for-next 0/9] LLVM coverage support for Xen Roger Pau Monne
                   ` (3 preceding siblings ...)
  2017-11-09 11:13 ` [PATCH v2 for-next 4/9] gcov: introduce hooks for the sysctl Roger Pau Monne
@ 2017-11-09 11:13 ` Roger Pau Monne
  2017-11-16 22:23   ` Konrad Rzeszutek Wilk
  2017-11-09 11:13 ` [PATCH v2 for-next 6/9] kconfig/gcov: rename to coverage Roger Pau Monne
                   ` (3 subsequent siblings)
  8 siblings, 1 reply; 24+ messages in thread
From: Roger Pau Monne @ 2017-11-09 11:13 UTC (permalink / raw)
  To: xen-devel
  Cc: Stefano Stabellini, Wei Liu, Konrad Rzeszutek Wilk,
	George Dunlap, Andrew Cooper, Ian Jackson, Tim Deegan,
	Jan Beulich, Roger Pau Monne

It will contain the generic implementation of sysctl_cov_op, which
will be shared between all the coverage implementations.

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
---
Cc: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: George Dunlap <George.Dunlap@eu.citrix.com>
Cc: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: Jan Beulich <jbeulich@suse.com>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: Stefano Stabellini <sstabellini@kernel.org>
Cc: Tim Deegan <tim@xen.org>
Cc: Wei Liu <wei.liu2@citrix.com>
---
Changes since v1:
 - Use private coverage.h header.
 - Sort alphabetically the obj-y list.
---
 xen/common/coverage/Makefile   |  2 +-
 xen/common/coverage/coverage.c | 73 ++++++++++++++++++++++++++++++++++++++++++
 xen/common/coverage/coverage.h |  1 +
 xen/common/coverage/gcov.c     | 39 +---------------------
 4 files changed, 76 insertions(+), 39 deletions(-)
 create mode 100644 xen/common/coverage/coverage.c

diff --git a/xen/common/coverage/Makefile b/xen/common/coverage/Makefile
index a7a48494ca..5387bc6429 100644
--- a/xen/common/coverage/Makefile
+++ b/xen/common/coverage/Makefile
@@ -1,4 +1,4 @@
-obj-y += gcov_base.o gcov.o
+obj-y += coverage.o gcov_base.o gcov.o
 obj-y += $(call cc-ifversion,lt,0x040700, \
 		gcc_3_4.o, $(call cc-ifversion,lt,0x040900, \
 		gcc_4_7.o, $(call cc-ifversion,lt,0x050000, \
diff --git a/xen/common/coverage/coverage.c b/xen/common/coverage/coverage.c
new file mode 100644
index 0000000000..bd90f28663
--- /dev/null
+++ b/xen/common/coverage/coverage.c
@@ -0,0 +1,73 @@
+/*
+ * Generic functionality for coverage analysis.
+ *
+ * Copyright (C) 2017 Citrix Systems R&D
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms and conditions of the GNU General Public
+ * License, version 2, as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program; If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include <xen/errno.h>
+#include <xen/guest_access.h>
+#include <xen/types.h>
+#include <xen/coverage.h>
+
+#include <public/sysctl.h>
+
+#include "coverage.h"
+
+int sysctl_cov_op(struct xen_sysctl_coverage_op *op)
+{
+    int ret;
+
+    switch ( op->cmd )
+    {
+    case XEN_SYSCTL_COVERAGE_get_size:
+        op->size = cov_ops.get_size();
+        ret = 0;
+        break;
+
+    case XEN_SYSCTL_COVERAGE_read:
+    {
+        XEN_GUEST_HANDLE_PARAM(char) buf;
+        uint32_t size = op->size;
+
+        buf = guest_handle_cast(op->buffer, char);
+
+        ret = cov_ops.dump(buf, &size);
+        op->size = size;
+
+        break;
+    }
+
+    case XEN_SYSCTL_COVERAGE_reset:
+        cov_ops.reset_counters();
+        ret = 0;
+        break;
+
+    default:
+        ret = -EOPNOTSUPP;
+        break;
+    }
+
+    return ret;
+}
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/xen/common/coverage/coverage.h b/xen/common/coverage/coverage.h
index 4613d5e6c1..003bb76950 100644
--- a/xen/common/coverage/coverage.h
+++ b/xen/common/coverage/coverage.h
@@ -8,5 +8,6 @@ struct cov_sysctl_ops {
     void     (*reset_counters)(void);
     int      (*dump)(XEN_GUEST_HANDLE_PARAM(char), uint32_t *);
 };
+extern const struct cov_sysctl_ops cov_ops;
 
 #endif
diff --git a/xen/common/coverage/gcov.c b/xen/common/coverage/gcov.c
index 8627ef3355..3cc98728bf 100644
--- a/xen/common/coverage/gcov.c
+++ b/xen/common/coverage/gcov.c
@@ -210,49 +210,12 @@ static int gcov_dump_all(XEN_GUEST_HANDLE_PARAM(char) buffer,
     return ret;
 }
 
-static const struct cov_sysctl_ops cov_ops = {
+const struct cov_sysctl_ops cov_ops = {
     .get_size = gcov_get_size,
     .reset_counters = gcov_reset_all_counters,
     .dump = gcov_dump_all,
 };
 
-int sysctl_cov_op(struct xen_sysctl_coverage_op *op)
-{
-    int ret;
-
-    switch ( op->cmd )
-    {
-    case XEN_SYSCTL_COVERAGE_get_size:
-        op->size = cov_ops.get_size();
-        ret = 0;
-        break;
-
-    case XEN_SYSCTL_COVERAGE_read:
-    {
-        XEN_GUEST_HANDLE_PARAM(char) buf;
-        uint32_t size = op->size;
-
-        buf = guest_handle_cast(op->buffer, char);
-
-        ret = cov_ops.dump(buf, &size);
-        op->size = size;
-
-        break;
-    }
-
-    case XEN_SYSCTL_COVERAGE_reset:
-        cov_ops.reset_counters();
-        ret = 0;
-        break;
-
-    default:
-        ret = -EOPNOTSUPP;
-        break;
-    }
-
-    return ret;
-}
-
 /*
  * Local variables:
  * mode: C
-- 
2.13.6 (Apple Git-96)


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH v2 for-next 6/9] kconfig/gcov: rename to coverage
  2017-11-09 11:13 [PATCH v2 for-next 0/9] LLVM coverage support for Xen Roger Pau Monne
                   ` (4 preceding siblings ...)
  2017-11-09 11:13 ` [PATCH v2 for-next 5/9] coverage: introduce generic file Roger Pau Monne
@ 2017-11-09 11:13 ` Roger Pau Monne
  2017-11-16 22:22   ` Konrad Rzeszutek Wilk
  2017-11-27 15:00   ` Jan Beulich
  2017-11-09 11:13 ` [PATCH v2 for-next 7/9] coverage: introduce support for llvm profiling Roger Pau Monne
                   ` (2 subsequent siblings)
  8 siblings, 2 replies; 24+ messages in thread
From: Roger Pau Monne @ 2017-11-09 11:13 UTC (permalink / raw)
  To: xen-devel
  Cc: Stefano Stabellini, Wei Liu, Konrad Rzeszutek Wilk,
	George Dunlap, Andrew Cooper, Ian Jackson, Tim Deegan,
	Jan Beulich, Roger Pau Monne

So it can be used by both gcc and clang. 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@citrix.com>
---
Cc: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: George Dunlap <George.Dunlap@eu.citrix.com>
Cc: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: Jan Beulich <jbeulich@suse.com>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: Stefano Stabellini <sstabellini@kernel.org>
Cc: Tim Deegan <tim@xen.org>
Cc: Wei Liu <wei.liu2@citrix.com>
---
Changes since v1:
 - Use a choice in kconfig to select code coverage technology.
 - Compile coverage.c regardless of selected code coverage technology.
 - Introduce an unimplemented sysctl_cov_op function if
   CONFIG_COVERAGE is not set.
---
 docs/misc/coverage.markdown  | 2 +-
 xen/Kconfig.debug            | 7 +++----
 xen/Rules.mk                 | 6 +++++-
 xen/common/Makefile          | 2 +-
 xen/common/coverage/Makefile | 5 ++++-
 xen/common/sysctl.c          | 2 --
 xen/include/xen/coverage.h   | 7 ++++++-
 7 files changed, 20 insertions(+), 11 deletions(-)

diff --git a/docs/misc/coverage.markdown b/docs/misc/coverage.markdown
index b47aba2648..430cd27b2f 100644
--- a/docs/misc/coverage.markdown
+++ b/docs/misc/coverage.markdown
@@ -10,7 +10,7 @@ down your hypervisor.
 
 ## Enable coverage
 
-Test coverage support can be turned on compiling Xen with the `CONFIG_GCOV`
+Test coverage support can be turned on compiling Xen with the `CONFIG_COVERAGE`
 option set to `y`.
 
 Change your `.config` or run `make -C xen menuconfig`.
diff --git a/xen/Kconfig.debug b/xen/Kconfig.debug
index 7bb0465b5d..153d68fed3 100644
--- a/xen/Kconfig.debug
+++ b/xen/Kconfig.debug
@@ -28,12 +28,11 @@ config FRAME_POINTER
 	  maybe slower, but it gives very useful debugging information
 	  in case of any Xen bugs.
 
-config GCOV
-	bool "Gcov Support"
+config COVERAGE
+	bool "Code coverage support"
 	depends on !LIVEPATCH
-	select SUPPRESS_DUPLICATE_SYMBOL_WARNINGS
 	---help---
-	  Enable gcov (a test coverage program in GCC) support.
+	  Enable code coverage support.
 
 	  If unsure, say N here.
 
diff --git a/xen/Rules.mk b/xen/Rules.mk
index 2659f8a4d1..d1b72e24ab 100644
--- a/xen/Rules.mk
+++ b/xen/Rules.mk
@@ -115,9 +115,13 @@ subdir-all := $(subdir-y) $(subdir-n)
 
 $(filter %.init.o,$(obj-y) $(obj-bin-y) $(extra-y)): CFLAGS += -DINIT_SECTIONS_ONLY
 
-ifeq ($(CONFIG_GCOV),y)
+ifeq ($(CONFIG_COVERAGE),y)
+ifeq ($(clang),y)
+$(filter-out %.init.o $(nogcov-y),$(obj-y) $(obj-bin-y) $(extra-y)): CFLAGS += -fprofile-instr-generate -fcoverage-mapping
+else
 $(filter-out %.init.o $(nogcov-y),$(obj-y) $(obj-bin-y) $(extra-y)): CFLAGS += -fprofile-arcs -ftest-coverage
 endif
+endif
 
 ifeq ($(CONFIG_UBSAN),y)
 $(filter-out %.init.o $(noubsan-y),$(obj-y) $(obj-bin-y) $(extra-y)): CFLAGS += -fsanitize=undefined
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 5387bc6429..1039a160c4 100644
--- a/xen/common/coverage/Makefile
+++ b/xen/common/coverage/Makefile
@@ -1,6 +1,9 @@
-obj-y += coverage.o gcov_base.o gcov.o
+obj-y += coverage.o
+ifneq ($(clang),y)
+obj-y += gcov_base.o gcov.o
 obj-y += $(call cc-ifversion,lt,0x040700, \
 		gcc_3_4.o, $(call cc-ifversion,lt,0x040900, \
 		gcc_4_7.o, $(call cc-ifversion,lt,0x050000, \
 		gcc_4_9.o, $(call cc-ifversion,lt,0x070000, \
 		gcc_5.o, gcc_7.o))))
+endif
diff --git a/xen/common/sysctl.c b/xen/common/sysctl.c
index f2ae6295ff..8e83c33a16 100644
--- a/xen/common/sysctl.c
+++ b/xen/common/sysctl.c
@@ -396,12 +396,10 @@ long do_sysctl(XEN_GUEST_HANDLE_PARAM(xen_sysctl_t) u_sysctl)
     }
     break;
 
-#ifdef CONFIG_GCOV
     case XEN_SYSCTL_coverage_op:
         ret = sysctl_cov_op(&op->u.coverage_op);
         copyback = 1;
         break;
-#endif
 
 #ifdef CONFIG_HAS_PCI
     case XEN_SYSCTL_pcitopoinfo:
diff --git a/xen/include/xen/coverage.h b/xen/include/xen/coverage.h
index daddef37d3..098f116760 100644
--- a/xen/include/xen/coverage.h
+++ b/xen/include/xen/coverage.h
@@ -1,9 +1,14 @@
 #ifndef _XEN_COV_H
 #define _XEN_COV_H
 
-#ifdef CONFIG_GCOV
+#ifdef CONFIG_COVERAGE
 #include <public/sysctl.h>
 int sysctl_cov_op(struct xen_sysctl_coverage_op *op);
+#else
+static inline int sysctl_cov_op(void *unused)
+{
+    return -ENOSYS;
+}
 #endif
 
 #endif	/* _XEN_GCOV_H */
-- 
2.13.6 (Apple Git-96)


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH v2 for-next 7/9] coverage: introduce support for llvm profiling
  2017-11-09 11:13 [PATCH v2 for-next 0/9] LLVM coverage support for Xen Roger Pau Monne
                   ` (5 preceding siblings ...)
  2017-11-09 11:13 ` [PATCH v2 for-next 6/9] kconfig/gcov: rename to coverage Roger Pau Monne
@ 2017-11-09 11:13 ` Roger Pau Monne
  2017-11-27 15:01   ` Jan Beulich
  2017-11-09 11:13 ` [PATCH v2 for-next 8/9] xsm: add bodge when compiling with llvm coverage support Roger Pau Monne
  2017-11-09 11:13 ` [PATCH v2 for-next 9/9] coverage: add documentation for LLVM coverage Roger Pau Monne
  8 siblings, 1 reply; 24+ messages in thread
From: Roger Pau Monne @ 2017-11-09 11:13 UTC (permalink / raw)
  To: xen-devel
  Cc: Stefano Stabellini, Wei Liu, Konrad Rzeszutek Wilk,
	George Dunlap, Andrew Cooper, Ian Jackson, Tim Deegan,
	Jan Beulich, Roger Pau Monne

Introduce the functionality in order to fill the hooks of the
cov_sysctl_ops struct. Note that the functionality is still not wired
into the build system.

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
---
Cc: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: George Dunlap <George.Dunlap@eu.citrix.com>
Cc: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: Jan Beulich <jbeulich@suse.com>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: Stefano Stabellini <sstabellini@kernel.org>
Cc: Tim Deegan <tim@xen.org>
Cc: Wei Liu <wei.liu2@citrix.com>
---
Note that the file that contains the helpers is under a BSD 2-clause
license. This is done so it can be shared with other OSes that use the
llvm/clang compiler.
---
Changes since v1:
 - Include private coverage.h header.
 - Define LLVM_PROFILE_MAGIC based on the bitness of the arch.
 - Add a comment regarding __llvm_profile_runtime.
 - Constify data/names extern symbols.
 - Use defines instead of variables to store the addresses of the
   external symbols.
 - Parenthesize size in APPEND_TO_BUFFER.
 - Use >= for minor version check.
 - Use sizeof(header).
---
 xen/common/coverage/Makefile |   2 +
 xen/common/coverage/llvm.c   | 154 +++++++++++++++++++++++++++++++++++++++++++
 xen/include/public/sysctl.h  |   6 ++
 3 files changed, 162 insertions(+)
 create mode 100644 xen/common/coverage/llvm.c

diff --git a/xen/common/coverage/Makefile b/xen/common/coverage/Makefile
index 1039a160c4..46c78d1086 100644
--- a/xen/common/coverage/Makefile
+++ b/xen/common/coverage/Makefile
@@ -6,4 +6,6 @@ obj-y += $(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 += llvm.o
 endif
diff --git a/xen/common/coverage/llvm.c b/xen/common/coverage/llvm.c
new file mode 100644
index 0000000000..889699a9a0
--- /dev/null
+++ b/xen/common/coverage/llvm.c
@@ -0,0 +1,154 @@
+/*
+ * Copyright (C) 2017 Citrix Systems R&D
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+#include <xen/errno.h>
+#include <xen/guest_access.h>
+#include <xen/types.h>
+
+#include "coverage.h"
+
+#ifndef __clang__
+#error "LLVM coverage selected without clang compiler"
+#endif
+
+#if BITS_PER_LONG == 64
+#define LLVM_PROFILE_MAGIC (((uint64_t)255 << 56) | ((uint64_t)'l' << 48) | \
+    ((uint64_t)'p' << 40) | ((uint64_t)'r' << 32) | ((uint64_t)'o' << 24) | \
+    ((uint64_t)'f' << 16) | ((uint64_t)'r' << 8)  | ((uint64_t)129))
+#else
+#define LLVM_PROFILE_MAGIC (((uint64_t)255 << 56) | ((uint64_t)'l' << 48) | \
+    ((uint64_t)'p' << 40) | ((uint64_t)'r' << 32) | ((uint64_t)'o' << 24) | \
+    ((uint64_t)'f' << 16) | ((uint64_t)'R' << 8)  | ((uint64_t)129)
+#endif
+
+#if __clang_major__ >= 4 || (__clang_major__ == 3 && __clang_minor__ >= 9)
+#define LLVM_PROFILE_VERSION    4
+#define LLVM_PROFILE_NUM_KINDS  2
+#else
+#error "clang version not supported with coverage"
+#endif
+
+struct llvm_profile_data {
+    uint64_t name_ref;
+    uint64_t function_hash;
+    void *counter;
+    void *function;
+    void *values;
+    uint32_t nr_counters;
+    uint16_t nr_value_sites[LLVM_PROFILE_NUM_KINDS];
+};
+
+struct llvm_profile_header {
+    uint64_t magic;
+    uint64_t version;
+    uint64_t data_size;
+    uint64_t counters_size;
+    uint64_t names_size;
+    uint64_t counters_delta;
+    uint64_t names_delta;
+    uint64_t value_kind_last;
+};
+
+/*
+ * Since Xen uses the llvm code coverage support without the run time library
+ * __llvm_profile_runtime must be defined according to the docs at:
+ *
+ * https://clang.llvm.org/docs/SourceBasedCodeCoverage.html
+ */
+int __llvm_profile_runtime;
+
+extern const struct llvm_profile_data __start___llvm_prf_data[];
+extern const struct llvm_profile_data __stop___llvm_prf_data[];
+extern const char __start___llvm_prf_names[];
+extern const char __stop___llvm_prf_names[];
+extern uint64_t __start___llvm_prf_cnts[];
+extern uint64_t __stop___llvm_prf_cnts[];
+
+#define START_DATA      ((const void *)__start___llvm_prf_data)
+#define END_DATA        ((const void *)__stop___llvm_prf_data)
+#define START_NAMES     ((const void *)__start___llvm_prf_names)
+#define END_NAMES       ((const void *)__stop___llvm_prf_names)
+#define START_COUNTERS  ((void *)__start___llvm_prf_cnts)
+#define END_COUNTERS    ((void *)__stop___llvm_prf_cnts)
+
+static void reset_counters(void)
+{
+    memset(START_COUNTERS, 0, END_COUNTERS - START_COUNTERS);
+}
+
+static uint32_t get_size(void)
+{
+    return ROUNDUP(sizeof(struct llvm_profile_header) + END_DATA - START_DATA +
+                   END_COUNTERS - START_COUNTERS + END_NAMES - START_NAMES, 8);
+}
+
+static int dump(XEN_GUEST_HANDLE_PARAM(char) buffer, uint32_t *buf_size)
+{
+    struct llvm_profile_header header = {
+        .magic = LLVM_PROFILE_MAGIC,
+        .version = LLVM_PROFILE_VERSION,
+        .data_size = (END_DATA - START_DATA) / sizeof(struct llvm_profile_data),
+        .counters_size = (END_COUNTERS - START_COUNTERS) / sizeof(uint64_t),
+        .names_size = END_NAMES - START_NAMES,
+        .counters_delta = (uintptr_t)START_COUNTERS,
+        .names_delta = (uintptr_t)START_NAMES,
+        .value_kind_last = LLVM_PROFILE_NUM_KINDS - 1,
+    };
+    unsigned int off = 0;
+
+#define APPEND_TO_BUFFER(src, size)                             \
+({                                                              \
+    if ( off + (size) > *buf_size )                             \
+        return -ENOMEM;                                         \
+    copy_to_guest_offset(buffer, off, (const char *)src, size); \
+    off += (size);                                              \
+})
+    APPEND_TO_BUFFER(&header, sizeof(header));
+    APPEND_TO_BUFFER(START_DATA, END_DATA - START_DATA);
+    APPEND_TO_BUFFER(START_COUNTERS, END_COUNTERS - START_COUNTERS);
+    APPEND_TO_BUFFER(START_NAMES, END_NAMES - START_NAMES);
+#undef APPEND_TO_BUFFER
+
+    clear_guest_offset(buffer, off, *buf_size - off);
+
+    return 0;
+}
+
+const struct cov_sysctl_ops cov_ops = {
+    .get_size = get_size,
+    .reset_counters = reset_counters,
+    .dump = dump,
+};
+
+/*
+ * Local variables:
+ * mode: C
+ * c-file-style: "BSD"
+ * c-basic-offset: 4
+ * tab-width: 4
+ * indent-tabs-mode: nil
+ * End:
+ */
diff --git a/xen/include/public/sysctl.h b/xen/include/public/sysctl.h
index 3566f2eb69..8db22ac803 100644
--- a/xen/include/public/sysctl.h
+++ b/xen/include/public/sysctl.h
@@ -646,6 +646,12 @@ struct xen_sysctl_scheduler_op {
 
 #define XEN_GCOV_FORMAT_MAGIC    0x58434f56 /* XCOV */
 
+/*
+ * Ouput format of LLVM coverage data is just a raw stream, as would be
+ * written by the compiler_rt run time library into a .profraw file. There
+ * are no special Xen tags or delimiters because none are needed.
+ */
+
 #define XEN_SYSCTL_COVERAGE_get_size 0 /* Get total size of output data */
 #define XEN_SYSCTL_COVERAGE_read     1 /* Read output data */
 #define XEN_SYSCTL_COVERAGE_reset    2 /* Reset all counters */
-- 
2.13.6 (Apple Git-96)


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH v2 for-next 8/9] xsm: add bodge when compiling with llvm coverage support
  2017-11-09 11:13 [PATCH v2 for-next 0/9] LLVM coverage support for Xen Roger Pau Monne
                   ` (6 preceding siblings ...)
  2017-11-09 11:13 ` [PATCH v2 for-next 7/9] coverage: introduce support for llvm profiling Roger Pau Monne
@ 2017-11-09 11:13 ` Roger Pau Monne
  2017-11-09 11:13 ` [PATCH v2 for-next 9/9] coverage: add documentation for LLVM coverage Roger Pau Monne
  8 siblings, 0 replies; 24+ messages in thread
From: Roger Pau Monne @ 2017-11-09 11:13 UTC (permalink / raw)
  To: xen-devel; +Cc: Daniel De Graaf, Roger Pau Monne

llvm coverage support seems to disable some of the optimizations
needed in order to compile xsm, and the end result is that references
to __xsm_action_mismatch_detected are left in the object files.

Since coverage support cannot be used in production, introduce
__xsm_action_mismatch_detected for llvm coverage builds.

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
---
Cc: Daniel De Graaf <dgdegra@tycho.nsa.gov>
---
Changes since v1:
 - Add inline.
 - Use CONIFG_COVERAGE and __clang__ to detect if the bodge is needed.
---
 xen/include/xsm/dummy.h | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/xen/include/xsm/dummy.h b/xen/include/xsm/dummy.h
index b2cd56cdc5..2c39ae2e6b 100644
--- a/xen/include/xsm/dummy.h
+++ b/xen/include/xsm/dummy.h
@@ -24,8 +24,22 @@
  * if references remain at link time.
  */
 #define LINKER_BUG_ON(x) do { if (x) __xsm_action_mismatch_detected(); } while (0)
+
+#if defined(CONFIG_COVERAGE) && defined(__clang__)
+/*
+ * LLVM coverage support seems to disable some of the optimizations needed in
+ * order for XSM to compile. Since coverage should not be used in production
+ * provide an implementation of __xsm_action_mismatch_detected to satisfy the
+ * linker.
+ */
+static inline void __xsm_action_mismatch_detected(void)
+{
+    ASSERT_UNREACHABLE();
+}
+#else
 /* DO NOT implement this function; it is supposed to trigger link errors */
 void __xsm_action_mismatch_detected(void);
+#endif
 
 #ifdef CONFIG_XSM
 
-- 
2.13.6 (Apple Git-96)


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply related	[flat|nested] 24+ messages in thread

* [PATCH v2 for-next 9/9] coverage: add documentation for LLVM coverage
  2017-11-09 11:13 [PATCH v2 for-next 0/9] LLVM coverage support for Xen Roger Pau Monne
                   ` (7 preceding siblings ...)
  2017-11-09 11:13 ` [PATCH v2 for-next 8/9] xsm: add bodge when compiling with llvm coverage support Roger Pau Monne
@ 2017-11-09 11:13 ` Roger Pau Monne
  8 siblings, 0 replies; 24+ messages in thread
From: Roger Pau Monne @ 2017-11-09 11:13 UTC (permalink / raw)
  To: xen-devel
  Cc: Stefano Stabellini, Wei Liu, Konrad Rzeszutek Wilk,
	George Dunlap, Andrew Cooper, Ian Jackson, Tim Deegan,
	Jan Beulich, Roger Pau Monne

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
---
Cc: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: George Dunlap <George.Dunlap@eu.citrix.com>
Cc: Ian Jackson <ian.jackson@eu.citrix.com>
Cc: Jan Beulich <jbeulich@suse.com>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: Stefano Stabellini <sstabellini@kernel.org>
Cc: Tim Deegan <tim@xen.org>
Cc: Wei Liu <wei.liu2@citrix.com>
---
Changes since v1:
 - s/gmake/make/.
 - Fix gcov section to mention CONFIG_COVERAGE instead of CONFIG_GCOV.
---
 docs/misc/coverage.markdown | 47 +++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 47 insertions(+)

diff --git a/docs/misc/coverage.markdown b/docs/misc/coverage.markdown
index 430cd27b2f..3554659fe4 100644
--- a/docs/misc/coverage.markdown
+++ b/docs/misc/coverage.markdown
@@ -8,6 +8,8 @@ information. Every basic block in the code will be instrumented by the compiler
 to compute these statistics. It should not be used in production as it slows
 down your hypervisor.
 
+# GCOV (GCC coverage)
+
 ## Enable coverage
 
 Test coverage support can be turned on compiling Xen with the `CONFIG_COVERAGE`
@@ -75,3 +77,48 @@ blob extracted from xencov!**
 * See output in a browser
 
         firefox cov/index.html
+
+# LLVM coverage
+
+## Enable coverage
+
+Coverage can be enabled using a Kconfig option, from the top-level directory
+use the following command to display the Kconfig menu:
+
+    make -C xen menuconfig clang=y
+
+The code coverage option can be found inside of the "Debugging Options"
+section. After enabling it just compile Xen as you would normally do:
+
+    make xen clang=y
+
+## Extract coverage data
+
+LLVM coverage can be extracted from the hypervisor using the `xencov` tool.
+The following actions are available:
+
+* `xencov read` extract data
+* `xencov reset` reset all coverage counters
+* `xencov read-reset` extract data and reset counters at the same time.
+
+## Possible use
+
+**This section is just an example on how to use these tools!**
+
+This example assumes you compiled Xen and copied the xen-syms file from
+xen/xen-syms into your current directory.
+
+* Extract the coverage data from Xen:
+
+    xencov read xen.profraw
+
+* Convert the data into a profile. Note that you can merge more than one
+  profraw file into a single profdata file.
+
+    llvm-profdata merge xen.profraw -o xen.profdata
+
+* Generate a HTML report of the code coverage:
+
+    llvm-cov show -format=html -output-dir=cov/ xen-syms -instr-profile=xen.profdata
+
+* Open cov/index.html with your browser in order to display the profile.
-- 
2.13.6 (Apple Git-96)


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply related	[flat|nested] 24+ messages in thread

* Re: [PATCH v2 for-next 4/9] gcov: introduce hooks for the sysctl
  2017-11-09 11:13 ` [PATCH v2 for-next 4/9] gcov: introduce hooks for the sysctl Roger Pau Monne
@ 2017-11-16 22:19   ` Konrad Rzeszutek Wilk
  2017-11-27 14:53   ` Jan Beulich
  1 sibling, 0 replies; 24+ messages in thread
From: Konrad Rzeszutek Wilk @ 2017-11-16 22:19 UTC (permalink / raw)
  To: Roger Pau Monne
  Cc: Stefano Stabellini, Wei Liu, George Dunlap, Andrew Cooper,
	Ian Jackson, Tim Deegan, Jan Beulich, xen-devel

On Thu, Nov 09, 2017 at 11:13:44AM +0000, Roger Pau Monne wrote:
> So that other implementations of the sysctl can be added.
> 
> Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
> ---
> Cc: Andrew Cooper <andrew.cooper3@citrix.com>
> Cc: George Dunlap <George.Dunlap@eu.citrix.com>
> Cc: Ian Jackson <ian.jackson@eu.citrix.com>
> Cc: Jan Beulich <jbeulich@suse.com>
> Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
> Cc: Stefano Stabellini <sstabellini@kernel.org>
> Cc: Tim Deegan <tim@xen.org>
> Cc: Wei Liu <wei.liu2@citrix.com>
> ---
> Changes since v1:
>  - Constify cov_ops.
>  - Introduce a local coverage.h provate header and place the
>    definition of cov_sysctl_ops there.
> ---
>  xen/common/coverage/coverage.h | 12 ++++++++++++
>  xen/common/coverage/gcov.c     | 13 ++++++++++---
>  2 files changed, 22 insertions(+), 3 deletions(-)
>  create mode 100644 xen/common/coverage/coverage.h
> 
> diff --git a/xen/common/coverage/coverage.h b/xen/common/coverage/coverage.h
> new file mode 100644
> index 0000000000..4613d5e6c1
> --- /dev/null
> +++ b/xen/common/coverage/coverage.h
> @@ -0,0 +1,12 @@
> +#ifndef _XEN_COV_PRIV_H
> +#define _XEN_COV_PRIV_H
> +
> +#include <xen/types.h>
> +
> +struct cov_sysctl_ops {
> +    uint32_t (*get_size)(void);
> +    void     (*reset_counters)(void);
> +    int      (*dump)(XEN_GUEST_HANDLE_PARAM(char), uint32_t *);
> +};
> +
> +#endif

Perhaps add the editor configuration block?

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH v2 for-next 6/9] kconfig/gcov: rename to coverage
  2017-11-09 11:13 ` [PATCH v2 for-next 6/9] kconfig/gcov: rename to coverage Roger Pau Monne
@ 2017-11-16 22:22   ` Konrad Rzeszutek Wilk
  2017-11-27 11:27     ` Roger Pau Monné
  2017-11-27 15:00   ` Jan Beulich
  1 sibling, 1 reply; 24+ messages in thread
From: Konrad Rzeszutek Wilk @ 2017-11-16 22:22 UTC (permalink / raw)
  To: Roger Pau Monne
  Cc: Stefano Stabellini, Wei Liu, George Dunlap, Andrew Cooper,
	Ian Jackson, Tim Deegan, Jan Beulich, xen-devel

On Thu, Nov 09, 2017 at 11:13:46AM +0000, Roger Pau Monne wrote:
> So it can be used by both gcc and clang. 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@citrix.com>
> ---
> Cc: Andrew Cooper <andrew.cooper3@citrix.com>
> Cc: George Dunlap <George.Dunlap@eu.citrix.com>
> Cc: Ian Jackson <ian.jackson@eu.citrix.com>
> Cc: Jan Beulich <jbeulich@suse.com>
> Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
> Cc: Stefano Stabellini <sstabellini@kernel.org>
> Cc: Tim Deegan <tim@xen.org>
> Cc: Wei Liu <wei.liu2@citrix.com>
> ---
> Changes since v1:
>  - Use a choice in kconfig to select code coverage technology.
>  - Compile coverage.c regardless of selected code coverage technology.
>  - Introduce an unimplemented sysctl_cov_op function if
>    CONFIG_COVERAGE is not set.
> ---
>  docs/misc/coverage.markdown  | 2 +-
>  xen/Kconfig.debug            | 7 +++----
>  xen/Rules.mk                 | 6 +++++-
>  xen/common/Makefile          | 2 +-
>  xen/common/coverage/Makefile | 5 ++++-
>  xen/common/sysctl.c          | 2 --
>  xen/include/xen/coverage.h   | 7 ++++++-
>  7 files changed, 20 insertions(+), 11 deletions(-)
> 
> diff --git a/docs/misc/coverage.markdown b/docs/misc/coverage.markdown
> index b47aba2648..430cd27b2f 100644
> --- a/docs/misc/coverage.markdown
> +++ b/docs/misc/coverage.markdown
> @@ -10,7 +10,7 @@ down your hypervisor.
>  
>  ## Enable coverage
>  
> -Test coverage support can be turned on compiling Xen with the `CONFIG_GCOV`
> +Test coverage support can be turned on compiling Xen with the `CONFIG_COVERAGE`
>  option set to `y`.
>  
>  Change your `.config` or run `make -C xen menuconfig`.
> diff --git a/xen/Kconfig.debug b/xen/Kconfig.debug
> index 7bb0465b5d..153d68fed3 100644
> --- a/xen/Kconfig.debug
> +++ b/xen/Kconfig.debug
> @@ -28,12 +28,11 @@ config FRAME_POINTER
>  	  maybe slower, but it gives very useful debugging information
>  	  in case of any Xen bugs.
>  
> -config GCOV
> -	bool "Gcov Support"
> +config COVERAGE
> +	bool "Code coverage support"
>  	depends on !LIVEPATCH
> -	select SUPPRESS_DUPLICATE_SYMBOL_WARNINGS

Any particular reason this was removed?

Or is the idea that the coverage technology should have this select?

>  	---help---
> -	  Enable gcov (a test coverage program in GCC) support.
> +	  Enable code coverage support.
>  
>  	  If unsure, say N here.
>  
> diff --git a/xen/Rules.mk b/xen/Rules.mk
> index 2659f8a4d1..d1b72e24ab 100644
> --- a/xen/Rules.mk
> +++ b/xen/Rules.mk
> @@ -115,9 +115,13 @@ subdir-all := $(subdir-y) $(subdir-n)
>  
>  $(filter %.init.o,$(obj-y) $(obj-bin-y) $(extra-y)): CFLAGS += -DINIT_SECTIONS_ONLY
>  
> -ifeq ($(CONFIG_GCOV),y)
> +ifeq ($(CONFIG_COVERAGE),y)
> +ifeq ($(clang),y)
> +$(filter-out %.init.o $(nogcov-y),$(obj-y) $(obj-bin-y) $(extra-y)): CFLAGS += -fprofile-instr-generate -fcoverage-mapping
> +else
>  $(filter-out %.init.o $(nogcov-y),$(obj-y) $(obj-bin-y) $(extra-y)): CFLAGS += -fprofile-arcs -ftest-coverage
>  endif
> +endif
>  
>  ifeq ($(CONFIG_UBSAN),y)
>  $(filter-out %.init.o $(noubsan-y),$(obj-y) $(obj-bin-y) $(extra-y)): CFLAGS += -fsanitize=undefined
> 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 5387bc6429..1039a160c4 100644
> --- a/xen/common/coverage/Makefile
> +++ b/xen/common/coverage/Makefile
> @@ -1,6 +1,9 @@
> -obj-y += coverage.o gcov_base.o gcov.o
> +obj-y += coverage.o
> +ifneq ($(clang),y)
> +obj-y += gcov_base.o gcov.o
>  obj-y += $(call cc-ifversion,lt,0x040700, \
>  		gcc_3_4.o, $(call cc-ifversion,lt,0x040900, \
>  		gcc_4_7.o, $(call cc-ifversion,lt,0x050000, \
>  		gcc_4_9.o, $(call cc-ifversion,lt,0x070000, \
>  		gcc_5.o, gcc_7.o))))
> +endif
> diff --git a/xen/common/sysctl.c b/xen/common/sysctl.c
> index f2ae6295ff..8e83c33a16 100644
> --- a/xen/common/sysctl.c
> +++ b/xen/common/sysctl.c
> @@ -396,12 +396,10 @@ long do_sysctl(XEN_GUEST_HANDLE_PARAM(xen_sysctl_t) u_sysctl)
>      }
>      break;
>  
> -#ifdef CONFIG_GCOV
>      case XEN_SYSCTL_coverage_op:
>          ret = sysctl_cov_op(&op->u.coverage_op);
>          copyback = 1;
>          break;
> -#endif
>  
>  #ifdef CONFIG_HAS_PCI
>      case XEN_SYSCTL_pcitopoinfo:
> diff --git a/xen/include/xen/coverage.h b/xen/include/xen/coverage.h
> index daddef37d3..098f116760 100644
> --- a/xen/include/xen/coverage.h
> +++ b/xen/include/xen/coverage.h
> @@ -1,9 +1,14 @@
>  #ifndef _XEN_COV_H
>  #define _XEN_COV_H
>  
> -#ifdef CONFIG_GCOV
> +#ifdef CONFIG_COVERAGE
>  #include <public/sysctl.h>
>  int sysctl_cov_op(struct xen_sysctl_coverage_op *op);
> +#else
> +static inline int sysctl_cov_op(void *unused)
> +{
> +    return -ENOSYS;

Not -EOPNOTSUPP ?

> +}
>  #endif
>  
>  #endif	/* _XEN_GCOV_H */
> -- 
> 2.13.6 (Apple Git-96)
> 

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH v2 for-next 5/9] coverage: introduce generic file
  2017-11-09 11:13 ` [PATCH v2 for-next 5/9] coverage: introduce generic file Roger Pau Monne
@ 2017-11-16 22:23   ` Konrad Rzeszutek Wilk
  0 siblings, 0 replies; 24+ messages in thread
From: Konrad Rzeszutek Wilk @ 2017-11-16 22:23 UTC (permalink / raw)
  To: Roger Pau Monne
  Cc: Stefano Stabellini, Wei Liu, George Dunlap, Andrew Cooper,
	Ian Jackson, Tim Deegan, Jan Beulich, xen-devel

On Thu, Nov 09, 2017 at 11:13:45AM +0000, Roger Pau Monne wrote:
> It will contain the generic implementation of sysctl_cov_op, which
> will be shared between all the coverage implementations.
> 
> Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
> ---
> Cc: Andrew Cooper <andrew.cooper3@citrix.com>
> Cc: George Dunlap <George.Dunlap@eu.citrix.com>
> Cc: Ian Jackson <ian.jackson@eu.citrix.com>
> Cc: Jan Beulich <jbeulich@suse.com>
> Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>

Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>

> Cc: Stefano Stabellini <sstabellini@kernel.org>
> Cc: Tim Deegan <tim@xen.org>
> Cc: Wei Liu <wei.liu2@citrix.com>
> ---
> Changes since v1:
>  - Use private coverage.h header.
>  - Sort alphabetically the obj-y list.
> ---
>  xen/common/coverage/Makefile   |  2 +-
>  xen/common/coverage/coverage.c | 73 ++++++++++++++++++++++++++++++++++++++++++
>  xen/common/coverage/coverage.h |  1 +
>  xen/common/coverage/gcov.c     | 39 +---------------------
>  4 files changed, 76 insertions(+), 39 deletions(-)
>  create mode 100644 xen/common/coverage/coverage.c
> 
> diff --git a/xen/common/coverage/Makefile b/xen/common/coverage/Makefile
> index a7a48494ca..5387bc6429 100644
> --- a/xen/common/coverage/Makefile
> +++ b/xen/common/coverage/Makefile
> @@ -1,4 +1,4 @@
> -obj-y += gcov_base.o gcov.o
> +obj-y += coverage.o gcov_base.o gcov.o
>  obj-y += $(call cc-ifversion,lt,0x040700, \
>  		gcc_3_4.o, $(call cc-ifversion,lt,0x040900, \
>  		gcc_4_7.o, $(call cc-ifversion,lt,0x050000, \
> diff --git a/xen/common/coverage/coverage.c b/xen/common/coverage/coverage.c
> new file mode 100644
> index 0000000000..bd90f28663
> --- /dev/null
> +++ b/xen/common/coverage/coverage.c
> @@ -0,0 +1,73 @@
> +/*
> + * Generic functionality for coverage analysis.
> + *
> + * Copyright (C) 2017 Citrix Systems R&D
> + *
> + * This program is free software; you can redistribute it and/or
> + * modify it under the terms and conditions of the GNU General Public
> + * License, version 2, as published by the Free Software Foundation.
> + *
> + * This program is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> + * General Public License for more details.
> + *
> + * You should have received a copy of the GNU General Public
> + * License along with this program; If not, see <http://www.gnu.org/licenses/>.
> + */
> +
> +#include <xen/errno.h>
> +#include <xen/guest_access.h>
> +#include <xen/types.h>
> +#include <xen/coverage.h>
> +
> +#include <public/sysctl.h>
> +
> +#include "coverage.h"
> +
> +int sysctl_cov_op(struct xen_sysctl_coverage_op *op)
> +{
> +    int ret;
> +
> +    switch ( op->cmd )
> +    {
> +    case XEN_SYSCTL_COVERAGE_get_size:
> +        op->size = cov_ops.get_size();
> +        ret = 0;
> +        break;
> +
> +    case XEN_SYSCTL_COVERAGE_read:
> +    {
> +        XEN_GUEST_HANDLE_PARAM(char) buf;
> +        uint32_t size = op->size;
> +
> +        buf = guest_handle_cast(op->buffer, char);
> +
> +        ret = cov_ops.dump(buf, &size);
> +        op->size = size;
> +
> +        break;
> +    }
> +
> +    case XEN_SYSCTL_COVERAGE_reset:
> +        cov_ops.reset_counters();
> +        ret = 0;
> +        break;
> +
> +    default:
> +        ret = -EOPNOTSUPP;
> +        break;
> +    }
> +
> +    return ret;
> +}
> +
> +/*
> + * Local variables:
> + * mode: C
> + * c-file-style: "BSD"
> + * c-basic-offset: 4
> + * tab-width: 4
> + * indent-tabs-mode: nil
> + * End:
> + */
> diff --git a/xen/common/coverage/coverage.h b/xen/common/coverage/coverage.h
> index 4613d5e6c1..003bb76950 100644
> --- a/xen/common/coverage/coverage.h
> +++ b/xen/common/coverage/coverage.h
> @@ -8,5 +8,6 @@ struct cov_sysctl_ops {
>      void     (*reset_counters)(void);
>      int      (*dump)(XEN_GUEST_HANDLE_PARAM(char), uint32_t *);
>  };
> +extern const struct cov_sysctl_ops cov_ops;
>  
>  #endif
> diff --git a/xen/common/coverage/gcov.c b/xen/common/coverage/gcov.c
> index 8627ef3355..3cc98728bf 100644
> --- a/xen/common/coverage/gcov.c
> +++ b/xen/common/coverage/gcov.c
> @@ -210,49 +210,12 @@ static int gcov_dump_all(XEN_GUEST_HANDLE_PARAM(char) buffer,
>      return ret;
>  }
>  
> -static const struct cov_sysctl_ops cov_ops = {
> +const struct cov_sysctl_ops cov_ops = {
>      .get_size = gcov_get_size,
>      .reset_counters = gcov_reset_all_counters,
>      .dump = gcov_dump_all,
>  };
>  
> -int sysctl_cov_op(struct xen_sysctl_coverage_op *op)
> -{
> -    int ret;
> -
> -    switch ( op->cmd )
> -    {
> -    case XEN_SYSCTL_COVERAGE_get_size:
> -        op->size = cov_ops.get_size();
> -        ret = 0;
> -        break;
> -
> -    case XEN_SYSCTL_COVERAGE_read:
> -    {
> -        XEN_GUEST_HANDLE_PARAM(char) buf;
> -        uint32_t size = op->size;
> -
> -        buf = guest_handle_cast(op->buffer, char);
> -
> -        ret = cov_ops.dump(buf, &size);
> -        op->size = size;
> -
> -        break;
> -    }
> -
> -    case XEN_SYSCTL_COVERAGE_reset:
> -        cov_ops.reset_counters();
> -        ret = 0;
> -        break;
> -
> -    default:
> -        ret = -EOPNOTSUPP;
> -        break;
> -    }
> -
> -    return ret;
> -}
> -
>  /*
>   * Local variables:
>   * mode: C
> -- 
> 2.13.6 (Apple Git-96)
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> https://lists.xen.org/xen-devel

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH v2 for-next 3/9] gcov: rename sysctl and functions
  2017-11-09 11:13 ` [PATCH v2 for-next 3/9] gcov: rename sysctl and functions Roger Pau Monne
@ 2017-11-16 22:24   ` Konrad Rzeszutek Wilk
  2018-01-23  9:37   ` Jan Beulich
  1 sibling, 0 replies; 24+ messages in thread
From: Konrad Rzeszutek Wilk @ 2017-11-16 22:24 UTC (permalink / raw)
  To: Roger Pau Monne
  Cc: Stefano Stabellini, Wei Liu, George Dunlap, Andrew Cooper,
	Ian Jackson, Tim Deegan, Jan Beulich, xen-devel

On Thu, Nov 09, 2017 at 11:13:43AM +0000, Roger Pau Monne wrote:
> Change gcov to cov (for internal interfaces) or coverage (for the
> public ones).
> 
> Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
> ---
> Cc: Ian Jackson <ian.jackson@eu.citrix.com>
> Cc: Wei Liu <wei.liu2@citrix.com>
> Cc: Andrew Cooper <andrew.cooper3@citrix.com>
> Cc: George Dunlap <George.Dunlap@eu.citrix.com>
> Cc: Jan Beulich <jbeulich@suse.com>
> Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>

Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH v2 for-next 2/9] gcov: rename folder and header to coverage
  2017-11-09 11:13 ` [PATCH v2 for-next 2/9] gcov: rename folder and header to coverage Roger Pau Monne
@ 2017-11-16 22:24   ` Konrad Rzeszutek Wilk
  0 siblings, 0 replies; 24+ messages in thread
From: Konrad Rzeszutek Wilk @ 2017-11-16 22:24 UTC (permalink / raw)
  To: Roger Pau Monne
  Cc: Stefano Stabellini, Wei Liu, George Dunlap, Andrew Cooper,
	Ian Jackson, Tim Deegan, Jan Beulich, xen-devel

On Thu, Nov 09, 2017 at 11:13:42AM +0000, Roger Pau Monne wrote:
> Preparatory change before adding llvm profiling support.
> No functional change.
> 
> Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
> ---
> Cc: Andrew Cooper <andrew.cooper3@citrix.com>
> Cc: George Dunlap <George.Dunlap@eu.citrix.com>
> Cc: Ian Jackson <ian.jackson@eu.citrix.com>
> Cc: Jan Beulich <jbeulich@suse.com>
> Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>

Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH v2 for-next 6/9] kconfig/gcov: rename to coverage
  2017-11-16 22:22   ` Konrad Rzeszutek Wilk
@ 2017-11-27 11:27     ` Roger Pau Monné
  2017-11-27 11:42       ` Jan Beulich
  0 siblings, 1 reply; 24+ messages in thread
From: Roger Pau Monné @ 2017-11-27 11:27 UTC (permalink / raw)
  To: Konrad Rzeszutek Wilk
  Cc: Stefano Stabellini, Wei Liu, George Dunlap, Andrew Cooper,
	Ian Jackson, Tim Deegan, Jan Beulich, xen-devel

On Thu, Nov 16, 2017 at 05:22:43PM -0500, Konrad Rzeszutek Wilk wrote:
> On Thu, Nov 09, 2017 at 11:13:46AM +0000, Roger Pau Monne wrote:
> > diff --git a/xen/Kconfig.debug b/xen/Kconfig.debug
> > index 7bb0465b5d..153d68fed3 100644
> > --- a/xen/Kconfig.debug
> > +++ b/xen/Kconfig.debug
> > @@ -28,12 +28,11 @@ config FRAME_POINTER
> >  	  maybe slower, but it gives very useful debugging information
> >  	  in case of any Xen bugs.
> >  
> > -config GCOV
> > -	bool "Gcov Support"
> > +config COVERAGE
> > +	bool "Code coverage support"
> >  	depends on !LIVEPATCH
> > -	select SUPPRESS_DUPLICATE_SYMBOL_WARNINGS
> 
> Any particular reason this was removed?
> 
> Or is the idea that the coverage technology should have this select?

That's my fault, I will add the select back.

> > diff --git a/xen/include/xen/coverage.h b/xen/include/xen/coverage.h
> > index daddef37d3..098f116760 100644
> > --- a/xen/include/xen/coverage.h
> > +++ b/xen/include/xen/coverage.h
> > @@ -1,9 +1,14 @@
> >  #ifndef _XEN_COV_H
> >  #define _XEN_COV_H
> >  
> > -#ifdef CONFIG_GCOV
> > +#ifdef CONFIG_COVERAGE
> >  #include <public/sysctl.h>
> >  int sysctl_cov_op(struct xen_sysctl_coverage_op *op);
> > +#else
> > +static inline int sysctl_cov_op(void *unused)
> > +{
> > +    return -ENOSYS;
> 
> Not -EOPNOTSUPP ?

IIRC for non implemented top-level hypercalls Xen returns ENOSYS
instead of EOPNOTSUPP, but I might be wrong.

Thanks, Roger.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH v2 for-next 6/9] kconfig/gcov: rename to coverage
  2017-11-27 11:27     ` Roger Pau Monné
@ 2017-11-27 11:42       ` Jan Beulich
  0 siblings, 0 replies; 24+ messages in thread
From: Jan Beulich @ 2017-11-27 11:42 UTC (permalink / raw)
  To: Roger Pau Monné
  Cc: StefanoStabellini, Wei Liu, Konrad Rzeszutek Wilk, George Dunlap,
	Andrew Cooper, IanJackson, Tim Deegan, xen-devel

>>> On 27.11.17 at 12:27, <roger.pau@citrix.com> wrote:
> On Thu, Nov 16, 2017 at 05:22:43PM -0500, Konrad Rzeszutek Wilk wrote:
>> On Thu, Nov 09, 2017 at 11:13:46AM +0000, Roger Pau Monne wrote:
>> > --- a/xen/include/xen/coverage.h
>> > +++ b/xen/include/xen/coverage.h
>> > @@ -1,9 +1,14 @@
>> >  #ifndef _XEN_COV_H
>> >  #define _XEN_COV_H
>> >  
>> > -#ifdef CONFIG_GCOV
>> > +#ifdef CONFIG_COVERAGE
>> >  #include <public/sysctl.h>
>> >  int sysctl_cov_op(struct xen_sysctl_coverage_op *op);
>> > +#else
>> > +static inline int sysctl_cov_op(void *unused)
>> > +{
>> > +    return -ENOSYS;
>> 
>> Not -EOPNOTSUPP ?
> 
> IIRC for non implemented top-level hypercalls Xen returns ENOSYS
> instead of EOPNOTSUPP, but I might be wrong.

But this is an individual sysctl, not HYPERVISOR_sysctl.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH v2 for-next 1/9] kconfig/gcov: remove gcc version choice from kconfig
  2017-11-09 11:13 ` [PATCH v2 for-next 1/9] kconfig/gcov: remove gcc version choice from kconfig Roger Pau Monne
@ 2017-11-27 14:51   ` Jan Beulich
  2017-12-01 12:14   ` Wei Liu
  1 sibling, 0 replies; 24+ messages in thread
From: Jan Beulich @ 2017-11-27 14:51 UTC (permalink / raw)
  To: Roger Pau Monne
  Cc: Stefano Stabellini, Wei Liu, Konrad Rzeszutek Wilk,
	George Dunlap, Andrew Cooper, Ian Jackson, Tim Deegan, xen-devel

>>> On 09.11.17 at 12:13, <roger.pau@citrix.com> wrote:
> Use autodetect only.
> 
> Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>

Acked-by: Jan Beulich <jbeulich@suse.com>


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH v2 for-next 4/9] gcov: introduce hooks for the sysctl
  2017-11-09 11:13 ` [PATCH v2 for-next 4/9] gcov: introduce hooks for the sysctl Roger Pau Monne
  2017-11-16 22:19   ` Konrad Rzeszutek Wilk
@ 2017-11-27 14:53   ` Jan Beulich
  1 sibling, 0 replies; 24+ messages in thread
From: Jan Beulich @ 2017-11-27 14:53 UTC (permalink / raw)
  To: Roger Pau Monne
  Cc: Stefano Stabellini, Wei Liu, Konrad Rzeszutek Wilk,
	George Dunlap, Andrew Cooper, Ian Jackson, Tim Deegan, xen-devel

>>> On 09.11.17 at 12:13, <roger.pau@citrix.com> wrote:
> So that other implementations of the sysctl can be added.
> 
> Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>

Acked-by: Jan Beulich <jbeulich@suse.com>


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH v2 for-next 6/9] kconfig/gcov: rename to coverage
  2017-11-09 11:13 ` [PATCH v2 for-next 6/9] kconfig/gcov: rename to coverage Roger Pau Monne
  2017-11-16 22:22   ` Konrad Rzeszutek Wilk
@ 2017-11-27 15:00   ` Jan Beulich
  1 sibling, 0 replies; 24+ messages in thread
From: Jan Beulich @ 2017-11-27 15:00 UTC (permalink / raw)
  To: Roger Pau Monne
  Cc: Stefano Stabellini, Wei Liu, Konrad Rzeszutek Wilk,
	George Dunlap, Andrew Cooper, Ian Jackson, Tim Deegan, xen-devel

>>> On 09.11.17 at 12:13, <roger.pau@citrix.com> wrote:
> --- a/xen/Rules.mk
> +++ b/xen/Rules.mk
> @@ -115,9 +115,13 @@ subdir-all := $(subdir-y) $(subdir-n)
>  
>  $(filter %.init.o,$(obj-y) $(obj-bin-y) $(extra-y)): CFLAGS += 
> -DINIT_SECTIONS_ONLY
>  
> -ifeq ($(CONFIG_GCOV),y)
> +ifeq ($(CONFIG_COVERAGE),y)
> +ifeq ($(clang),y)
> +$(filter-out %.init.o $(nogcov-y),$(obj-y) $(obj-bin-y) $(extra-y)): CFLAGS += -fprofile-instr-generate -fcoverage-mapping
> +else
>  $(filter-out %.init.o $(nogcov-y),$(obj-y) $(obj-bin-y) $(extra-y)): CFLAGS += -fprofile-arcs -ftest-coverage

Could you please eliminate the redundancy here? Use a helper variable
to hold the options to add, and then have just a single line with the
$(filter-out ...):.

> --- a/xen/common/coverage/Makefile
> +++ b/xen/common/coverage/Makefile
> @@ -1,6 +1,9 @@
> -obj-y += coverage.o gcov_base.o gcov.o
> +obj-y += coverage.o
> +ifneq ($(clang),y)
> +obj-y += gcov_base.o gcov.o
>  obj-y += $(call cc-ifversion,lt,0x040700, \
>  		gcc_3_4.o, $(call cc-ifversion,lt,0x040900, \
>  		gcc_4_7.o, $(call cc-ifversion,lt,0x050000, \
>  		gcc_4_9.o, $(call cc-ifversion,lt,0x070000, \
>  		gcc_5.o, gcc_7.o))))
> +endif

I guess the build with clang is broken before and after this patch
when the Kconfig option is enabled, in which case the ordering
within the series doesn't matter. Otherwise I would have said
that this patch should come after the one adding the LLVM files.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH v2 for-next 7/9] coverage: introduce support for llvm profiling
  2017-11-09 11:13 ` [PATCH v2 for-next 7/9] coverage: introduce support for llvm profiling Roger Pau Monne
@ 2017-11-27 15:01   ` Jan Beulich
  0 siblings, 0 replies; 24+ messages in thread
From: Jan Beulich @ 2017-11-27 15:01 UTC (permalink / raw)
  To: Roger Pau Monne
  Cc: Stefano Stabellini, Wei Liu, Konrad Rzeszutek Wilk,
	George Dunlap, Andrew Cooper, Ian Jackson, Tim Deegan, xen-devel

>>> On 09.11.17 at 12:13, <roger.pau@citrix.com> wrote:
> Introduce the functionality in order to fill the hooks of the
> cov_sysctl_ops struct. Note that the functionality is still not wired
> into the build system.
> 
> Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>

Acked-by: Jan Beulich <jbeulich@suse.com>


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH v2 for-next 1/9] kconfig/gcov: remove gcc version choice from kconfig
  2017-11-09 11:13 ` [PATCH v2 for-next 1/9] kconfig/gcov: remove gcc version choice from kconfig Roger Pau Monne
  2017-11-27 14:51   ` Jan Beulich
@ 2017-12-01 12:14   ` Wei Liu
  1 sibling, 0 replies; 24+ messages in thread
From: Wei Liu @ 2017-12-01 12:14 UTC (permalink / raw)
  To: Roger Pau Monne
  Cc: Stefano Stabellini, Wei Liu, George Dunlap, Andrew Cooper,
	Ian Jackson, Tim Deegan, Jan Beulich, xen-devel

On Thu, Nov 09, 2017 at 11:13:41AM +0000, Roger Pau Monne wrote:
> Use autodetect only.
> 
> Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>

Acked-by: Wei Liu <wei.liu2@citrix.com>

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH v2 for-next 3/9] gcov: rename sysctl and functions
  2017-11-09 11:13 ` [PATCH v2 for-next 3/9] gcov: rename sysctl and functions Roger Pau Monne
  2017-11-16 22:24   ` Konrad Rzeszutek Wilk
@ 2018-01-23  9:37   ` Jan Beulich
  2018-01-23 11:07     ` Ian Jackson
  1 sibling, 1 reply; 24+ messages in thread
From: Jan Beulich @ 2018-01-23  9:37 UTC (permalink / raw)
  To: Wei Liu, Ian Jackson
  Cc: Stefano Stabellini, George Dunlap, Andrew Cooper, Tim Deegan,
	xen-devel, Roger Pau Monne

>>> On 09.11.17 at 12:13, <roger.pau@citrix.com> wrote:
> Change gcov to cov (for internal interfaces) or coverage (for the
> public ones).
> 
> Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
> ---
> Cc: Ian Jackson <ian.jackson@eu.citrix.com>
> Cc: Wei Liu <wei.liu2@citrix.com>
> Cc: Andrew Cooper <andrew.cooper3@citrix.com>
> Cc: George Dunlap <George.Dunlap@eu.citrix.com>
> Cc: Jan Beulich <jbeulich@suse.com>
> Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
> Cc: Stefano Stabellini <sstabellini@kernel.org>
> Cc: Tim Deegan <tim@xen.org>
> ---
> Changes since v1:
>  - Use coverage instead of cov in the public interface.
> ---
>  tools/misc/xencov.c         | 28 ++++++++++++++--------------

Btw., I still have this (and subsequent patches in the series) on my
list of things wanting to be committed, but this needs a tools
maintainer's ack before it can go in.

Jan

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply	[flat|nested] 24+ messages in thread

* Re: [PATCH v2 for-next 3/9] gcov: rename sysctl and functions
  2018-01-23  9:37   ` Jan Beulich
@ 2018-01-23 11:07     ` Ian Jackson
  0 siblings, 0 replies; 24+ messages in thread
From: Ian Jackson @ 2018-01-23 11:07 UTC (permalink / raw)
  To: Jan Beulich
  Cc: Stefano Stabellini, Wei Liu, George Dunlap, Andrew Cooper,
	Tim Deegan, xen-devel, Roger Pau Monne

Jan Beulich writes ("Re: [Xen-devel] [PATCH v2 for-next 3/9] gcov: rename sysctl and functions"):
> On 09.11.17 at 12:13, <roger.pau@citrix.com> wrote:
> > Change gcov to cov (for internal interfaces) or coverage (for the
> > public ones).
...
> Btw., I still have this (and subsequent patches in the series) on my
> list of things wanting to be committed, but this needs a tools
> maintainer's ack before it can go in.

Thanks for the implied ping.

Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply	[flat|nested] 24+ messages in thread

end of thread, other threads:[~2018-01-23 11:07 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-09 11:13 [PATCH v2 for-next 0/9] LLVM coverage support for Xen Roger Pau Monne
2017-11-09 11:13 ` [PATCH v2 for-next 1/9] kconfig/gcov: remove gcc version choice from kconfig Roger Pau Monne
2017-11-27 14:51   ` Jan Beulich
2017-12-01 12:14   ` Wei Liu
2017-11-09 11:13 ` [PATCH v2 for-next 2/9] gcov: rename folder and header to coverage Roger Pau Monne
2017-11-16 22:24   ` Konrad Rzeszutek Wilk
2017-11-09 11:13 ` [PATCH v2 for-next 3/9] gcov: rename sysctl and functions Roger Pau Monne
2017-11-16 22:24   ` Konrad Rzeszutek Wilk
2018-01-23  9:37   ` Jan Beulich
2018-01-23 11:07     ` Ian Jackson
2017-11-09 11:13 ` [PATCH v2 for-next 4/9] gcov: introduce hooks for the sysctl Roger Pau Monne
2017-11-16 22:19   ` Konrad Rzeszutek Wilk
2017-11-27 14:53   ` Jan Beulich
2017-11-09 11:13 ` [PATCH v2 for-next 5/9] coverage: introduce generic file Roger Pau Monne
2017-11-16 22:23   ` Konrad Rzeszutek Wilk
2017-11-09 11:13 ` [PATCH v2 for-next 6/9] kconfig/gcov: rename to coverage Roger Pau Monne
2017-11-16 22:22   ` Konrad Rzeszutek Wilk
2017-11-27 11:27     ` Roger Pau Monné
2017-11-27 11:42       ` Jan Beulich
2017-11-27 15:00   ` Jan Beulich
2017-11-09 11:13 ` [PATCH v2 for-next 7/9] coverage: introduce support for llvm profiling Roger Pau Monne
2017-11-27 15:01   ` Jan Beulich
2017-11-09 11:13 ` [PATCH v2 for-next 8/9] xsm: add bodge when compiling with llvm coverage support Roger Pau Monne
2017-11-09 11:13 ` [PATCH v2 for-next 9/9] coverage: add documentation for LLVM coverage Roger Pau Monne

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.