mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Tengda Wu <wutengda@huaweicloud.com>
To: Namhyung Kim <namhyung@kernel.org>
Cc: james.clark@linaro.org, xueshuai@linux.alibaba.com,
	Arnaldo Carvalho de Melo <acme@kernel.org>,
	Peter Zijlstra <peterz@infradead.org>,
	leo.yan@linux.dev, Li Huafei <lihuafei1@huawei.com>,
	Ian Rogers <irogers@google.com>,
	Kim Phillips <kim.phillips@arm.com>,
	Mark Rutland <mark.rutland@arm.com>,
	Ingo Molnar <mingo@redhat.com>, Bill Wendling <morbo@google.com>,
	Nick Desaulniers <nick.desaulniers+lkml@gmail.com>,
	Alexander Shishkin <alexander.shishkin@linux.intel.com>,
	Adrian Hunter <adrian.hunter@intel.com>,
	Zecheng Li <zli94@ncsu.edu>,
	linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org,
	llvm@lists.linux.dev
Subject: Re: [PATCH v7 06/15] perf annotate-arm64: Support store instruction tracking
Date: Fri, 16 Oct 2026 09:14:13 +0800	[thread overview]
Message-ID: <71090bb4-dd82-415c-a0cd-5ce11841e261@huaweicloud.com> (raw)
In-Reply-To: <atFbbrGdobp83fgA@google.com>



On 2026/10/16 7:02, Namhyung Kim wrote:
> On Tue, Oct 13, 2026 at 01:28:04PM +0000, Tengda Wu wrote:
>> Extend update_insn_state_arm64() to handle standard store instructions
>> (str, stur, stlr, stp). Exclusive stores (e.g., stxr, stxp) are omitted
>> as they exhibit different operand semantics.
>>
>> Unlike load instructions, a store instruction sets a value in the struct
>> within the memory where the destination register resides, and does not
>> alter its type. Therefore, no processing is required for the transfer.
> 
> But the target location also can be stack which requires type info,
> right?  Oh, I think you have a patch later to handle that.

Yes, this is supported in the subsequent patch 10 for stack-related loads
and stores.

Thanks,
Tengda

