From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f44.google.com (mail-wm1-f44.google.com [209.85.128.44]) (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 728CE3ECBC6 for ; Tue, 2 Jun 2026 14:27:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.44 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780410445; cv=none; b=jnlpAYf8kh9uDJ/oTeTMEQlGEc7P4Ad6TkKBpuUNxiLWuPGbClWROR7OuGLWX2yKEtrXjtZRHkCRc4LcHDHoG8Qv5txMotYCGoHGSMMaHHgS8OBbw5zWjDsks/+yOLgwZjmGLWv+mzfKcK6apoSoHHzxYLbYHqnjNxLy9qPBzk0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780410445; c=relaxed/simple; bh=XbRp9KxgkXge2eA0Kob7iy3MYKUmZBqM3EYn8QhJdqY=; h=From:Subject:Date:Message-Id:MIME-Version:Content-Type:To:Cc; b=da2jVCECsSBkPItLiDe54axl8M/7El2LDbXB5ABwMo4hEnRkwRUPlajfGKZtJ8hENzRQzoRZ0SdTBmPXWvuBz4a5h7Cr961UjKxbSVbPPd9jBj90g7eFZXymJAK883xT5syYRk9BBPHPJBqVrI8e8+hB7hdC5ZIOBqttMWwyCcU= 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=PVbw0o73; arc=none smtp.client-ip=209.85.128.44 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="PVbw0o73" Received: by mail-wm1-f44.google.com with SMTP id 5b1f17b1804b1-4906238c62eso94112145e9.3 for ; Tue, 02 Jun 2026 07:27:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1780410441; x=1781015241; darn=vger.kernel.org; h=cc:to:content-transfer-encoding:mime-version:message-id:date :subject:from:from:to:cc:subject:date:message-id:reply-to; bh=CtrXGGGRkpK6Hrb07mUshzy+oVvwUJz5X1iOdpZ8KCk=; b=PVbw0o73puwXy8NRtxZIBity6SIg0geS48ZN9J+eh8IRHwt+sSxDDi2FvDM4iGF0Fc Y4GFJwaCJM0IIIETPYO7e3YkwkxDHxuShd7o+wzpSjvQY0m9FL6CFAK4rE1fNS7y/MaN vPLJ+r2EmytK7PMz3XRUWNYe8Uby61NUOjVuJ8iha9qOCNoZZyAMpS2Ncp+pD9H1yTLT h5aq6k7wzFyEoFJ2NX+N1iy46zLRnqTDrXBNBDcDODKddb2J2D/2C5Oc1W+vXj3XVr+i Lko2R7u3eegJRf0j+aeo7vPFHdhuz3WWMmUNMK70cFsz1zr24uFHv6F9YXHvDSn+1QFg 6FRg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780410441; x=1781015241; h=cc:to:content-transfer-encoding:mime-version:message-id:date :subject:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=CtrXGGGRkpK6Hrb07mUshzy+oVvwUJz5X1iOdpZ8KCk=; b=bxEphxvnM8D0qydA/VNkz+Je7b7lpnAWSk4D7BCPcOn8ZDQWZ4hHK+aLapHAYfdL57 YlSJz+TM+E9uSXneFD+CSWMU4qF2YBKhUmVqfxW6hh24t8GiUWlDRKorLai979Fx9Bd9 2J0nHK/fwbTQh/8kDNuedKGzLEPXih11jjqtCL9alj1dFfcAeE702pMa7xjSDNXo0UMW 9OXR4iLNHoN4MGCQ87Qs2nqpmUzpZVZAxTMLibbPFy6cf0P3jTSv9OYV61PXg7yqO/Tx i+D7+IxIFAvKG8gg/plnuGb01lTaQEiYWxUAUDAH7Zex0iV9+wFMPsRiCS0zi6AQAMiA 0Wfw== X-Forwarded-Encrypted: i=1; AFNElJ8nFUOFulg9fd1mhiJZASYCzccWhRcye6jQq06cg2gTFv1pfd7iTgGPX92ZwjLhb6Z59ZUx0sVs8YqXVGI=@vger.kernel.org X-Gm-Message-State: AOJu0YxkBmO/cd9h8Ya8sDicf0Vs4H7fqHYYUhgV2NQFC5ZKsTvuNUax 9xD5W1FcIXS44IjSTcioOjYwPm6XJZ1NaJQl23Yn2Fc3eVB4ibGQemoCD9/0rAc0zMw= X-Gm-Gg: Acq92OGj1i9V2fcMGlla5uBHAokzbfAhy+D2GNcIEj0LWQlstQOHm6nY8jpY1jkod+s aOHLd2nvYwipHWfGpGh4w6yTIKXSIuRUMgtjk2ihfAb2InsSFe4oQLcq/GKekKcvp/T6U5K2fWW 3IUpGOgQ10KC18N0nuCX3HW7Cfi7kZX0ELg5MnheeR31IAsy++vDEV8XCDBuJ1IKsnJtJT2xKrW GggzI++yBI/ccgcVCdeOm5lVI2167K7nrZhs2kqx6y+DfphYAV0aAbp9UBocn06jvBdV+9H4a/z NsA3tM4eqU8oI9p9PBrVqkk1fc1mnqiNZ3XEN95tksUWWR7lNXMRK2dCZwBTs0uvUAg6mEug5la NBhQbV70QD6/4DlT/HhIRw3OLyjJYyYdeiyKqRriVVZEMNJexrfsyTe0DCeKiDksJTCk4HZ44Or s2sngZ9bzx8EzlDM4CNF1Iywr46hPPdKMp3n/n0HF3tGo= X-Received: by 2002:a05:600d:8445:20b0:48a:5c23:cab with SMTP id 5b1f17b1804b1-490a293a126mr212661445e9.19.1780410440964; Tue, 02 Jun 2026 07:27:20 -0700 (PDT) Received: from ho-tower-lan.lan ([185.48.77.170]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-490b0e18e1csm66771965e9.4.2026.06.02.07.27.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jun 2026 07:27:20 -0700 (PDT) From: James Clark Subject: [PATCH v2 00/18] perf cs-etm: Queue context packets for frontend Date: Tue, 02 Jun 2026 15:26:42 +0100 Message-Id: <20260602-james-cs-context-tracking-fix-v2-0-85b5ce6f55c6@linaro.org> 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: 7bit X-B4-Tracking: v=1; b=H4sIACLoHmoC/4WNyw6CMBBFf4XM2jFtIy9X/IdhUWCE8dGaaUMwh H+3Evcmd3PO4twVAglTgHO2gtDMgb1LYA4Z9JN1IyEPicEoU6hc53izTwrYp3kXaYkYxfZ3diN eecEyP9V11VkqaYDUeAklvfcvbeKJQ/Ty3u9m/bW/sin+lGeNCqkbCmVIV6Yqmwc7K/7oZYR22 7YPeNyja8sAAAA= To: Suzuki K Poulose , Mike Leach , Leo Yan , Arnaldo Carvalho de Melo , Namhyung Kim , Jiri Olsa , Ian Rogers , Amir Ayupov , Jonathan Corbet , Shuah Khan , Paschalis Mpeis Cc: coresight@lists.linaro.org, linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org, Arnaldo Carvalho de Melo , linux-doc@vger.kernel.org, James Clark X-Mailer: b4 0.14.0 Fix thread tracking when decoding Coresight trace and add a new test for it. The new test is added as a Perf test workload instead of a custom binary with its own build system, but this requires a new feature in Perf test to pass in control pipes which can enable and disable events. This scopes the recording to just the workload and helps to reduce the amount of data recorded in tracing tests. With this new feature we can re-write all of the Coresight tests to make use of it and remove the remaining binaries which fixes the following issues: * They didn't work in out of source builds * A lot of the tests unnecessarily required root and didn't skip without it * They were mainly qualitative tests which didn't look for specific behavior Most importantly, the long build and runtime has been reduced. On a Radxa Orion O6, unroll_loop_thread.c took 37s to compile which is longer than the entire Perf build. Now the build time is negligible and the before and after test runtimes for all the Coresight tests are: | N1SDP | Orion O6 ----------------------------------- Before | 4m 0s | 14m 49s After | 26s | 56s ----------------------------------- Signed-off-by: James Clark --- Changes in v2: - Add --workload-ctl option to Perf test - Re-write all the Coresight tests and speed them up - Pass packet to memory access function so frontend can use either the previous or current packet's EL - Link to v1: https://lore.kernel.org/r/20260526-james-cs-context-tracking-fix-v1-0-ebd602e18287@linaro.org --- James Clark (18): perf cs-etm: Queue context packets for frontend perf test: Add workload-ctl option perf test: Add a workload that forces context switches perf test cs-etm: Test process attribution perf test: Add deterministic workload perf test cs-etm: Replace unroll loop thread with deterministic decode test perf test cs-etm: Remove asm_pure_loop test perf test cs-etm: Replace memcpy test with raw dump stress test perf test: Add named_threads workload perf test cs-etm: Test decoding for concurrent threads test perf test cs-etm: Remove duplicate branch tests perf test cs-etm: Reduce snapshot size perf test cs-etm: Speed up basic test perf test cs-etm: Remove unused Coresight workloads perf test cs-etm: Make disassembly test use kcore perf test cs-etm: Add all branch instructions to test perf test cs-etm: Speed up disassembly test perf test cs-etm: Move existing tests to coresight folder Documentation/trace/coresight/coresight-perf.rst | 78 +------ MAINTAINERS | 2 - tools/perf/Documentation/perf-test.txt | 18 +- tools/perf/Makefile.perf | 14 +- tools/perf/scripts/python/arm-cs-trace-disasm.py | 20 +- tools/perf/tests/builtin-test.c | 187 ++++++++++++++++- tools/perf/tests/shell/coresight/Makefile | 29 --- .../perf/tests/shell/coresight/Makefile.miniconfig | 14 -- tools/perf/tests/shell/coresight/asm_pure_loop.sh | 22 -- .../tests/shell/coresight/asm_pure_loop/.gitignore | 1 - .../tests/shell/coresight/asm_pure_loop/Makefile | 34 --- .../shell/coresight/asm_pure_loop/asm_pure_loop.S | 30 --- .../tests/shell/coresight/concurrent_threads.sh | 45 ++++ .../tests/shell/coresight/context_switch_thread.sh | 69 ++++++ tools/perf/tests/shell/coresight/deterministic.sh | 71 +++++++ .../tests/shell/coresight/memcpy_thread/.gitignore | 1 - .../tests/shell/coresight/memcpy_thread/Makefile | 33 --- .../shell/coresight/memcpy_thread/memcpy_thread.c | 80 ------- .../tests/shell/coresight/memcpy_thread_16k_10.sh | 22 -- .../perf/tests/shell/coresight/raw_dump_stress.sh | 54 +++++ .../shell/{ => coresight}/test_arm_coresight.sh | 43 ++-- .../{ => coresight}/test_arm_coresight_disasm.sh | 17 +- .../tests/shell/coresight/thread_loop/.gitignore | 1 - .../tests/shell/coresight/thread_loop/Makefile | 33 --- .../shell/coresight/thread_loop/thread_loop.c | 85 -------- .../shell/coresight/thread_loop_check_tid_10.sh | 23 -- .../shell/coresight/thread_loop_check_tid_2.sh | 23 -- .../shell/coresight/unroll_loop_thread/.gitignore | 1 - .../shell/coresight/unroll_loop_thread/Makefile | 33 --- .../unroll_loop_thread/unroll_loop_thread.c | 75 ------- .../tests/shell/coresight/unroll_loop_thread_10.sh | 22 -- tools/perf/tests/shell/lib/coresight.sh | 134 ------------ tools/perf/tests/tests.h | 3 + tools/perf/tests/workloads/Build | 4 + tools/perf/tests/workloads/context_switch_loop.c | 95 +++++++++ tools/perf/tests/workloads/deterministic.c | 39 ++++ tools/perf/tests/workloads/named_threads.c | 109 ++++++++++ tools/perf/util/cs-etm-decoder/cs-etm-decoder.c | 21 +- tools/perf/util/cs-etm.c | 233 +++++++++++++-------- tools/perf/util/cs-etm.h | 8 +- 40 files changed, 892 insertions(+), 934 deletions(-) --- base-commit: 5f0ca6b80b12bab1ce06839cdffb6148bb650ff4 change-id: 20260515-james-cs-context-tracking-fix-754998bae7ed Best regards, -- James Clark