Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp1334109pxf; Fri, 26 Mar 2021 06:08:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx8FcDJMNasIh3pOMQ+6XGheQ4VZ18zJ6Ab9KTJfwn9zosZPkTF6afAchltkTl6kmbE/dUe X-Received: by 2002:aa7:da97:: with SMTP id q23mr14682040eds.180.1616764138353; Fri, 26 Mar 2021 06:08:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616764138; cv=none; d=google.com; s=arc-20160816; b=HN7i2UyrDq1MXMOYYyfxczSBZHIXh5SCTsXJCquDX6kxYjMozZroPagNTurKpSOAMn YgWMGQElUbRFhiTcTxCZXDo3nncbH9tcGjgUDAAb/QOZYnhVc5dluOm5UF8urMhEFE0W Bwy6tC7RwSJIwykGfgNcLdr74+xm/UaoB5S+w2x0IG4pVqbAKWrneKW1qb9W4+HW49Am XzkiGppBaE9JzNCD6LN4cReeF8b/fmSLPd2NiZOf25pq8dj4RY2U5Ywa2bypKe4tbOUI p92rlebKtBzqLIRlTh+szpPt94ufq0qGFUQ7id0C/jeaY3YArVd4moMQYBBg5zPX9qzL Av6g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=qOJwX1VzcdbENmpGaf+vT43tcuzvgpykl/gzTwQdwJM=; b=zK7dwXh9FexwdgiO5HrZSuUhyWXqo/AbF6aIoMET7pIOerUmNzxieu055TRfjTHNz+ jKBTEbFJIeJcSoTAms1bL3tAadko5hYHbsXdudQxbs26vwnr6Q/28oKNDYlF92WxIciO XLVCsKknv+JBLBRV8YEFatJhmuVFUBteh7oedjFhR2EWOdn4jT6TyduuWE9dHCoYNH/J N2Yj0iZ/ocuBL55/zMRDZTiY5RYNFgnx5F67I2iRTcJv3oBmUwY9uXxG9tVursJN82YV YugRZbdaB6SVPBUDUA1y3Ihgt1D1IHYdJK1sRbQ/RQlrri81AlaHgIv5IPQGlQ2YxJxd TpUg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="a2/avi/D"; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f14si6569563edd.140.2021.03.26.06.08.34; Fri, 26 Mar 2021 06:08:58 -0700 (PDT) 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=@kernel.org header.s=k20201202 header.b="a2/avi/D"; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230070AbhCZNHg (ORCPT + 99 others); Fri, 26 Mar 2021 09:07:36 -0400 Received: from mail.kernel.org ([198.145.29.99]:60478 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229758AbhCZNHG (ORCPT ); Fri, 26 Mar 2021 09:07:06 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 5D771619FE; Fri, 26 Mar 2021 13:07:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1616764025; bh=x/GK+JD94YsfoYZeLWzsM1EmTyqcxHwM2Vqefncnveg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=a2/avi/Dh7YzODTB0l8GLVG6HWTEO6Td7nimdFSaE8m2IP4Ww7V1d9XRlcZ+5srHU SSoFTb2WWt6KcygqmfmLm6M0dATs/gg5rTnRWBEcd+FOlegCq4ZcIJ20I3Qt+EUCVz +vrJwVPPFjY3al3MqmtVk5M775jZ3vmOJgeeJgtilzBGNhD6LjAKuTLP5vxhsmH9tS odXnB4EFjgTiKzmU2lM4+lhu7T4J3ggqPCeOJR5716JhyMVWNJY/POQV/Mfhn9zCkU rSBSPj9wTF2uNhp9YmAorCP66xMgPflfBKmp3RGWuxa0zUpXR2OGu544Trl/MghCl9 oLUmbJkBNvL0g== Date: Fri, 26 Mar 2021 06:07:02 -0700 From: Nathan Chancellor To: Sedat Dilek Cc: Palmer Dabbelt , Paul Walmsley , Albert Ou , linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, Clang-Built-Linux ML Subject: Re: [PATCH 0/3] Fix CONFIG_FUNCTION_TRACER with clang Message-ID: <20210326130702.3yaz2vqwejnfnlq4@MSI.localdomain> References: <20210325223807.2423265-1-nathan@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Mar 26, 2021 at 09:37:55AM +0100, Sedat Dilek wrote: > On Thu, Mar 25, 2021 at 11:38 PM Nathan Chancellor wrote: > > > > Hi all, > > > > This series fixes function tracing with clang. > > > > Patch 1 adjusts the mcount regex in scripts/recordmcount.pl to handle > > the presence of PLT relocations, which happen with clang. Without this, > > the mcount_loc section will not be created properly. > > > > Patch 2 adds a workaround for clang less than 13.0.0 in relation to the > > mcount symbol name, which was "mcount" rather than "_mcount". This was > > written as a separate patch so that it can be reverted when the minimum > > clang version is bumped to clang 13.0.0. > > > > Patch 3 avoids a build error when -fpatchable-function-entry is not > > available, which is the case with clang less than 13.0.0. This will make > > dynamic ftrace unavailable but all of the other function tracing should > > work due to the prescence of the previous patch. > > > > I am hoping this series can go in as fixes for 5.12, due to patch 3, but > > if not, they can always be backported (patches 1 and 2 are already > > marked for stable). > > > > This series has been build tested with gcc-8 through gcc-10 and clang-11 > > through clang-13 with defconfig and nommu_virt_defconfig plus > > CONFIG_FTRACE=y and CONFIG_FUNCTION_TRACER=y then boot tested under > > QEMU. > > > > Cheers, > > Nathan > > > > Nathan Chancellor (3): > > scripts/recordmcount.pl: Fix RISC-V regex for clang > > riscv: Workaround mcount name prior to clang-13 > > riscv: Select HAVE_DYNAMIC_FTRACE when -fpatchable-function-entry is > > available > > > > Does this only fixes stuff for clang + riscv? Yes. > If so, please put a label "riscv" also in the cover-letter. Sure, my apologies for not doing that in the first place, I must have been in a rush with the cover letter. In my defense, I think the titles of my commit messages and the diffstat below make that obvious without the tag :) Cheers, Nathan > - Sedat - > > > arch/riscv/Kconfig | 2 +- > > arch/riscv/include/asm/ftrace.h | 14 ++++++++++++-- > > arch/riscv/kernel/mcount.S | 10 +++++----- > > scripts/recordmcount.pl | 2 +- > > 4 files changed, 19 insertions(+), 9 deletions(-) > > > > -- > > 2.31.0 > >