Linux Perf Users
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "James Clark" <james.clark@linaro.org>
Cc: linux-perf-users@vger.kernel.org
Subject: Re: [PATCH 31/34] perf test cs-etm: Add a Java JIT source-line test
Date: Wed, 18 Nov 2026 17:11:10 +0000	[thread overview]
Message-ID: <sashiko-outbox-221593@kernel.org> (raw)
In-Reply-To: <20261118-james-coresight-jit-v1-31-dad4d90747f6@linaro.org>

Thank you for your contribution! Sashiko AI review found 2 potential
issues to consider:
- [Medium] perf test cs-etm: java-jit.sh fails with EPERM for
  unprivileged users due to -m ,8M
- [Low] perf test cs-etm: missing libopencsd and dwarf checks in
  java-jit.sh
--

commit cea9e66501af7e76ede12eae8cd4a06ada95d4ae
Author: James Clark <james.clark@linaro.org>

perf test cs-etm: Add a Java JIT source-line test

This commit adds a CoreSight shell test that records a Java workload with
the JVMTI agent, injects JIT symbols, and verifies the decoded source line
sequence across address reuse.

> diff --git a/tools/perf/tests/shell/coresight/java-jit.sh b/tools/perf/tests/shell/coresight/java-jit.sh
> new file mode 100755
> index 0000000000000..cb6099efa8991
> --- /dev/null
> +++ b/tools/perf/tests/shell/coresight/java-jit.sh
> @@ -0,0 +1,65 @@
> +#!/bin/bash
> +# CoreSight Java JIT source lines and code address reuse (exclusive)
> +# SPDX-License-Identifier: GPL-2.0
> +
> +set -e
> +set -o pipefail
> +
> +script_dir=$(dirname "$0")
> +
> +# Requires a HotSpot JDK (11+) and libperf-jvmti with line number support.
> +perf list pmu | grep cs_etm > /dev/null || exit 2

[Severity: Low]
Should the prerequisite checks also verify "perf check feature -q
libopencsd" and "perf check feature -q dwarf" before running the test?

The cs_etm PMU is exposed by the kernel and tools/perf/arch/arm/util/cs-etm.c
is compiled unconditionally on arm64, so perf list pmu and perf record
succeed even when perf is built without CORESIGHT=1, causing perf inject
and perf script to fail in cs_etm__process_auxtrace_info_full() instead of
skipping.  Likewise, jit_write_elf() only emits DWARF line tables via
jit_add_debug_info() when built with HAVE_LIBDW_SUPPORT, so builds without
libdw produce no source lines and fail the diff check.

[ ... ]

> +# Compile only run(), and collect trace only while it executes.
> +# A small code cache and class unloading encourage address reuse.
> +timeout 60s perf record \
> +	-o "$tmpdir/data" -e cs_etm//u -D -1 -m ,8M \
> +	--control "fifo:$tmpdir/ctl,$tmpdir/ack" -- \
> +	java -Xbatch -XX:-TieredCompilation -XX:CompileThreshold=100 \

[Severity: Medium]
Does "-m ,8M" cause perf record to fail with EPERM when running perf test
as an unprivileged user?

Passing "-m ,8M" sets opts->auxtrace_mmap_pages to 8 MiB while leaving
opts->mmap_pages at UINT_MAX, bypassing the unprivileged 128 KiB AUX /
256 KiB data fallback in cs_etm_recording_options():

tools/perf/arch/arm/util/cs-etm.c:cs_etm_recording_options() {
    ...
	if (!opts->auxtrace_mmap_pages) {
		if (privileged) {
			opts->auxtrace_mmap_pages = MiB(4) / page_size;
		} else {
			opts->auxtrace_mmap_pages = KiB(128) / page_size;
			if (opts->mmap_pages == UINT_MAX)
				opts->mmap_pages = KiB(256) / page_size;
		}
	}
    ...
}

Because --per-thread is not used, perf record mmaps a 516 KiB data buffer
and an 8 MiB AUX buffer on every online CPU.  In perf_mmap_calc_limits(),
the per-CPU data buffers consume the entire user_lock_limit and the 8 MiB
per-CPU AUX buffers exceed the default 8 MiB RLIMIT_MEMLOCK, aborting the
test with exit status 1.  Since tracing is only enabled for a single
work.run() call per phase, can this use the default buffer sizing from
cs_etm_recording_options() or skip when unprivileged?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261118-james-coresight-jit-v1-0-dad4d90747f6@linaro.org?part=31

  reply	other threads:[~2026-11-18 17:11 UTC|newest]

