From nobody Tue Feb 10 02:43:20 2026 Received: from mail-wr1-f43.google.com (mail-wr1-f43.google.com [209.85.221.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BFD1F3563F4 for ; Mon, 19 Jan 2026 10:09:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.43 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768817361; cv=none; b=t7M4eOFx6wJAGISr8eQYLW1uynYggva9qop2t7ZfSeUqseSTnm265RVReMW77gRe74s0zRCEC8Qs0F4yqgXgeq4XoT8/DTmGf58DkaLOQ/LVK9uNrEahZTtyXyObOx6MmV0K41FnKRtabWewimesWg1eYzRdkC0UGC6x3jJ0Pso= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768817361; c=relaxed/simple; bh=ABbYua5BR3/xyb8DnooUzvs5L17xzguh4+jQNRu1w1A=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=GCdLqX9sH9gXXdHN2Od0FxW8hIteUrTyKq9v+OrjZ3wyvxPw7sb95oiAwEdeND95YpuNN4levxSYOrZqapEcqJ1v1ODlmlD5/wFsjGmgfxxWhhDpGZeznAJTqhd9Y9bfcEdgwtlVfbw052DT0dVbyDMCLBRGnj1Jm2rEjBkd7No= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=ZTKQwywz; arc=none smtp.client-ip=209.85.221.43 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="ZTKQwywz" Received: by mail-wr1-f43.google.com with SMTP id ffacd0b85a97d-42fb2314f52so2178756f8f.0 for ; Mon, 19 Jan 2026 02:09:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1768817358; x=1769422158; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=rQboqiyM1bMVlCd/3rehrhWCEvcz3KFGOF/fcvtDHSE=; b=ZTKQwywz6zxuf1QnuB9xvP/hH/Kk8+zYtRY63AnmEXudZ5N7Gr770ssIZcOM8HsEHB Q0s63fqXbkOm8aP2va+2RCGwYbRM5Mx+IMkHTEEmaR4NxY2NbOPPRuor0/NLVqTN3H0Y GQTDVQrKvO4nRqTm/BU+CB0xBWdCZ3z2rNOPefoqwVLbr/zFpThjz42kxkTL2tAAvKUI 3nDUY5Mw0UO3wwwITfmhVy0RfvNYr368zer6SJPy/7LwTuFIkjHd/I7XDrw/47Wrn1Gp DvPEEgXpsl+C/D7mPCwTcAs7d43J6BvS3KldoCkCB3QHP3TcW8nllIsDVEVqkGXQaSDr 9tcw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1768817358; x=1769422158; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=rQboqiyM1bMVlCd/3rehrhWCEvcz3KFGOF/fcvtDHSE=; b=TebasyXTZ4lWx1TV92AuYbNmcTtRjAUOHPORSZ0p/aIQ+b/enJJhgi4DYz3CFS8Cal l4ugbYBhsbU1+ZjkCieTIP6CsWxplT8jRjmeSQrUR9aD1PlAgpr5cBw2WFGsyWi4xmvO kV9+BVEp0OQ1R7Kx+g77gsLoVspSGVGbR1Ey3U17BGvJVrDBGXqdItmd5HZwqCkUnqOh fpxUWRz4juIoM9LUfm708RvF+qlZdJvamiFwavWGfF6h9lFjZR6L5pz6d6msX6t+yWgz k0w5cAo5ay8NFSiODbqXUYIXKzagosAoGcVem+0HZ2JTL3q0rFPefVSuSjXVr4VnGGlp SZxQ== X-Forwarded-Encrypted: i=1; AJvYcCUKKbhaH7X49rcVtozOQQpJAFmmr4xusByb8Q6eA8nXprVgC4PnQYmQNzo8NJFiwix37tuRhLfnjgjJRYE=@vger.kernel.org X-Gm-Message-State: AOJu0YxswQ3Ffpvb822DpVOGq+M8I1FLiiJ4L/12wp9C2zqM/6RrgBNk rUSQEk6GLKupTwXudcrfATaHphB9bKtgSaxwU6zFvxrUbktHIM+pWq/E2Ycl4Y3oWiE= X-Gm-Gg: AY/fxX6JKGn/wUNVtjp0qTwMyIiziYGsVfVZXvZn4x0AQ2MobWfduM6Os3l0Luoeztc 7yQCc0I/QPBgVj1FVlB0lEsnxv4EG5/qSE4sFmW2rOZBqZT/fUKRyUxc07Zd3DImseADA/zReua y90fBU+nh82H4Z5kj9Dxd1gdpsQ3Onvsz9y+51W2b3Z2MXcjcx3SSFkBVGRVUgNIdnqfaJ9cnqk L6PecjHEK8GhB8OVsZSBbd3dwvdaQZCHPqoX41CMx1Q35FGTNtKhaF1LT2aWvASpFLYuZx2lRh9 n7Fq5GlPA9HigdickjaPTqdEWxcyL1WtkkJlsgDTm7FPDpOrYb/ELJ9FYa9Evc7PaXitMWPmRc3 yub/86PGDX25ZTtCUxzIigYQBJa9Es2t0drsv4DNo2iq0IDb4y82dIC18si8Q6P/BP79qncUbfw uMInpDeQ++ispwLQ63CDyR X-Received: by 2002:a05:6000:144b:b0:432:586f:2a9d with SMTP id ffacd0b85a97d-43569bbffa4mr14213616f8f.32.1768817358124; Mon, 19 Jan 2026 02:09:18 -0800 (PST) Received: from ho-tower-lan.lan ([185.48.77.170]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-4356997e6cdsm23234802f8f.31.2026.01.19.02.09.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Jan 2026 02:09:17 -0800 (PST) From: James Clark Date: Mon, 19 Jan 2026 10:08:17 +0000 Subject: [PATCH 2/2] perf cs-etm: Test sparse CPU maps 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="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260119-james-perf-coresight-cpu-map-segfault-v1-2-a9cfd67653ae@linaro.org> References: <20260119-james-perf-coresight-cpu-map-segfault-v1-0-a9cfd67653ae@linaro.org> In-Reply-To: <20260119-james-perf-coresight-cpu-map-segfault-v1-0-a9cfd67653ae@linaro.org> To: Suzuki K Poulose , Mike Leach , John Garry , Will Deacon , Leo Yan , Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Namhyung Kim , Mark Rutland , Alexander Shishkin , Jiri Olsa , Ian Rogers , Adrian Hunter , Thomas Falcon Cc: coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org, linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org, James Clark X-Mailer: b4 0.14.0 We only currently test with default (all CPUs) or --per-thread mode. Different permutations of the "-C" option can affect decoding so add tests for some of them. Signed-off-by: James Clark --- tools/perf/tests/shell/test_arm_coresight.sh | 54 ++++++++++++++++++++++++= ++++ 1 file changed, 54 insertions(+) diff --git a/tools/perf/tests/shell/test_arm_coresight.sh b/tools/perf/test= s/shell/test_arm_coresight.sh index 1c750b67d141..bbf89e944e7b 100755 --- a/tools/perf/tests/shell/test_arm_coresight.sh +++ b/tools/perf/tests/shell/test_arm_coresight.sh @@ -198,6 +198,58 @@ arm_cs_etm_basic_test() { arm_cs_report "CoreSight basic testing with '$*'" $err } =20 +arm_cs_etm_test_cpu_list() { + echo "Testing sparse CPU list: $1" + perf record -o ${perfdata} -e cs_etm//u -C $1 \ + -- taskset --cpu-list $1 true > /dev/null 2>&1 + perf_script_branch_samples true + err=3D$? + arm_cs_report "CoreSight sparse CPUs with '$*'" $err +} + +arm_cs_etm_sparse_cpus_test() { + # Iterate for every ETM device + cpus=3D() + for dev in /sys/bus/event_source/devices/cs_etm/cpu*; do + # Canonicalize the path + dev=3D`readlink -f $dev` + + # Find the ETM device belonging to which CPU + cpus+=3D("$(cat $dev/cpu)") + done + + mapfile -t cpus < <(printf '%s\n' "${cpus[@]}" | sort -n) + total=3D${#cpus[@]} + + # Need more than 1 to test + if [ $total -le 1 ]; then + return 0 + fi + + half=3D$((total / 2)) + + # First half + first_half=3D$(IFS=3D,; echo "${cpus[*]:0:$half}") + arm_cs_etm_test_cpu_list $first_half + + # Second half + second_half=3D$(IFS=3D,; echo "${cpus[*]:$half}") + arm_cs_etm_test_cpu_list $second_half + + # Odd list is the same as halves unless >=3D 4 CPUs + if [ $total -lt 4 ]; then + return 0 + fi + + # Odd indices + odd_cpus=3D() + for ((i=3D1; i