From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BC1295733E for ; Sat, 23 May 2026 00:00:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779494419; cv=none; b=rcEDywahFEa1jbdrBKHP8/5rhnvCiBP/8aQILNanG95T5ON702jaZvc389PvbCtEX91SzNMonlDgdqlGE4nGsDX+UgWfKaK8tWLlKg6yXaL2nN4yeJXyGLztpIGusqEZpoOnirkecTf2RWL8MkYhcYIokEQpvNXkFyYEt/TO1Lg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779494419; c=relaxed/simple; bh=29LsxXCMy0+ax/w7A19xyW9G9hs9hvK4lv002H9kQMA=; h=Date:From:To:cc:Subject:In-Reply-To:Message-ID:References: MIME-Version:Content-Type; b=YNFHbHrXZNxyn4tkVzUoRgi3LFjFrZdSpY5BBlySvO5mmPnISJGF2MNKb+DDEAab0U5qT5PYkLqw8hnhhepZXcXg2A2GmvSiZqCDn3Arbw+rCs0tUb9yx9qD+DKCTE/lcwwP7RboKo5BdtrizPf1Jm1VfmKE1u1jlyyPSccW4OU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=HN5xSAkK; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="HN5xSAkK" Received: by smtp.kernel.org (Postfix) with ESMTPSA id A8E4A1F000E9; Sat, 23 May 2026 00:00:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1779494418; bh=E/NlWRMeE1Ore4wNHzrhkZQEWRS8TgfjqDTs24hzdNE=; h=Date:From:To:cc:Subject:In-Reply-To:References; b=HN5xSAkKk3DvU2dRt/R41Xo/c/jnIJs9v5e1oZ1O7KCH/zWcLeaLgRwnSLf+PkQmK Bov9XGOsZErvn2yD0qA2SY7nq5Kkgya8qM5xw5cDibv+m5/SL2w3uHi8KOqqZVIFMo gTu7KUxOLVubus/d7xHZZP78xdFXWht8ZMfNF/kWMjSvNcDcaesJj0b3P4TGU4fmXw gUXA+7lMv/UTF5Ik+9dncUD6+c1VABmzxsQjMZy9BXmZmOAjiO7SN3Dc1zItYuMFEh 3mgHWIo2bpPrLD0O3mb/q6qwm+SdHz113QBeGNZoN/FFU8m0zlVmqhfS2a4kYZ+8pH SS6+yJDJ4sLGQ== Date: Fri, 22 May 2026 18:00:16 -0600 (MDT) From: Paul Walmsley To: Chen Pei cc: pjw@kernel.org, alex@ghiti.fr, andybnac@gmail.com, guoren@kernel.org, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] riscv: ftrace: select HAVE_BUILDTIME_MCOUNT_SORT In-Reply-To: <20260409114736.907-1-cp0613@linux.alibaba.com> Message-ID: References: <20260409114736.907-1-cp0613@linux.alibaba.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII On Thu, 9 Apr 2026, cp0613@linux.alibaba.com wrote: > From: Chen Pei > > RISC-V already satisfies all prerequisites for build-time mcount sorting: > the sorttable host tool handles EM_RISCV in its machine-type dispatch, and > the __mcount_loc section entries are stored as direct virtual addresses in > the final vmlinux binary, so no relocation processing is required during > the sort step. > > Select HAVE_BUILDTIME_MCOUNT_SORT so that BUILDTIME_MCOUNT_SORT is > automatically enabled when DYNAMIC_FTRACE is configured. This allows > sorttable to sort the __mcount_loc section at link time, making the > run-time ftrace initialisation path skip the software sort and reducing > kernel startup overhead. > > Verified with CONFIG_FTRACE_SORT_STARTUP_TEST=y, which confirms that > the section produced by the build is already in ascending order: > > [ 0.000000] ftrace section at ffffffff81015a60 sorted properly > > Signed-off-by: Chen Pei Thanks, queued for v7.2. - Paul