From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 82E94C02198 for ; Wed, 5 Feb 2025 14:43:17 +0000 (UTC) Received: from boromir.ozlabs.org (localhost [127.0.0.1]) by lists.ozlabs.org (Postfix) with ESMTP id 4Yp2z80vGnz3024; Thu, 6 Feb 2025 01:43:16 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; arc=none smtp.remote-ip="2604:1380:45d1:ec00::3" ARC-Seal: i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707; t=1738766596; cv=none; b=SVFWFP14B/rMEW+4Ih6FjqJ9/E84Vug+RCmPF6PS2tU8oeQJb3+I+kKrIzxChOV2BKG+/5dnB6CWziTdfoUAXnWM3Ff5WiZKwh8TApa4aGXW+vl1kHJsaKufADc9DP4kG95HgQWUVkbvydiUlEuGWCkjS9TxfTYaUbnpOs51rJ+B74NRftelypa99biDNDtDqPyJUUZ9hplnVimvrZatf5fekJXHCRTPchyeLMNup4iJFf5CT6zFLPr9qwN3zc5hRnZfVf07uEaw/yzZ65Grrc8Ck9lZ7dKjdEHMai8trPKe7HZobLcetqwM39AIq4bfxp/JjcmmKaAgZ1BlZ5eVgQ== ARC-Message-Signature: i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707; t=1738766596; c=relaxed/relaxed; bh=o6FgTgzVzjsU+nZpD0dCrFMSbf5nat144nCqE/EpsMM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=JybyxHFt1qVZXRh/q+ht5xzIU64s7Jh4TYVbq2+BXJAnzoUjurUZ3LXmnqHrSXsvBjN33EzUdqJvbEOKBPrQCX6SNpzR27uPkDeCvbYfq9DaZnLYmf956NDQkk3UCXRQUKIDTWvKH748Qa2FbO9Wn+BYZczQBLjVOYl6/IuUf7RHoggOXgwy2aOPjoRfnup5XlVHV559QKhbQep8/82XMV0s1b/toVFPdfiXgSzBXvOc9B7aaASFBJxughL11vIdGEVUnLWF/rM5X2lizUuoDTmFicoUHh2wJFxyPyc0KFs2GaDIuG/zxHFHFY/yGBRyVvQbabujLQJ68KADdMQNCQ== ARC-Authentication-Results: i=1; lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=linuxfoundation.org; dkim=pass (1024-bit key; unprotected) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=OSIg056H; dkim-atps=neutral; spf=pass (client-ip=2604:1380:45d1:ec00::3; helo=nyc.source.kernel.org; envelope-from=gregkh@linuxfoundation.org; receiver=lists.ozlabs.org) smtp.mailfrom=linuxfoundation.org Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=linuxfoundation.org Authentication-Results: lists.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=OSIg056H; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=linuxfoundation.org (client-ip=2604:1380:45d1:ec00::3; helo=nyc.source.kernel.org; envelope-from=gregkh@linuxfoundation.org; receiver=lists.ozlabs.org) Received: from nyc.source.kernel.org (nyc.source.kernel.org [IPv6:2604:1380:45d1:ec00::3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4Yp2z70DzKz301x for ; Thu, 6 Feb 2025 01:43:14 +1100 (AEDT) Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by nyc.source.kernel.org (Postfix) with ESMTP id 74F79A436BA; Wed, 5 Feb 2025 14:41:25 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 48B23C4CEEF; Wed, 5 Feb 2025 14:43:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1738766591; bh=mnXQQWavRensmn9TEjcYkUnd9AYGJH4sUgVhZHhUb3g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OSIg056HaWBdXVP/sYWd1Bz+vSRaa0ij/CpWrN8k9HOIxXjuE2oVGkPvdAPOntktj mszTW6Frgezk1xCKoDsk0jFhB9EEa+8ONMtjPcCHew/t/vm0Gy9VpgBcujO9D6Iq08 h5+HBIKk8ymBLoBjFbye86PbX6RkQnynOZG+0CfQ= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Christophe Leroy , Adrian Hunter , Alexander Shishkin , Ian Rogers , Ingo Molnar , Jiri Olsa , Kan Liang , linuxppc-dev@lists.ozlabs.org, Mark Rutland , Namhyung Kim , Peter Zijlstra , Song Liu , Arnaldo Carvalho de Melo , Sasha Levin Subject: [PATCH 6.13 290/623] perf machine: Dont ignore _etext when not a text symbol Date: Wed, 5 Feb 2025 14:40:32 +0100 Message-ID: <20250205134507.325880677@linuxfoundation.org> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250205134456.221272033@linuxfoundation.org> References: <20250205134456.221272033@linuxfoundation.org> User-Agent: quilt/0.68 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: linuxppc-dev@lists.ozlabs.org List-Id: List-Help: List-Owner: List-Post: List-Archive: , List-Subscribe: , , List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.13-stable review patch. If anyone has any objections, please let me know. ------------------ From: Christophe Leroy [ Upstream commit 7a93786c306296f15e728b1dbd949a319e4e3d19 ] Depending on how vmlinux.lds is written, _etext might be the very first data symbol instead of the very last text symbol. Don't require it to be a text symbol, accept any symbol type. Comitter notes: See the first Link for further discussion, but it all boils down to this: --- # grep -e _stext -e _etext -e _edata /proc/kallsyms c0000000 T _stext c08b8000 D _etext So there is no _edata and _etext is not text $ ppc-linux-objdump -x vmlinux | grep -e _stext -e _etext -e _edata c0000000 g .head.text 00000000 _stext c08b8000 g .rodata 00000000 _etext c1378000 g .sbss 00000000 _edata --- Fixes: ed9adb2035b5be58 ("perf machine: Read also the end of the kernel") Signed-off-by: Christophe Leroy Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Ian Rogers Cc: Ingo Molnar Cc: Jiri Olsa Cc: Kan Liang Cc: linuxppc-dev@lists.ozlabs.org Cc: Mark Rutland Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Song Liu Link: https://lore.kernel.org/r/b3ee1994d95257cb7f2de037c5030ba7d1bed404.1736327613.git.christophe.leroy@csgroup.eu Signed-off-by: Arnaldo Carvalho de Melo Signed-off-by: Sasha Levin --- tools/perf/util/machine.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/perf/util/machine.c b/tools/perf/util/machine.c index 27d5345d2b307..9be2f4479f525 100644 --- a/tools/perf/util/machine.c +++ b/tools/perf/util/machine.c @@ -1003,7 +1003,7 @@ static int machine__get_running_kernel_start(struct machine *machine, err = kallsyms__get_symbol_start(filename, "_edata", &addr); if (err) - err = kallsyms__get_function_start(filename, "_etext", &addr); + err = kallsyms__get_symbol_start(filename, "_etext", &addr); if (!err) *end = addr; -- 2.39.5