From patchwork Thu Aug 16 16:29:39 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Masami Hiramatsu (Google)" X-Patchwork-Id: 10567783 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 96451139A for ; Thu, 16 Aug 2018 16:30:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 83DD82B4D0 for ; Thu, 16 Aug 2018 16:30:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 768FB2B508; Thu, 16 Aug 2018 16:30:04 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1CC972B4D0 for ; Thu, 16 Aug 2018 16:30:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2404250AbeHPT3e (ORCPT ); Thu, 16 Aug 2018 15:29:34 -0400 Received: from mail.kernel.org ([198.145.29.99]:51204 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728834AbeHPT3d (ORCPT ); Thu, 16 Aug 2018 15:29:33 -0400 Received: from localhost.localdomain (NE2965lan1.rev.em-net.ne.jp [210.141.244.193]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id EA301208C4; Thu, 16 Aug 2018 16:30:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1534437002; bh=6+mUcTvXfm2gb+exOkb+FWgX7zyX9QkDjrZePXy+zuQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rBXcfqaTFQJkqw4AjMqLYIYiApT+VFffGQZqkyjozFVi393VHVpTzkcGFyVDsfX2p lyfdi9vwN/xnB4QG3FTebeguDytuK5q7F4E4XxE0H7stY30gRNN6rBWy/r57Q6gIxB TznfarWSzuxAAViAdzIX6mfl5P77qYsxTF1AbKjM= From: Masami Hiramatsu To: Shuah Khan , Steven Rostedt Cc: Ingo Molnar , Masami Hiramatsu , linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 01/32] tracing: Allow gcov profiling on only ftrace subsystem Date: Fri, 17 Aug 2018 01:29:39 +0900 Message-Id: <153443697980.23257.9233992547183322108.stgit@devbox> X-Mailer: git-send-email 2.13.6 In-Reply-To: <153443695002.23257.13628220023468200991.stgit@devbox> References: <153443695002.23257.13628220023468200991.stgit@devbox> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Sender: linux-kselftest-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Add GCOV_PROFILE_FTRACE to allow gcov profiling on only files in ftrace subsystem. This kconfig flag will be used for checking kselftest/ftrace coverage. Signed-off-by: Masami Hiramatsu --- kernel/trace/Kconfig | 13 +++++++++++++ kernel/trace/Makefile | 5 +++++ 2 files changed, 18 insertions(+) diff --git a/kernel/trace/Kconfig b/kernel/trace/Kconfig index fd6754b88f87..8decf6d8553a 100644 --- a/kernel/trace/Kconfig +++ b/kernel/trace/Kconfig @@ -774,6 +774,19 @@ config TRACING_EVENTS_GPIO help Enable tracing events for gpio subsystem +config GCOV_PROFILE_FTRACE + bool "Enable GCOV profiling on ftrace subsystem" + depends on GCOV_KERNEL + help + Enable GCOV profiling on ftrace subsystem for checking + which functions/lines are tested. + + If unsure, say N. + + Note that on a kernel compiled with this flags, ftrace will be + significantly run slower. So do not enable it for production + kernel. + endif # FTRACE endif # TRACING_SUPPORT diff --git a/kernel/trace/Makefile b/kernel/trace/Makefile index 98d53b39a8ee..f81dadbc7c4a 100644 --- a/kernel/trace/Makefile +++ b/kernel/trace/Makefile @@ -23,6 +23,11 @@ ifdef CONFIG_TRACING_BRANCHES KBUILD_CFLAGS += -DDISABLE_BRANCH_PROFILING endif +# for GCOV coverage profiling +ifdef CONFIG_GCOV_PROFILE_FTRACE +GCOV_PROFILE := y +endif + CFLAGS_trace_benchmark.o := -I$(src) CFLAGS_trace_events_filter.o := -I$(src)