From patchwork Fri Oct 20 16:30:41 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Wei Liu X-Patchwork-Id: 10020619 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 5819F60234 for ; Fri, 20 Oct 2017 16:33:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 54D4728F19 for ; Fri, 20 Oct 2017 16:33:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4976A28F1B; Fri, 20 Oct 2017 16:33:28 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id C78E228F24 for ; Fri, 20 Oct 2017 16:33:27 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e5aCd-00062W-8r; Fri, 20 Oct 2017 16:31:19 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e5aCb-00062Q-HB for xen-devel@lists.xenproject.org; Fri, 20 Oct 2017 16:31:17 +0000 Received: from [85.158.137.68] by server-4.bemta-3.messagelabs.com id 50/09-10698-4D42AE95; Fri, 20 Oct 2017 16:31:16 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFmpgkeJIrShJLcpLzFFi42JxWrrBXve8yqt Igys9XBbft0xmcmD0OPzhCksAYxRrZl5SfkUCa8aLXScYC26KVDyf+ZCtgXG9YBcjJ4eEgL/E zA/fmUFsNgFliZ+dvWwgtoiAnkTTgeeMXYxcHMwC15gkljTcACsSFrCQmLxvDROIzSKgKvH93 ll2EJtXwFxi8vofjBBD5SV2tV1kBbGFBBQkOqYfY4KoEZQ4OfMJC4jNLCAhcfDFC+YJjNyzkK RmIUktYGRaxahRnFpUllqka2Spl1SUmZ5RkpuYmaNraGCsl5taXJyYnpqTmFSsl5yfu4kRGA7 1DAyMOxib9vodYpTkYFIS5Q2sfBkpxJeUn1KZkVicEV9UmpNafIhRhoNDSYJ3q/KrSCHBotT0 1Iq0zBxgYMKkJTh4lER4E4DBKcRbXJCYW5yZDpE6xWjMcWzT5T9MHB037/5hEmLJy89LlRLnb QWZJABSmlGaBzcIFjGXGGWlhHkZGRgYhHgKUotyM0tQ5V8xinMwKgnz+oFM4cnMK4Hb9wroFC agU9jtX4CcUpKIkJJqYAyOKpZsCzJb3Jt7UvbP+RcH5t++bjzt9d2y5MbOlb15d50TWz7GSj/ p//dS7mlsGZt+h364V1th1/m36euLXsd9y4wt9nttE8n0PFZWOd5V9f79NVlWHdVqyYmd71uX nC/uOqF2sKnVvOME25SZu6o+fv+5Y1Jdpl7wBW6uoJ9eO5Yu23fCR4mlOCPRUIu5qDgRAG5W5 mCTAgAA X-Env-Sender: prvs=459d591f5=wei.liu2@citrix.com X-Msg-Ref: server-6.tower-31.messagelabs.com!1508517069!72688639!1 X-Originating-IP: [66.165.176.63] X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni42MyA9PiAzMDYwNDg=\n, received_headers: No Received headers X-StarScan-Received: X-StarScan-Version: 9.4.45; banners=-,-,- X-VirusChecked: Checked Received: (qmail 46472 invoked from network); 20 Oct 2017 16:31:10 -0000 Received: from smtp02.citrix.com (HELO SMTP02.CITRIX.COM) (66.165.176.63) by server-6.tower-31.messagelabs.com with RC4-SHA encrypted SMTP; 20 Oct 2017 16:31:10 -0000 X-IronPort-AV: E=Sophos;i="5.43,405,1503360000"; d="scan'208";a="455256683" From: Wei Liu To: Xen-devel Date: Fri, 20 Oct 2017 17:30:41 +0100 Message-ID: <20171020163041.5863-1-wei.liu2@citrix.com> X-Mailer: git-send-email 2.11.0 MIME-Version: 1.0 Cc: Stefano Stabellini , Wei Liu , Konrad Rzeszutek Wilk , George Dunlap , Andrew Cooper , Ian Jackson , Tim Deegan , Jan Beulich , roger.pau@citrix.com Subject: [Xen-devel] [PATCH for-4.10] docs: update coverage.markdown X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP The coverage support in hypervisor is redone. Update the document. Signed-off-by: Wei Liu Acked-by: Ian Jackson Reviewed-by: Roger Pau Monné --- Cc: Andrew Cooper Cc: George Dunlap Cc: Ian Jackson Cc: Jan Beulich Cc: Konrad Rzeszutek Wilk Cc: Stefano Stabellini Cc: Tim Deegan Cc: Wei Liu Cc: roger.pau@citrix.com --- docs/misc/coverage.markdown | 30 +++++++++--------------------- 1 file changed, 9 insertions(+), 21 deletions(-) diff --git a/docs/misc/coverage.markdown b/docs/misc/coverage.markdown index 9a88c899b8..6eae44176c 100644 --- a/docs/misc/coverage.markdown +++ b/docs/misc/coverage.markdown @@ -10,38 +10,26 @@ down your hypervisor. ## Enable coverage -Test coverage support can be turned on compiling Xen with the `coverage` option set -to `y`. +Test coverage support can be turned on compiling Xen with the `CONFIG_GCOV` +option set to `y`. -Something like: - - cd xen - make coverage=y - -(or change your `.config` file). +Change your `.config` or run `make -C xen menuconfig`. ## 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` -allows you to do 3 operations: +To extract data you use a simple utility called `xencov`. +It allows you to do 2 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 (`xencov_split`) is used to split extracted data file into files -needed by userspace tools. +Another utility (`xencov_split`) is used to split extracted data file into +files needed by userspace tools. ## Split coverage data -Once you extracted data from Xen, it is time to create files which the coverage tools -can understand. To do it you need to run `xencov_split` utility. +Once you extracted data from Xen, it is time to create files which the coverage +tools can understand. To do it you need to run `xencov_split` utility. The utility just takes an input file and splits the blob into gcc .gcda files in the same directory that you execute the script. As file names are generated