From nobody Sat Feb 7 18:20:42 2026 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4C74774435; Tue, 9 Apr 2024 08:48:07 +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=1712652488; cv=none; b=MsE/y/e3YdikkVtZVxI6uSyur9QwDek5J2J6ufGGj0baGgCwZcnRo1QgDbxbdlmDPwF6U53MM8VfMX8BiBEQgjq98DDH8ABKmlSu57uza+3rn+EpzwOKNA7INhH6TzRLexEcFI3sHC1mO9k5p0hcbuIg9n09yerqHmCJSzDa3N4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712652488; c=relaxed/simple; bh=KeD4xL0gB/xCATWdOFUs5Nts/UM0E+U+CU8Lg6aBHO0=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=XA4EqhDq4GpncarOErcvPdHjRyMx4kSb349Gg/C4CWSccDrK117GCeVXVqBRPcDNCTut6lGypY0G0wCmyVOceyts31qfeOr8X/Qcm8+EtHV+CEO2RDOO4Dbi8OGqhKboThIRxqFkpZ/pIAi06eUvYiaj2RfecEiJezfoNCyE3Ow= 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 186B51007; Tue, 9 Apr 2024 01:48:37 -0700 (PDT) Received: from e127643.broadband (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 910253F6C4; Tue, 9 Apr 2024 01:48:04 -0700 (PDT) From: James Clark To: linux-perf-users@vger.kernel.org, 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" , Athira Rajeev , Leo Yan , linux-kernel@vger.kernel.org Subject: [PATCH 1/3] perf tests: Apply attributes to all events in object code reading test Date: Tue, 9 Apr 2024 09:47:37 +0100 Message-Id: <20240409084741.405433-2-james.clark@arm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240409084741.405433-1-james.clark@arm.com> References: <20240409084741.405433-1-james.clark@arm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" PERF_PMU_CAP_EXTENDED_HW_TYPE results in multiple events being opened on heterogeneous systems. Currently this test only sets its required attributes on the first event. Not disabling enable_on_exec on the other events causes the test to fail because the forked objdump processes are sampled. No tracking event is opened so Perf only knows about its own mappings causing the objdump samples to give the following error: $ perf test -vvv "object code reading" Reading object code for memory address: 0xffff9aaa55ec thread__find_map failed ---- end(-1) ---- 24: Object code reading : FAILED! Fixes: 251aa040244a ("perf parse-events: Wildcard most "numeric" events") Signed-off-by: James Clark --- tools/perf/tests/code-reading.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tools/perf/tests/code-reading.c b/tools/perf/tests/code-readin= g.c index 7a3a7bbbec71..29d2f3ee4e10 100644 --- a/tools/perf/tests/code-reading.c +++ b/tools/perf/tests/code-reading.c @@ -637,11 +637,11 @@ static int do_test_code_reading(bool try_kcore) =20 evlist__config(evlist, &opts, NULL); =20 - evsel =3D evlist__first(evlist); - - evsel->core.attr.comm =3D 1; - evsel->core.attr.disabled =3D 1; - evsel->core.attr.enable_on_exec =3D 0; + evlist__for_each_entry(evlist, evsel) { + evsel->core.attr.comm =3D 1; + evsel->core.attr.disabled =3D 1; + evsel->core.attr.enable_on_exec =3D 0; + } =20 ret =3D evlist__open(evlist); if (ret < 0) { --=20 2.34.1 From nobody Sat Feb 7 18:20:42 2026 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D38DD7E77B; Tue, 9 Apr 2024 08:48:11 +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=1712652493; cv=none; b=VCNLKQY+dmAMj6P3g9auLbsVZxIr4eHBaKNthInmrjeEG4lUrEVV0TkJarRliETL47x2dwsqsIZst9gTCOxIUhBUKkFYbVPlkDD//CPjFkWzICsI0HbT131dMN7lsm5yL5942oMhkv7cL717qq4VG7uhI8iK7KpK80WYw9xHM6M= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712652493; c=relaxed/simple; bh=ypMirJBQln4cahP5+iyf5ns4VS6WkKkpnbUKpCIXRMM=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=MOQilDrE4205mzrevI5M6Nv/7ll5FtTW76F2UXbn9eWIjm8X/tyF2ybQc5ASDLevKs+M1c46Oxz+3+uYD3rHcCVGw4sl9rvWHgFYm0K0UPiXsOclC+IEO/hLk+e/2SNN4fzHiMpYIc99+NX+jd93SO9NseQFHU/Z7IMGSCK7upY= 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 9DD8D12FC; Tue, 9 Apr 2024 01:48:41 -0700 (PDT) Received: from e127643.broadband (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 2201C3F6C4; Tue, 9 Apr 2024 01:48:09 -0700 (PDT) From: James Clark To: linux-perf-users@vger.kernel.org, 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" , Athira Rajeev , Leo Yan , linux-kernel@vger.kernel.org Subject: [PATCH 2/3] perf map: Remove kernel map before updating start and end addresses Date: Tue, 9 Apr 2024 09:47:38 +0100 Message-Id: <20240409084741.405433-3-james.clark@arm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240409084741.405433-1-james.clark@arm.com> References: <20240409084741.405433-1-james.clark@arm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" In a debug build there is validation that mmap lists are sorted when taking a lock. In machine__update_kernel_mmap() the start and end addresses are updated resulting in an unsorted list before the map is removed from the list. When the map is removed, the lock is taken which triggers the validation and the failure: $ perf test "object code reading" --- start --- perf: util/maps.c:88: check_invariants: Assertion `map__start(prev) <=3D = map__start(map)' failed. Aborted Fix it by updating the addresses after removal, but before insertion. The bug depends on the ordering and type of debug info on the system and doesn't reproduce everywhere. Fixes: 659ad3492b91 ("perf maps: Switch from rbtree to lazily sorted array = for addresses") Signed-off-by: James Clark --- 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 5eb9044bc223..a26c8bea58d0 100644 --- a/tools/perf/util/machine.c +++ b/tools/perf/util/machine.c @@ -1549,8 +1549,8 @@ static int machine__update_kernel_mmap(struct machine= *machine, updated =3D map__get(orig); =20 machine->vmlinux_map =3D updated; - machine__set_kernel_mmap(machine, start, end); maps__remove(machine__kernel_maps(machine), orig); + machine__set_kernel_mmap(machine, start, end); err =3D maps__insert(machine__kernel_maps(machine), updated); map__put(orig); =20 --=20 2.34.1 From nobody Sat Feb 7 18:20:42 2026 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 300ED75804; Tue, 9 Apr 2024 08:48:16 +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=1712652497; cv=none; b=ThkyIEkwvml+FiHeumPYWGUXObxBXnSfFQULK+XggsGSMybTPlvDfwuDL2DoaP9qp604enzvPhKe7ttiUM5vXVg4OuZCF6qYPEvgjeT7xntcXWyS3BXMNadls59l5y6ETyPyNWidM5JCrl0r+vztJ2nY/7qGaCHOpHFE34m1FLk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712652497; c=relaxed/simple; bh=BXP5md7/hHHu4h4OFAZPG2kfyxAEBHiOCPm1niu89T8=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=Ag3GAw3aqBNr6LWchYLOOskdPgFtlMAXEw44LdU3IR9BDNbTmoENc699OJOH5/xMJnmyWqGUtDI8/emZMoa/eYMQc/Q8N+yh1qSgQlIKTXNq7oichVHLYJWVSpQXiBVAo8EWRvPJBli1XMgGoIjbH8l4DXsPa8QwzaGFe/AeDWY= 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 3BE44DA7; Tue, 9 Apr 2024 01:48:46 -0700 (PDT) Received: from e127643.broadband (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id AB3753F6C4; Tue, 9 Apr 2024 01:48:13 -0700 (PDT) From: James Clark To: linux-perf-users@vger.kernel.org, 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" , Athira Rajeev , Leo Yan , linux-kernel@vger.kernel.org Subject: [PATCH 3/3] perf tests: Skip "test data symbol" on Neoverse N1 Date: Tue, 9 Apr 2024 09:47:39 +0100 Message-Id: <20240409084741.405433-4-james.clark@arm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240409084741.405433-1-james.clark@arm.com> References: <20240409084741.405433-1-james.clark@arm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" To prevent anyone from seeing a test failure appear as a regression and thinking that it was caused by their code change, just skip the test on N1. It can be caused by any unrelated change that shifts the loop into an unfortunate position in the Perf binary which is almost impossible to debug as the root cause of the test failure. Ultimately it's caused by the referenced errata. Fixes: 60abedb8aa90 ("perf test: Introduce script for data symbol testing") Signed-off-by: James Clark --- tools/perf/tests/shell/test_data_symbol.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tools/perf/tests/shell/test_data_symbol.sh b/tools/perf/tests/= shell/test_data_symbol.sh index 3dfa91832aa8..ffc641d00aa4 100755 --- a/tools/perf/tests/shell/test_data_symbol.sh +++ b/tools/perf/tests/shell/test_data_symbol.sh @@ -16,6 +16,12 @@ skip_if_no_mem_event() { return 2 } =20 +# Skip on Arm N1 due to errata 1694299. Bias exists in SPE sampling +# which can cause the load and store instructions to be skipped +# entirely. This comes and goes randomly depending on the offset the +# linker places the datasym loop at in the Perf binary. +lscpu | grep -q "Neoverse-N1" && exit 2 + skip_if_no_mem_event || exit 2 =20 skip_test_missing_symbol buf1 --=20 2.34.1