Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp1606769pxf; Fri, 12 Mar 2021 14:06:42 -0800 (PST) X-Google-Smtp-Source: ABdhPJwKJv+/Xcm0p4XlmylRFp4eD/o/xueT0w1VE7FrnHAITumheNZakFSEH9RSv39G+6FHZidT X-Received: by 2002:aa7:d511:: with SMTP id y17mr16613895edq.275.1615586802717; Fri, 12 Mar 2021 14:06:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615586802; cv=none; d=google.com; s=arc-20160816; b=S4j9Sh3LNegLdtN86rtfGVyUMRKWvBEESrIiNzjvcyv3xax6q5J/RFIuBS3KbveNCh YNPK7243kiPvHUGYRABwHggtfmrn973yO//BGimqBXRdW/O/gAiq4zaqzhdkasjI4oam RFg5pVeiXK3w97tqo1YlLly8TwKDb0mnMmGh0ByD4t68Ra6yBG1Ci9onKpmI3AhfEWCR /HkLkO9jZgxm0CtG1Bzump+gfcP4gHSzEhRK+7PHqo9YOAMArw5kMKaiFbNogjflAD7X mH1D/7j8XjEC+rmMGPUf38LGRO/fgX6jYmdaY3/4I8hqsbbU8ety5FQTF6iBYw7QivF0 4u8w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=zwseNeEs0krod4F+IhuF+pHQNcsyduOIl992m6AfVdM=; b=v+T1r7WhVyNkivRZpBW5sH9ed9jym0E5at3kW1wRjAcE/fkPskTCcLZ9jQTNqEAUs1 vyCOI5ej3pmfeVbcxnHeSiEwMb0pkqNq3NY99NdTrZuA/SL71/tmcpoA9HuMkq80BptS F3SGXRymg63sAZB1f4JVCpVOk56zOlqrYMdz13pU0GBjCkR3o+AlL5pHKjVkelZVm8eK G6AMuE3YMevQTLuxhBhB8Uz5mdG6ou1ICXZLWfZPpwIYG+KEu3pbZoY8AY5FK9s5g2fH uDTcbs3iIwH86KBohIt8IMmoRENOGZqJrC2SM2sP5+CcfCGuUTrm7GWi36DVdCjaEe9M /x4Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=FA1WSoHx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q16si5084909ejd.145.2021.03.12.14.06.20; Fri, 12 Mar 2021 14:06:42 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=FA1WSoHx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235430AbhCLWF0 (ORCPT + 99 others); Fri, 12 Mar 2021 17:05:26 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44954 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235435AbhCLWFQ (ORCPT ); Fri, 12 Mar 2021 17:05:16 -0500 Received: from mail-lf1-x12c.google.com (mail-lf1-x12c.google.com [IPv6:2a00:1450:4864:20::12c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A1D65C061574 for ; Fri, 12 Mar 2021 14:05:15 -0800 (PST) Received: by mail-lf1-x12c.google.com with SMTP id v9so47656228lfa.1 for ; Fri, 12 Mar 2021 14:05:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=zwseNeEs0krod4F+IhuF+pHQNcsyduOIl992m6AfVdM=; b=FA1WSoHxObCG8KV4IFqpaR14oqL2QB9UGxuz2ki63NNRIj1K5dHISlascnXktpuqQR HHyUNZfZpOA4RfbkjDqTRlx6cKhYrlb1S1Ctjv+2CvNRkzookyiZFuFc4xfJT18mZMVk OI0ZfYLR9MRMy8Yn8d8KKUxfa+egoUASV61VHQMJsgtw7qf3PqUUJd/nCX1H+d60iXrV gJW2F3YZHsmADd6JuXsq3N/5dig0eRZDQWNcfSWDgBFGqEWasZtgdjeGPRkP3uKl0L55 Ua90C4dn21FAg9OJNphicIY6igNgMvpuukjZy8RMPhHEGbimAEJ16PhjyIVWsOG8XMq7 uhcw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=zwseNeEs0krod4F+IhuF+pHQNcsyduOIl992m6AfVdM=; b=a5wbry/lbGPhdOggDUZxBDuLfOQgCkX+PFW1lVxg4glVlAZUtpcWmbK/GgHNfEFKfM 3KdRo8PeIyA6ov8V3OZhMEKAk6432dCcquXrGSVwldZw5z9nFnk/fUt8iUbsD4knSMfp pPNvxxqpzhrCl/3C029HvLd89P+HisOAypYGR133xQe1G7khRTe7QWT16MBV75jxQdzP FKdkRT52u5bm+ojOEm3Owpci3eKB2Zjx6oxW/d1FFZlrkM9uBCkCyDgiK+anSlmOp1YH z2S9hyiMjr+5Igxb046zss1hMFoCKdh8+yyklSPfsuqD1F74QcOL/yQ5c3A6M+OZIwPc 49QA== X-Gm-Message-State: AOAM531+Sa+UT9xJsuCSnH9ofEjgE3u6IXQE5vdH0BZryGsN2tUm3mST muEZqdL9+uFMo0e4TavJpJNXcAIlGOUoYoRT6hM9uQ== X-Received: by 2002:a19:8c19:: with SMTP id o25mr757160lfd.547.1615586713934; Fri, 12 Mar 2021 14:05:13 -0800 (PST) MIME-Version: 1.0 References: <20210312192139.2503087-1-ndesaulniers@google.com> <20210312202537.z77v4qnvptbrug2f@google.com> In-Reply-To: <20210312202537.z77v4qnvptbrug2f@google.com> From: Nick Desaulniers Date: Fri, 12 Mar 2021 14:05:02 -0800 Message-ID: Subject: Re: [PATCH] gcov: fix clang-11+ support To: Fangrui Song Cc: Peter Oberparleiter , Andrew Morton , Prasad Sodagudi , Nathan Chancellor , LKML , clang-built-linux Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Mar 12, 2021 at 12:25 PM 'Fangrui Song' via Clang Built Linux wrote: > > function_name can be unconditionally deleted. It is not used by llvm-cov > gcov. You'll need to delete a few assignments to gcov_info_free but you > can then unify the gcov_fn_info_dup and gcov_info_free implementations. > > LG. On big-endian systems, clang < 11 emitted .gcno/.gcda files do not > work with llvm-cov gcov < 11. To fix it and make .gcno/.gcda work with > gcc gcov I chose to break compatibility (and make all the breaking > changes like deleting some CC1 options) in a short window. At that time > I was not aware that there is the kernel implementation. Later on I was > CCed on a few https://github.com/ClangBuiltLinux/linux/ gcov issues but > I forgot to mention the interface change. These are all good suggestions. Since in v2 I'll drop support for clang < 11, I will skip additional patches to disable GCOV when using older clang for BE, and the function_name cleanup. > Now in clang 11 onward, clang --coverage defaults to the gcov 4.8 > compatible format. You can specify the CC1 option (internal option, > subject to change) -coverage-version to make it compatible with other > versions' gcov. > > -Xclang -coverage-version='407*' => 4.7 > -Xclang -coverage-version='704*' => 7.4 > -Xclang -coverage-version='B02*' => 10.2 (('B'-'A')*10 = 10) How come LLVM doesn't default to 10.2 format, if it can optionally produce it? We might be able to reuse more code in the kernel between the two impelementations, though I expect the symbols the runtime is expected to provide will still differ. Seeing the `B` in `B02*` is also curious. Thanks for the review, will include your tag in v2. -- Thanks, ~Nick Desaulniers