Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp4210021imu; Mon, 14 Jan 2019 17:38:01 -0800 (PST) X-Google-Smtp-Source: ALg8bN5iIjThml/NVgW3lZz+89P3DnpgrknjdIMZqr+JQg4h+NblNx8wXkk74BeEq669ZzzLv6s0 X-Received: by 2002:a63:4f20:: with SMTP id d32mr1375675pgb.47.1547516281479; Mon, 14 Jan 2019 17:38:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547516281; cv=none; d=google.com; s=arc-20160816; b=SAhHvV1bU9qJ25GbiAQZMZvoyB/hKpDA9TY8m0vTlDYQbRRjaYRAsN1RSplx8PmNFV JiKl6alPyk7Cl2UfUmG8PDc5iGCTKX2LuKNVVvn4DReMu9wCwNs+NLwkH+4syErOcL/Y YWSgtNWtiwPKBWm8Z/2PEYjaFjhVCqqQUUFGsALbtKEtVWZRdr9GwV48YT8ofOaaouy9 KUHbaXXOH16uCLNsI0ZmUXYLnqM5ibYCkH9cAAxTYneM7lu/8Q9Tw0M4NFjBrz3eIZOJ eemD6Ub2wJacJIbtuVamKDifaEhlvjsfP+wf0FXGUMRnClL3A5hNrOXqrdqC70RKbNyB Vkiw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature:dkim-filter; bh=3TMrVr8XzzhVg7OecSYysVOeaVbCFz498698XpGCwYY=; b=LKBfKQ2rnNJSERk3kCAT6sPXkrOQHHdG75k66MU5cGoABM1KJViXXcDxD5Y5S7Fid+ St1j2n83emPBIyYmKyFTDCjKp4AeIdPAGRhJ1Xxds4ao0KzkGlouw0YBa5ix4XCU7y7a w4jsTca28byy+lhFtpWRsA/7fhYDasuBXMKg+3GhRbzjvAtr64DiZtzCbAZzaQs1xZNz ZGmJbGUBYCuu36hw6+khr2ppet6US7+AFQEHAKpVgEtXfDNM94HYIZuCLHes+3Qhop4x QUaxvyhrSSj3DlFZFFPP3pPZs9VB757sen/GCkYlV955ICPJNudWgfRHxzPQaxwgkfrO 1oGw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b="l63QAS/O"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l64si1704764pge.168.2019.01.14.17.37.44; Mon, 14 Jan 2019 17:38:01 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b="l63QAS/O"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727766AbfAOBZW (ORCPT + 99 others); Mon, 14 Jan 2019 20:25:22 -0500 Received: from conssluserg-03.nifty.com ([210.131.2.82]:34893 "EHLO conssluserg-03.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727203AbfAOBZV (ORCPT ); Mon, 14 Jan 2019 20:25:21 -0500 Received: from mail-vs1-f42.google.com (mail-vs1-f42.google.com [209.85.217.42]) (authenticated) by conssluserg-03.nifty.com with ESMTP id x0F1PDlx001322 for ; Tue, 15 Jan 2019 10:25:13 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conssluserg-03.nifty.com x0F1PDlx001322 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1547515514; bh=3TMrVr8XzzhVg7OecSYysVOeaVbCFz498698XpGCwYY=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=l63QAS/ONOO2WzaDF7ELajOXLbhASeDMfAaP61AS4VzJo2sMzFG3RPvbvaCFE7SW+ CrYuQWsr8/DnhRsyt9J2ckBPoVkbilZXGJq4o56H6q2ESqYHlmoRIlZcKX53HrCLHK tZFI1dc+58OAizg7V+BPvFmrhTbHjdidZm5wbI5gH0m9aRI987Nxd6s4xIkSQ5pgwh rht0zRAsq0sU6N1dwIOUQ5AyH/sB61frneWQbEi6ZU1li/HKrx72ZTpQf9zh77Jf1P WU82P2FiP09GzLGPU4sQTtShyyHHNpfPbxrrZKrrmwImsjr7zy1DXUJ9N8PXX+vQ2N zCu7gu+Bj1yIA== X-Nifty-SrcIP: [209.85.217.42] Received: by mail-vs1-f42.google.com with SMTP id n13so689959vsk.4 for ; Mon, 14 Jan 2019 17:25:13 -0800 (PST) X-Gm-Message-State: AJcUukfyKjT7Y0GmurW3D+bhSo/JtmdbN66cmUrd5AKGBSCxs8vnZLJP X1tssi8MBwFdyrCn2vcklVg12NCtUSLTpOZy2xg= X-Received: by 2002:a67:385a:: with SMTP id f87mr561436vsa.179.1547515512615; Mon, 14 Jan 2019 17:25:12 -0800 (PST) MIME-Version: 1.0 References: <20190114210426.177543-1-trong@android.com> <20190114210426.177543-5-trong@android.com> In-Reply-To: <20190114210426.177543-5-trong@android.com> From: Masahiro Yamada Date: Tue, 15 Jan 2019 10:24:36 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 4/4] gcov: clang: pick GCC vs Clang format depending on compiler To: Tri Vo Cc: oberpar@linux.ibm.com, ghackmann@android.com, Nick Desaulniers , Linux Kernel Mailing List , kernel-team@android.com Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jan 15, 2019 at 6:07 AM Tri Vo wrote: > > Clang gcov format is only supported by Clang compiler, and Clang > compiler only supports Clang format. If so, what is the point of putting GCOV_FORMAT_CLANG into the choice menu? You can choose the format only when you are using GCC. I think the following is more sensible: if GCOV_KERNEL config GCOV_PROFILE_ALL .... choice prompt "Specify GCOV format for GCC" depends on CC_IS_GCC ... config GCOV_FORMAT_3_4 bool "GCC 3.4 format" depends on GCC_VERSION < 40700 ... config GCOV_FORMAT_4_7 bool "GCC 4.7 format" ... endchoice config GCOV_FORMAT_CLANG def_bool CC_IS_CLANG endif Or, you can delete GCOV_FORMAT_CLANG if you write the Makefile like follows: obj-y := base.o fs.o obj-$(CONFIG_GCOV_FORMAT_3_4) += gcc_base.o gcc_3_4.o obj-$(CONFIG_GCOV_FORMAT_4_7) += gcc_base.o gcc_4_7.o obj-$(CONFIG_CC_IS_CLANG) += clang.o > We set gcov format to depend on which compiler (GCC or Clang) is used. > > Automatic format detection behavior is preserved because: > If GCC is used, one of the GCC gcov formats is selected. > If Clang is used, Clang gcov format is selected. > > Signed-off-by: Tri Vo > --- > kernel/gcov/Kconfig | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/kernel/gcov/Kconfig b/kernel/gcov/Kconfig > index eb428e570923..37ec551d4039 100644 > --- a/kernel/gcov/Kconfig > +++ b/kernel/gcov/Kconfig > @@ -60,6 +60,8 @@ choice > In such a case, change this option to adjust the format used in the > kernel accordingly. > > + Select Clang gcov format if building with Clang compiler. > + > config GCOV_FORMAT_3_4 > bool "GCC 3.4 format" > depends on CC_IS_GCC && GCC_VERSION < 40700 > @@ -68,11 +70,13 @@ config GCOV_FORMAT_3_4 > > config GCOV_FORMAT_4_7 > bool "GCC 4.7 format" > + depends on CC_IS_GCC > ---help--- > Select this option to use the format defined by GCC 4.7. > > config GCOV_FORMAT_CLANG > bool "Clang format" > + depends on CC_IS_CLANG > ---help--- > Select this option to use the format defined by Clang. > > -- > 2.20.1.97.g81188d93c3-goog > -- Best Regards Masahiro Yamada