From: Frediano Ziglio Subject: [PATCH v10 5/5] gcov: Add documentation for coverage Date: Thu, 21 Feb 2013 16:13:45 +0000 Message-ID: <1361463225-21750-6-git-send-email-frediano.ziglio@citrix.com> References: <1361463225-21750-1-git-send-email-frediano.ziglio@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1361463225-21750-1-git-send-email-frediano.ziglio@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Konrad Rzeszutek Wilk , Ian Campbell , Jan Beulich , George Dunlap Cc: Frediano Ziglio , xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org Signed-off-by: Frediano Ziglio --- docs/misc/coverage.markdown | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 docs/misc/coverage.markdown diff --git a/docs/misc/coverage.markdown b/docs/misc/coverage.markdown new file mode 100644 index 0000000..74af665 --- /dev/null +++ b/docs/misc/coverage.markdown @@ -0,0 +1,39 @@ +# Coverage support for Xen + +Coverare support allow you to get coverage information from Xen execution. +You can see how many times a line is executed. + +The compiler have specific options that enable the collection of these +information. Every basic block in the code will be instructed by the compiler +to compute these statistics. It should not be used in production as it slow +down your hypervisor. + +## Enable coverage + +Test coverage support can be turned on compiling Xen with coverage option set +to y. + +Something like: + cd xen + make coverage=y + +(or change your `Config.mk` file). + +## Extract coverage data + +The way GCC and other tools deal with coverage information is to use some files +created during build phase (.gcno) and some files produced by executing the +*program* (.gcda). The program in this case is Xen but Xen cannot write files +so the way you can use coverage from Xen is extract coverage data from Xen and +then split these information into files. + +To extract data you use a simple utility called `xencov`. Mainly `xencore` +allow you to do 3 operations: + +* `xencov read` extract data +* `xencov reset` reset all coverage counters +* `xencov read-reset` extract data and reset counters at the same time. + +Another utility (**TODO**) is used to split extracted data file into files +needed by userspace tools. + -- 1.7.9.5