From patchwork Fri Feb 14 09:02:47 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naresh Kamboju X-Patchwork-Id: 3651441 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id E869EBF13A for ; Fri, 14 Feb 2014 09:04:13 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id EB037201ED for ; Fri, 14 Feb 2014 09:04:12 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 28141201C7 for ; Fri, 14 Feb 2014 09:04:08 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WEEg6-0000km-Hn; Fri, 14 Feb 2014 09:03:22 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1WEEg4-0002D2-4H; Fri, 14 Feb 2014 09:03:20 +0000 Received: from mail-yh0-f48.google.com ([209.85.213.48]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WEEg1-0002Bd-E2 for linux-arm-kernel@lists.infradead.org; Fri, 14 Feb 2014 09:03:18 +0000 Received: by mail-yh0-f48.google.com with SMTP id f10so11184327yha.7 for ; Fri, 14 Feb 2014 01:02:47 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:date:message-id:subject:from:to:cc :content-type; bh=ENxEE5RUzHkOHUgXIxizyAtWBcRDF/uryMumji0ocGM=; b=L8hyWc9OOvCXCliPufjT6BXYMkuGLjFJ9GugZT5H8iXxLrfK43imIXrfb/Vhk+q+GC 8WcOPY637C70nzbWyZiPt8vOlAtVv4R1YOSQWTtjucAggQeJk+HjqwesxwWhDZSinTBb Rje0kUocTKT051FvKYaG2IClQ1jqjQCjybEM9iDcHmcVdtteCN2BPqj2fhIjtbIiwsQv avV2SwZyhj8QZHdN3KcreDaR361wlWmlU8U9CpmWXewsPjd+tqod2coRTpFxfpuToL+Y Km2zsrXbSkUgskKgt6PlLmAhRoMNe1Rg6DdGA+o66aKBcAAMUNRC55y6RVelck3Pn7cg ytwg== X-Gm-Message-State: ALoCoQkYxsn8hESKE7JS+P77sCjSqc6BPrdUU68Bg2fVWN+TPeSsginYQ53Jr/kMcRwIWIEInUYD MIME-Version: 1.0 X-Received: by 10.236.15.102 with SMTP id e66mr317703yhe.69.1392368567550; Fri, 14 Feb 2014 01:02:47 -0800 (PST) Received: by 10.170.145.194 with HTTP; Fri, 14 Feb 2014 01:02:47 -0800 (PST) Date: Fri, 14 Feb 2014 14:32:47 +0530 Message-ID: Subject: How to get the Linux kernel coverage data on ARM arch when I run LTP test? From: Naresh Kamboju To: Arnd Bergmann , fhrbata@redhat.com, oberpar@linux.vnet.ibm.com, Paul Larson X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140214_040317_653931_5190D7FB X-CRM114-Status: GOOD ( 12.38 ) X-Spam-Score: -2.6 (--) Cc: ltp-list , ltp-coverage , Mark Brown , "linux-kernel@vger.kernel.org" , Deepak Saxena , "linux-arm-kernel@lists.infradead.org" , Milosz Wasilewski X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.8 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Hi All, Sorry for the wide distribution: According to LTP page info, http://ltp.sourceforge.net/coverage/gcov.php http://ltp.sourceforge.net/coverage/lcov.php My question is How to get kernel coverage when I run LTP test? Since we do not have direct GCOV support on ARM I have enabled ( just for experiment) $ git diff kernel/gcov/Kconfig I have enabled below kernel config and built the kernel. CONFIG_GCOV_KERNEL=y CONFIG_GCOV_PROFILE_ALL=y CONFIG_GCOV_FORMAT_AUTODETECT=y of course I have disabled gcov on below folders and files, because since it is an experiment i would like to be on safe side - arch/arm/mm/ - arch/arm/kernel/ - arch/arm/boot/ - arch/arm/boot/compressed/ - arch/arm/boot/bootp/ - arch/arm/boot/dts Arndale booted with this configuration successfully. Took more than 65 seconds to finish boot. gcov related files are found under /sys/ similer to X86 machine. And gcov supporting files filename.gcda are having links to kernel source root@linaro-developer:~# ls /sys/kernel/debug/gcov/ reset tmp root@linaro-developer:~# root@linaro-developer:~# ls /sys/kernel/debug/gcov/tmp/ linux-linaro-3.13-2014.01 root@linaro-developer:~# ls /sys/kernel/debug/gcov/tmp/linux-linaro-3.13-2014.01/ arch block crypto drivers fs init ipc kernel lib mm security virt root@linaro-developer:~# ls /sys/kernel/debug/gcov/tmp/linux-linaro-3.13-2014.01/kernel/time.* -l -rw------- 1 root root 0 Jan 1 1970 /sys/kernel/debug/gcov/tmp/linux-linaro-3.13-2014.01/kernel/time.gcda lrwxrwxrwx 1 root root 0 Jan 1 1970 /sys/kernel/debug/gcov/tmp/linux-linaro-3.13-2014.01/kernel/time.gcno -> /tmp/linux-linaro-3.13-2014.01/kernel/time.gcno root@linaro-developer:~# Source are placed under /tmp/ root@linaro-developer:/tmp/linux-linaro-3.13-2014.01# ls kernel/time.* -l -rw-rw-r-- 1 linaro linaro 19233 Jan 24 2014 kernel/time.c -rw-rw-r-- 1 linaro linaro 12768 Feb 13 2014 kernel/time.gcno -rw-rw-r-- 1 linaro linaro 136444 Feb 13 2014 kernel/time.o root@linaro-developer:/tmp/linux-linaro-3.13-2014.01# root@linaro-developer:/tmp/linux-linaro-3.13-2014.01# gcov kernel/gcov/base.c -o /sys/kernel/debug/gcov/tmp/linux-linaro-3.13-2014.01/kernel/gcov/ File 'kernel/gcov/base.c' Lines executed:43.18% of 44 Creating 'base.c.gcov' root@linaro-developer:/tmp/linux-linaro-3.13-2014.01# The above experiment gives coverage of a single file base.c when i run gcov manually. Is there any way to get Linux kernel coverage of all files after running LTP test cases ? Thanks in advance. Best regards Naresh Kamboju diff --git a/kernel/gcov/Kconfig b/kernel/gcov/Kconfig index d4da55d..fceac85 100644 --- a/kernel/gcov/Kconfig +++ b/kernel/gcov/Kconfig @@ -35,7 +35,7 @@ config GCOV_KERNEL config GCOV_PROFILE_ALL bool "Profile entire Kernel" depends on GCOV_KERNEL - depends on SUPERH || S390 || X86 || PPC || MICROBLAZE + depends on SUPERH || S390 || X86 || PPC || MICROBLAZE || ARM default n ---help--- This options activates profiling for the entire kernel.