> 
> Thanks,
> Namhyung
> >>
>> The only point to note is that store instructions support pre-index and
>> post-index addressing modes, so calling adjust_reg_index_state() is still
>> necessary to handle their addressing.
>>
>> Reviewed-by: Ian Rogers <irogers@google.com>
>> Signed-off-by: Tengda Wu <wutengda@huaweicloud.com>
>> ---
>>  .../perf/util/annotate-arch/annotate-arm64.c  | 25 +++++++++++++++++++
>>  1 file changed, 25 insertions(+)
>>
>> diff --git a/tools/perf/util/annotate-arch/annotate-arm64.c b/tools/perf/util/annotate-arch/annotate-arm64.c
>> index fb48bf95b32f..54d9928b536f 100644
>> --- a/tools/perf/util/annotate-arch/annotate-arm64.c
>> +++ b/tools/perf/util/annotate-arch/annotate-arm64.c
>> @@ -661,6 +661,20 @@ static void update_load_insn_state(struct type_state *state,
>>  	adjust_reg_index_state(state, dloc, dl, src);
>>  }
>>  
>> +/*
>> + * Match standard store variants (str, stur, stlr, stp) that follow
>> + * straightforward store semantics: source registers on the left (read-only)
>> + * and memory target on the right. Excludes exclusive stores (stxr, stxp, etc.)
>> + * which have status/result register side effects.
>> + */
>> +static bool is_standard_store_insn(const char *name)
>> +{
>> +	return !strncmp(name, "str", 3)  ||  /* str, strb, strh */
>> +	       !strncmp(name, "stur", 4) ||  /* stur, sturb, sturh */
>> +	       !strncmp(name, "stlr", 4) ||  /* stlr, stlrb, stlrh */
>> +	       !strncmp(name, "stp", 3);     /* stp */
>> +}
>> +
>>  static void update_insn_state_arm64(struct type_state *state,
>>  				    struct data_loc_info *dloc, Dwarf_Die *cu_die,
>>  				    struct disasm_line *dl)
>> @@ -742,6 +756,17 @@ static void update_insn_state_arm64(struct type_state *state,
>>  	/* Memory to register transfers */
>>  	if (is_standard_load_insn(dl->ins.name))
>>  		update_load_insn_state(state, dloc, dl, src, dst);
>> +	/* Register to memory transfers */
>> +	else if (is_standard_store_insn(dl->ins.name)) {
>> +		/*
>> +		 * Ignore transfers since it'd set a value in a struct
>> +		 * and won't change the type.
>> +		 *
>> +		 * Needs to update the pre-index and post-index addressing
>> +		 * modes for the destination register.
>> +		 */
>> +		adjust_reg_index_state(state, dloc, dl, dst);
>> +	}
>>  }
>>  #endif
>>  
>> -- 
>> 2.34.1
>>


  reply	other threads:[~2026-10-16  1:14 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-13 13:27 [PATCH v7 00/15] perf annotate arm64: Support instruction tracking for data type profiling Tengda Wu
2026-10-13 13:27 ` [PATCH v7 01/15] perf annotate-data: Extract invalidate_reg_state() as a common helper Tengda Wu
2026-10-13 13:28 ` [PATCH v7 02/15] perf annotate-arm64: Enable instruction tracking support Tengda Wu
2026-10-13 13:28 ` [PATCH v7 03/15] perf annotate-data: Add arch_get_reg_offset helper Tengda Wu
2026-10-13 13:28 ` [PATCH v7 04/15] perf annotate-arm64: Track return type after call instructions Tengda Wu
2026-10-13 13:28 ` [PATCH v7 05/15] perf annotate-arm64: Support load instruction tracking Tengda Wu
2026-10-13 13:28 ` [PATCH v7 06/15] perf annotate-arm64: Support store " Tengda Wu
2026-10-15 23:02   ` Namhyung Kim
2026-10-16  1:14     ` Tengda Wu [this message]
2026-10-13 13:28 ` [PATCH v7 07/15] perf annotate-data: Expand type_state_reg imm_value to u64 Tengda Wu
2026-10-13 13:28 ` [PATCH v7 08/15] perf annotate-data: Track imm_value for stack variables Tengda Wu
2026-10-13 13:28 ` [PATCH v7 09/15] perf annotate-x86: Delete stale stack state on store of untracked register Tengda Wu
2026-10-13 13:28 ` [PATCH v7 10/15] perf annotate-arm64: Support stack variable tracking Tengda Wu
2026-10-13 13:28 ` [PATCH v7 11/15] perf annotate-arm64: Support 'mov' instruction tracking Tengda Wu
2026-10-13 13:28 ` [PATCH v7 12/15] perf annotate-arm64: Support 'add' " Tengda Wu
2026-10-13 13:28 ` [PATCH v7 13/15] perf annotate-arm64: Support 'adrp' instruction to track global variables Tengda Wu
2026-10-13 13:28 ` [PATCH v7 14/15] perf annotate-arm64: Support per-cpu variable access tracking Tengda Wu
2026-10-13 13:28 ` [PATCH v7 15/15] perf annotate-arm64: Support 'mrs' instruction to track 'current' pointer Tengda Wu
2026-10-15 23:11 ` [PATCH v7 00/15] perf annotate arm64: Support instruction tracking for data type profiling Namhyung Kim
2026-10-16  1:18   ` Tengda Wu

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=71090bb4-dd82-415c-a0cd-5ce11841e261@huaweicloud.com \
    --to=wutengda@huaweicloud.com \
    --cc=acme@kernel.org \
    --cc=adrian.hunter@intel.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=irogers@google.com \
    --cc=james.clark@linaro.org \
    --cc=kim.phillips@arm.com \
    --cc=leo.yan@linux.dev \
    --cc=lihuafei1@huawei.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=llvm@lists.linux.dev \
    --cc=mark.rutland@arm.com \
    --cc=mingo@redhat.com \
    --cc=morbo@google.com \
    --cc=namhyung@kernel.org \
    --cc=nick.desaulniers+lkml@gmail.com \
    --cc=peterz@infradead.org \
    --cc=xueshuai@linux.alibaba.com \
    --cc=zli94@ncsu.edu \
    /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

all inboxes | Powered by JetHome®