Received: by 2002:a89:288:0:b0:1f7:eeee:6653 with SMTP id j8csp552032lqh; Tue, 7 May 2024 07:16:37 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXqiVrfy1SDOW1xfYiUw1RheyBq/JDSD3hZ5YM00T2vEuUrI0xZBnbYTcPZ5LJ6hSxK2ph3dqoJHxopZOulqO1RanvEZr9YgcLeYGcL+w== X-Google-Smtp-Source: AGHT+IFvDoFjtCPe1e3pYhWPUlPBeq/R5nMVnj8FMoQajpxb4Qoy4ElafwNqcexKL9WlmbJzbots X-Received: by 2002:a2e:9b0e:0:b0:2d8:d972:67e3 with SMTP id u14-20020a2e9b0e000000b002d8d97267e3mr10478951lji.5.1715091396612; Tue, 07 May 2024 07:16:36 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715091396; cv=pass; d=google.com; s=arc-20160816; b=WkKmUrDa9qHsOUpMsX/bZGHzUDz21SU0pOpcBwsW64zcgCNbyj7+LT1qFR7sSXsT4g MHoUVyy6rC7Xe/qegBcIy00dZVVECNSfFHnNH33S/QLcGrHr5dUUDWcu9ysok7xPcV8n 2F75R0i5ZZ8sOk2/J/hWjeKpCjynui2f1MbhG9wQ1+3/PDcl/SXnk6mSVyWkyoQ/Y3a6 Pa9X3UBEcagdSWFRHuTwrQu1AhLnNY/CKNDaM5HQcd3JGIjpe90X1+sCSg7Z/6usnQb7 xHvaDZiiiTUZysbogBHatIU4RIXKk1rM5XKlWRQWtznh77geylx4MXChF0BFh8crRcBV eEvQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from; bh=yMIznydUue5bjPoYDU79I+8B+QoZTMOO00JgErgHdOw=; fh=z3/YlGhmWVGbDDVRrPyvN7QnpotMsOuIPt85/Od1vi8=; b=ZuUWXpMyed6LGqrhyHLZf/LGZd82OwTzKHsYQWSF6gNkniQ6Ye8oqPF67MMaxXMFIt i9jVu2wdGELsX/fdXt0XTFcSINdjYOgR7MdfBbpKck2f4NL1gAFlZy/X2c8l7XKoE0i0 ySTjVzRjrHWhwTdlCt7HIbtizgBVhzBSBpY7KdjbfNcIB0V53Edsb2Bb78l6sx1plGmq nAsHp5pYBhJ4tyvK8LFnGpIKbngzJs3BLCZJ60uOFfgLZRjSSL8p+dno3LDuMkhq2xdq e9gZs9ZZ2kcxITI6BYmm3UlYS0bRtstXdx+lhGSgfGsrK+b3WiZciRqoVq25DAoCrXPK DZwA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-171533-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-171533-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id hr12-20020a1709073f8c00b00a59cd9280fdsi2266399ejc.943.2024.05.07.07.16.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 May 2024 07:16:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-171533-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-171533-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-171533-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 4A7111F2312D for ; Tue, 7 May 2024 14:16:36 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 77E7116D4F5; Tue, 7 May 2024 14:13:14 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0243816C44F; Tue, 7 May 2024 14:12:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715091192; cv=none; b=PRfJm8ARf2xNtI7CJRYqoyUyNAOJKMvYM2GogANFVN1fuaVQ1C3yke3d7V/U6xtRnqWXJ3NKHOiFimuAi7wm0d/YkAHQDTi0a2k/zvQusyEYL6F6FrRH7DTraZU+YaZkiwxPpAhaF7vyf0YY0PaWoKvooI8or1+Te9HX6vrSv4Q= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715091192; c=relaxed/simple; bh=S06NhcV6PkCL1/+nSbIG2xok/XosV/+ZGsC6A5MxA5M=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=TSmHUILM1cLh5bx2UGGrM0veuz1+KD3vXwW6FGRAlhsHgLA+Z+A8NEeBGLBBs+prLtMqQ4wfbtZvfpyFmuYNfx0f84mv3LAkycaeMSeTN7/FHxXd31EjeUIRhy92Pwg5nQajeuzlhKstiVRJRzTw/4uawHNxFMa/9V7vBsWRMbc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id A76AE1063; Tue, 7 May 2024 07:13:21 -0700 (PDT) Received: from e127643.broadband (usa-sjc-mx-foss1.foss.arm.com [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id BBB3B3F6A8; Tue, 7 May 2024 07:12:53 -0700 (PDT) From: James Clark To: linux-perf-users@vger.kernel.org, atrajeev@linux.vnet.ibm.com, irogers@google.com Cc: James Clark , Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Namhyung Kim , Mark Rutland , Alexander Shishkin , Jiri Olsa , Adrian Hunter , "Liang, Kan" , linux-kernel@vger.kernel.org Subject: [PATCH 0/4] perf maps/symbols: Various assert fixes Date: Tue, 7 May 2024 15:12:04 +0100 Message-Id: <20240507141210.195939-1-james.clark@arm.com> X-Mailer: git-send-email 2.34.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit A few different asserts are hit when running perf report on minimal Arm systems when kcore is used, or the .debug/ info can't be loaded or /boot isn't mounted etc. These result in some less common paths being hit for resolving symbols and things are done in an order that breaks some assumptions. I'm not sure if we could do something to make the tests pick this up, but maybe not easily if it would involve mocking the filesystem or even a specific kernel. I tried a few different variations of --kcore and --vmlinux arguments but ultimately I could only reproduce these issues by running on specific kernels and root filesystems. James Clark (4): perf symbols: Remove map from list before updating addresses perf maps: Re-use __maps__free_maps_by_name() perf symbols: Update kcore map before merging in remaining symbols perf symbols: Fix ownership of string in dso__load_vmlinux() tools/perf/util/maps.c | 14 ++++++------ tools/perf/util/symbol.c | 49 ++++++++++++++++++++++++---------------- 2 files changed, 36 insertions(+), 27 deletions(-) -- 2.34.1