Thread overview: 70+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-18 16:29 [PATCH 00/34] perf cs-etm: JIT decoding support James Clark
2026-11-18 16:29 ` [PATCH 01/34] perf jit: Support JITDUMP_USE_ARCH_TIMESTAMP on arm64 James Clark
2026-11-18 16:40   ` sashiko-bot
2026-11-18 16:29 ` [PATCH 02/34] perf jit: Add name of clock in error message James Clark
2026-11-18 16:32   ` sashiko-bot
2026-11-18 16:29 ` [PATCH 03/34] perf jit: Add address ranges to DWARF compilation units James Clark
2026-11-18 16:34   ` sashiko-bot
2026-11-18 16:29 ` [PATCH 04/34] perf libdw: Don't look up the module by ELF address James Clark
2026-11-18 16:36   ` sashiko-bot
2026-11-18 16:29 ` [PATCH 05/34] perf cs-etm: Use the exception level to tell kernel from user James Clark
2026-11-18 16:47   ` sashiko-bot
2026-11-18 16:29 ` [PATCH 06/34] perf cs-etm: Don't read past the end of the map James Clark
2026-11-18 17:11   ` sashiko-bot
2026-11-18 16:29 ` [PATCH 07/34] perf build-id: Cache the vDSO in build ID mmap mode James Clark
2026-11-18 17:03   ` sashiko-bot
2026-11-18 16:29 ` [PATCH 08/34] perf cs-etm: arm-spe: Use arch timestamp in HW tracers James Clark
2026-11-18 16:42   ` sashiko-bot
2026-11-18 16:29 ` [PATCH 09/34] perf cs-etm: arm-spe: Report error if default clock isn't used James Clark
2026-11-18 16:35   ` sashiko-bot
2026-11-18 16:29 ` [PATCH 10/34] perf cs-etm: Remove old pipe mode support James Clark
2026-11-18 16:44   ` sashiko-bot
2026-11-18 16:29 ` [PATCH 11/34] perf cs-etm: Track threads in timeless mode James Clark
2026-11-18 16:35   ` sashiko-bot
2026-11-18 16:29 ` [PATCH 12/34] perf cs-etm: Track sched out events James Clark
2026-11-18 16:40   ` sashiko-bot
2026-11-18 16:29 ` [PATCH 13/34] perf cs-etm: Handle PERF_RECORD_SWITCH events James Clark
2026-11-18 16:36   ` sashiko-bot
2026-11-18 16:29 ` [PATCH 14/34] perf cs-etm: Always enable Perf event timestamps James Clark
2026-11-18 16:40   ` sashiko-bot
2026-11-18 16:29 ` [PATCH 15/34] perf cs-etm: Use time from Perf samples James Clark
2026-11-18 16:51   ` sashiko-bot
2026-11-18 16:29 ` [PATCH 16/34] perf cs-etm: Don't buffer non-timestamped packets James Clark
2026-11-18 16:43   ` sashiko-bot
2026-11-18 16:29 ` [PATCH 17/34] perf cs-etm: Decode in order of Perf samples James Clark
2026-11-18 17:10   ` sashiko-bot
2026-11-18 16:29 ` [PATCH 18/34] perf cs-etm: Don't special case per-thread mode James Clark
2026-11-18 16:40   ` sashiko-bot
2026-11-18 16:29 ` [PATCH 19/34] perf cs-etm: Decode one packet at a time and don't estimate timestamps James Clark
2026-11-18 16:39   ` sashiko-bot
2026-11-18 16:29 ` [PATCH 20/34] perf cs-etm: Remove the decoded packet ring buffer James Clark
2026-11-18 16:46   ` sashiko-bot
2026-11-18 16:29 ` [PATCH 21/34] perf cs-etm: Fold packet state into the trace ID queue James Clark
2026-11-18 16:40   ` sashiko-bot
2026-11-18 16:29 ` [PATCH 22/34] perf cs-etm: Rename trace ID queues to trace ID contexts James Clark
2026-11-18 16:40   ` sashiko-bot
2026-11-18 16:29 ` [PATCH 23/34] perf cs-etm: Rename tidq variables to tidc James Clark
2026-11-18 16:49   ` sashiko-bot
2026-11-18 16:29 ` [PATCH 24/34] perf cs-etm: Share the thread ctxt between frontend and backend James Clark
2026-11-18 16:47   ` sashiko-bot
2026-11-18 16:29 ` [PATCH 25/34] perf cs-etm: Consume each OpenCSD packet immediately James Clark
2026-11-18 16:44   ` sashiko-bot
2026-11-18 16:29 ` [PATCH 26/34] perf cs-etm: Split base and packet decoder state James Clark
2026-11-18 16:42   ` sashiko-bot
2026-11-18 16:29 ` [PATCH 27/34] perf cs-etm: Add packet-only timestamp decoder ops James Clark
2026-11-18 16:42   ` sashiko-bot
2026-11-18 16:29 ` [PATCH 28/34] perf cs-etm: Create timestamp decoders James Clark
2026-11-18 16:48   ` sashiko-bot
2026-11-18 16:29 ` [PATCH 29/34] perf cs-etm: Find timestamps by searching ahead James Clark
2026-11-18 17:01   ` sashiko-bot
2026-11-18 16:29 ` [PATCH 30/34] perf cs-etm: Invalidate OpenCSD's cache on MMAPs James Clark
2026-11-18 16:45   ` sashiko-bot
2026-11-18 16:29 ` [PATCH 31/34] perf test cs-etm: Add a Java JIT source-line test James Clark
2026-11-18 17:11   ` sashiko-bot [this message]
2026-11-18 16:29 ` [PATCH 32/34] perf test cs-etm: Test trace is ordered with context switch records James Clark
2026-11-18 16:49   ` sashiko-bot
2026-11-18 16:29 ` [PATCH 33/34] perf test cs-etm: Test decoding of kernel modules James Clark
2026-11-18 16:57   ` sashiko-bot
2026-11-18 16:29 ` [PATCH 34/34] perf test cs-etm: Add an HHVM JIT call stack test James Clark
2026-11-18 17:01   ` sashiko-bot
2026-11-18 16:33 ` [PATCH 00/34] perf cs-etm: JIT decoding support James Clark

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=sashiko-outbox-221593@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=james.clark@linaro.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox