All of lore.kernel.org
 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 v9 7/9] perf cs-etm: Support call indentation
Date: Tue, 16 Jun 2026 15:08:00 +0000	[thread overview]
Message-ID: <20260616150801.1704A1F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260616-b4-arm_cs_callchain_support_v1-v9-7-f8fad931c413@arm.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] Thread stacks for per-thread traces (CS_ETM_PIDFMT_NONE) are not flushed upon a trace discontinuity, leading to stale callindent depths.
--

commit ccf60466ef97abd9a958c518b0578321fda247d0
Author: Leo Yan <leo.yan@linux.dev>

perf cs-etm: Support call indentation
    
The perf script callindent is derived from call stack in thread context,
CS ETM ignores the requirement for callindent without pushing and poping
call stack.

Enable thread-stack when either itrace thread-stack support or last branch
entries are requested, allocate the branch stack storage accordingly, and
feed taken branches to thread_stack__event() whenever thread-stack state
is needed.

> diff --git a/tools/perf/util/cs-etm.c b/tools/perf/util/cs-etm.c
> index d41aad583a26f..e18d2dec79431 100644
> --- a/tools/perf/util/cs-etm.c
> +++ b/tools/perf/util/cs-etm.c

[ ... ]

> @@ -2027,7 +2030,7 @@ static void cs_etm__flush_all_stack(struct cs_etm_queue *etmq)
>  {
>  	enum cs_etm_pid_fmt pid_fmt = cs_etm__get_pid_fmt(etmq);
>  
> -	if (!etmq->etm->synth_opts.last_branch)
> +	if (!etmq->etm->use_thread_stack)
>  		return;
>  
>  	switch (pid_fmt) {

[Severity: Medium]
Will this skip flushing thread stacks for per-thread traces upon a trace
discontinuity?

In cs_etm__flush_all_stack(), the switch statement explicitly skips flushing
the stack if the format is CS_ETM_PIDFMT_NONE:

    switch (pid_fmt) {
    ...
    case CS_ETM_PIDFMT_NONE:
    default:
        break;
    }

Because the frontend thread for per-thread mode is still attached to the host
machine, the flush is completely skipped.

As a result, could instruction samples generated before the first branch in the
new buffer inherit the stale thread stack depth from before the discontinuity,
and break the newly added callindent output?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260616-b4-arm_cs_callchain_support_v1-v9-0-f8fad931c413@arm.com?part=7

  reply	other threads:[~2026-06-16 15:08 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-16 14:51 [PATCH v9 0/9] perf cs-etm: Support thread stack and callchain Leo Yan
2026-06-16 14:51 ` [PATCH v9 1/9] perf cs-etm: Fix thread leaks on trace queue init failure Leo Yan
2026-06-16 14:51 ` [PATCH v9 2/9] perf cs-etm: Filter synthesized branch samples Leo Yan
2026-06-16 14:51 ` [PATCH v9 3/9] perf cs-etm: Decode ETE exception packets Leo Yan
2026-06-16 14:51 ` [PATCH v9 4/9] perf cs-etm: Refactor instruction size handling Leo Yan
2026-06-16 14:51 ` [PATCH v9 5/9] perf cs-etm: Use thread-stack for last branch entries Leo Yan
2026-06-16 15:13   ` sashiko-bot
2026-06-16 15:42     ` Leo Yan
2026-06-16 14:51 ` [PATCH v9 6/9] perf cs-etm: Flush thread stacks after decoder reset Leo Yan
2026-06-16 15:10   ` sashiko-bot
2026-06-16 14:51 ` [PATCH v9 7/9] perf cs-etm: Support call indentation Leo Yan
2026-06-16 15:08   ` sashiko-bot [this message]
2026-06-16 14:51 ` [PATCH v9 8/9] perf cs-etm: Synthesize callchains for instruction samples Leo Yan
2026-06-16 15:12   ` sashiko-bot
2026-06-16 14:51 ` [PATCH v9 9/9] perf test: Add Arm CoreSight callchain test Leo Yan
2026-06-16 15:08   ` sashiko-bot

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=20260616150801.1704A1F000E9@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.