Linux Perf Users
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Leo Yan" <leo.yan@arm.com>
Cc: linux-perf-users@vger.kernel.org
Subject: Re: [PATCH v6 8/8] perf test: Add Arm CoreSight callchain test
Date: Tue, 26 May 2026 20:56:13 +0000	[thread overview]
Message-ID: <20260526205614.17C191F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260526-b4-arm_cs_callchain_support_v1-v6-8-f9f49f53c9dd@arm.com>

Thank you for your contribution! Sashiko AI review found 3 potential issue(s) to consider:
- [High] The regular expressions for matching `perf script` output do not account for the timestamp field, guaranteeing test failure.
- [Low] The `.size` directive for the `main` function incorrectly excludes its `ret` instruction.
- [Low] The `adr` instruction is used to reference a symbol in a different section, which can cause a linker error.
--

commit c68e5facc9f76be5097ddc178f00bfa18d0f188f
Author: Leo Yan <leo.yan@arm.com>

perf test: Add Arm CoreSight callchain test

This commit adds a shell test for synthesized callchains from Arm CoreSight
trace data. It builds a test program for syscalls, records them, and
decodes with itrace callchain synthesis enabled to verify the push and pop
callchains.

> diff --git a/tools/perf/tests/shell/test_arm_coresight_callchain.sh b/tools/perf/tests/shell/test_arm_coresight_callchain.sh
> new file mode 100755
> index 0000000000000..0e5a5d1129ae7
> --- /dev/null
> +++ b/tools/perf/tests/shell/test_arm_coresight_callchain.sh

[ ... ]

> +do_svc:
> +	stp	x29, x30, [sp, #-16]!
> +	mov	x29, sp
> +
> +	mov	x0, #1
> +	adr	x1, msg

[Severity: Low]
Can this adr instruction cause a linker error?

The adr instruction computes a pc-relative offset but has a strict +/- 1 MB
range limit. If the linker places .text and .rodata further apart than 1 MB
(due to page size alignment or hardening constraints), the build will fail
with an out-of-range relocation error.

Would it be safer to use adrp and add here?

[ ... ]

> +main:
> +	stp	x29, x30, [sp, #-16]!
> +	mov	x29, sp
> +
> +	bl	foo
> +
> +	mov	w0, #0
> +	ldp	x29, x30, [sp], #16
> +	.size main, .-main
> +	ret

[Severity: Low]
Does this .size directive incorrectly exclude the ret instruction from the
main function bounds?

Placing it before the ret instruction might cause profiling tools to fail to
correctly attribute an execution sample on that instruction to the main
function.

[ ... ]

> +callchain_push_regex()
> +{
> +	printf '%s' \
> +'callchain[[:space:]]+[0-9]+ \[[0-9]+\][[:space:]]+10 instructions:[[:space:]]*\n'\

[Severity: High]
Will this regex fail to match because of the perf script timestamp field?

By default, perf script output includes a timestamp field, formatting lines
as "comm tid [cpu] time: event:". The test invokes perf script without
restricting the output fields (for example, it does not use -F,-time to
disable the timestamp).

Since this regex strictly requires spaces immediately between the cpu
identifier and the event name, it seems it will fail to match the timestamp
and cause the test to fail.

[ ... ]

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260526-b4-arm_cs_callchain_support_v1-v6-0-f9f49f53c9dd@arm.com?part=8

      reply	other threads:[~2026-05-26 20:56 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-26 16:59 [PATCH v6 0/8] perf cs-etm: Support thread stack and callchain Leo Yan
2026-05-26 16:59 ` [PATCH v6 1/8] perf cs-etm: Decode ETE exception packets Leo Yan
2026-05-26 16:59 ` [PATCH v6 2/8] perf cs-etm: Refactor instruction size handling Leo Yan
2026-05-26 16:59 ` [PATCH v6 3/8] perf cs-etm: Use thread-stack for last branch entries Leo Yan
2026-05-26 18:32   ` sashiko-bot
2026-05-26 16:59 ` [PATCH v6 4/8] perf cs-etm: Flush thread stacks after decoder reset Leo Yan
2026-05-26 19:10   ` sashiko-bot
2026-05-26 16:59 ` [PATCH v6 5/8] perf cs-etm: Support call indentation Leo Yan
2026-05-26 19:42   ` sashiko-bot
2026-05-26 16:59 ` [PATCH v6 6/8] perf cs-etm: Filter synthesized branch samples Leo Yan
2026-05-26 16:59 ` [PATCH v6 7/8] perf cs-etm: Synthesize callchains for instruction samples Leo Yan
2026-05-26 16:59 ` [PATCH v6 8/8] perf test: Add Arm CoreSight callchain test Leo Yan
2026-05-26 20:56   ` sashiko-bot [this message]

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=20260526205614.17C191F000E9@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=leo.yan@arm.com \
    --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