Received: by 2002:ab2:6816:0:b0:1f9:5764:f03e with SMTP id t22csp2338833lqo; Mon, 20 May 2024 02:42:23 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVng7fVowBG7XqQHUtMIoz8SX4pwdfie8viEYwvcfVsldzTgMdNQZi2PGXp+udWSR5RE95W+8CyFGAaZbjz1gTB5nqAAEQetjcNOT/FRA== X-Google-Smtp-Source: AGHT+IH26pPS0/LzMengBjwIyGXQ406RWJivM8+9a6CDd+nE4tZQKlSBa4BRdu0DKZh0TB/Hv6/u X-Received: by 2002:a05:6358:339f:b0:192:9c43:86de with SMTP id e5c5f4694b2df-193bb3f8c6dmr2230914455d.4.1716198143488; Mon, 20 May 2024 02:42:23 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716198143; cv=pass; d=google.com; s=arc-20160816; b=AGGgEX3pjiwJ/Z6A6LiK3XLZuZSiKMD+voz13bbmIb1gQCHLJUN0nLOflXAqbG6BEB riM0l+UdXMmr9D7yePsD7TuC1PeO0/rp7TFtwz+YANEz+TLVcfpUPzzAm0yQrYojY/q7 VH1xQ3DEr+4/nrskS6eM2Z+MUl/GMC10Cij0kzYWNWfTSLkQS9t2TQ1bvgvqaL/KPjjI BHdIvhASwO5IcKoYcGKedcyAEZ1GFKIlYipJ7GN2R9HdpvzomDtac8Macvi2KjTJvlXm iRJuNISmTje3DTrsDR7MYA/U2ckDENaCrpWVSSdysTuPRovg9HAiyVRyPkajn0gbTH/u usuQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id; bh=x3rKB8d3ZznDB/C6vjnh012PUaOwOZ6TyaMnK3pTW+8=; fh=WzFxTBCdNdWRay5HeIH34P+FknCXYVvwx5KE1Q9WU+g=; b=FDUkSEzBQgwvqc2HW4h/xK26QKaCLRYj3Daejza+/U8m1LqHAbEVFnECFTOeEjFtd8 pCZLEB+ZJy+yJiw8Ejv/uZnp6FM6gJ4ZY85WQh/ZQ0lwEqxSvwxGK4qQJooqj1L4AiQw E9t1ipq4Odcc7En6lo1YhLIDfN5tRRWjt8LAoQG/1BUeUwrNUgN/uAwsyTPYM0W4wKhF R5dUkorMDn5XtnLtBzcxdcbn6waUesAJc8LNRpDQwqFoqliV13J/1G6+xxHpvjoi6t15 M9l3s1P5tnzAA/qAM41Q20u6wVQn7FTmG90MsqrKCi5ahktKDCTldrPDC1t35+aJsTXY YEpg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-183556-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-183556-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id 41be03b00d2f7-63412a4dec0si1996805a12.756.2024.05.20.02.42.23 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 May 2024 02:42:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-183556-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-183556-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-183556-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 7F8962819F9 for ; Mon, 20 May 2024 09:42:17 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 184DC2261D; Mon, 20 May 2024 09:42:07 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CF3E62D7A8; Mon, 20 May 2024 09:42:04 +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=1716198126; cv=none; b=t8cFF+A3e+RW/jisv0ZX97tTIGryudsQs2yDo3kIC9xn4OUZR8FeaHv95q/uZNY6/3KWGX16MVprvtgl3qlt7G6E/MEp/cmLnTil8q8suMtODH2KQE01GonmcgXGA3g1FpXBxhjoQYjO6G9ijvk2dcCQEzK44Nbg2bd3QmL6hcE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716198126; c=relaxed/simple; bh=tqJq6X3A7QqdtDBvorzQ9Ec8VgEK4mqpyfp7HfySsTg=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=Slu7cc/jLGPzrx0se1BifF9vxoegxyEwi5GyeloefYI3SVnlooqjwg1hqwAIrYLJmZb+YcLxOjUTOKcgX0gJP13yzDl7Znrm3/i0U9evEnHIz2VrmRN3/9rewk+WobXyXSKUkFwhQHPJDgqJdj8ww1i0b+xul6ToKiiXNH2+sFk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=foss.arm.com; spf=none smtp.mailfrom=foss.arm.com; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=foss.arm.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=foss.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 39B06FEC; Mon, 20 May 2024 02:42:28 -0700 (PDT) Received: from [10.2.76.71] (e132581.arm.com [10.2.76.71]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id AFB703F766; Mon, 20 May 2024 02:42:02 -0700 (PDT) Message-ID: <6c910206-2409-4a7e-9d5e-8ffc1c269c08@foss.arm.com> Date: Mon, 20 May 2024 10:42:01 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 0/2] perf maps: Improve the kcore maps merging To: Ian Rogers Cc: Arnaldo Carvalho de Melo , Adrian Hunter , James Clark , Peter Zijlstra , Ingo Molnar , Namhyung Kim , Mark Rutland , Alexander Shishkin , Jiri Olsa , Athira Rajeev , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org References: <20240515211045.377080-1-leo.yan@arm.com> Content-Language: en-US From: Leo Yan In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 5/15/24 22:39, Ian Rogers wrote: [...] > Thanks Leo, testing this change on perf-tools-next with an x86 debian > laptop I see: > ``` > $ perf test 24 -v > 24: Object code reading: > --- start --- > test child forked, pid 3407499 > Looking at the vmlinux_path (8 entries long) > symsrc__init: build id mismatch for vmlinux. > symsrc__init: cannot get elf header. > overlapping maps in [kernel.kallsyms] (disable tui for more info) > Using /proc/kcore for kernel data > Using /proc/kallsyms for symbols > Parsing event 'cycles' > Using CPUID GenuineIntel-6-8D-1 > mmap size 528384B > Reading object code for memory address: 0xfffffffface8d64a > File is: /proc/kcore > On file address is: 0xfffffffface8d64a > dso__data_read_offset failed > ---- end(-1) ---- > 24: Object code reading : FAILED! > ``` > The test passes without the changes. Let me know if you need me to dig deeper. Just update for the test failure. The failure is caused by the memory map's attribute is not updated after I removed the map replacement related code in patch 02. This means the old (identical) kernel map (generated by '/proc/kallsyms') still keeps some stale info for 'pgoff', 'mapping_type', etc. To fix this issue, in the new patch, it removes the old kernel map (to avoid any stale info) and update 'machine->vmlinux_map'. Just one concern. I saw the kcore exposes kernel text section which is dependent on the CONFIG_ARCH_PROC_KCORE_TEXT config, but some arches (e.g. PowerPC, etc) are absent for this config. But you can see even the current code doesn't handle this case, if the replacement map is not found, it is arbitrarily assigned to the first map in kcore [1]. An option is to rollback to use the old identical kernel map, this is not addressed in my latest patch, which is simply report failure in this case. Please review it and let me know how you think. Thanks, Leo [1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/tools/perf/util/symbol.c?h=v6.9#n1366