linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Zecheng Li <zecheng@google.com>
To: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>,
	Ingo Molnar <mingo@redhat.com>,
	 Arnaldo Carvalho de Melo <acme@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>,
	 Alexander Shishkin <alexander.shishkin@linux.intel.com>,
	Jiri Olsa <jolsa@kernel.org>,  Ian Rogers <irogers@google.com>,
	Adrian Hunter <adrian.hunter@intel.com>,
	 "Liang, Kan" <kan.liang@linux.intel.com>,
	Masami Hiramatsu <mhiramat@kernel.org>,
	 Xu Liu <xliuprof@google.com>,
	linux-perf-users@vger.kernel.org,  linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 06/10] perf annotate: Track arithmetic instructions on pointers
Date: Wed, 3 Sep 2025 16:26:50 -0400	[thread overview]
Message-ID: <CAJUgMyKBFkF9rKFnzP6S_c9ma3P7a-NsCubV1DiTwoGUbByk+w@mail.gmail.com> (raw)
In-Reply-To: <aLKknf6qFxVgN3gJ@google.com>

> I was thinking we can use TSR_KIND_POINTER here.  Probably we need to
> distinguish it from the existing percpu base use case. Maybe you want
> to rename it.  Then you don't need to find a pointer type in the DWARF.

Hi Namhyung, thanks for the review.

Yes. I think that's a better way to represent a pointer to a type.
With that tag we can also support registers representing addresses
(is_reg_var_addr == true). And when moving an address register to a
memory location we probably can simply add the * to denote a pointer
without finding the exact pointer type.

>
> > +                     tsr->offset = 0;
>
> I think it can refer to a member in a struct.  How about this?
>
>                         tsr->offset = state->offset - offset;

True, it may load an address of a struct member. Do you mean
stack->offset - offset?

> > @@ -388,6 +493,7 @@ static void update_insn_state_x86(struct type_state *state,
> >               tsr->type = state->regs[src->reg1].type;
> >               tsr->kind = state->regs[src->reg1].kind;
> >               tsr->imm_value = state->regs[src->reg1].imm_value;
> > +             tsr->offset = 0;
> >               tsr->ok = true;

I also find for mov register to register this should be

tsr->offset = state->regs[src->reg1].offset;

Let me update the patch.

Zecheng

  reply	other threads:[~2025-09-03 20:27 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-25 19:57 [PATCH v2 06/10] perf annotate: Track arithmetic instructions on pointers Zecheng Li
2025-08-30  7:13 ` Namhyung Kim
2025-09-03 20:26   ` Zecheng Li [this message]
2025-09-05 19:52     ` Namhyung Kim

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=CAJUgMyKBFkF9rKFnzP6S_c9ma3P7a-NsCubV1DiTwoGUbByk+w@mail.gmail.com \
    --to=zecheng@google.com \
    --cc=acme@kernel.org \
    --cc=adrian.hunter@intel.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=irogers@google.com \
    --cc=jolsa@kernel.org \
    --cc=kan.liang@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=mhiramat@kernel.org \
    --cc=mingo@redhat.com \
    --cc=namhyung@kernel.org \
    --cc=peterz@infradead.org \
    --cc=xliuprof@google.com \
    /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;
as well as URLs for NNTP newsgroup(s).