The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Namhyung Kim <namhyung@kernel.org>
To: Zecheng Li <zecheng@google.com>
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: Fri, 5 Sep 2025 12:52:05 -0700	[thread overview]
Message-ID: <aLs_ZeRBzNvgfbqK@google.com> (raw)
In-Reply-To: <CAJUgMyKBFkF9rKFnzP6S_c9ma3P7a-NsCubV1DiTwoGUbByk+w@mail.gmail.com>

Hi Zecheng,

On Wed, Sep 03, 2025 at 04:26:50PM -0400, Zecheng Li wrote:
> > 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?

Yep.

> 
> > > @@ -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.

Great, thanks!
Namhyung


      reply	other threads:[~2025-09-05 19:52 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
2025-09-05 19:52     ` Namhyung Kim [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=aLs_ZeRBzNvgfbqK@google.com \
    --to=namhyung@kernel.org \
    --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=peterz@infradead.org \
    --cc=xliuprof@google.com \
    --cc=zecheng@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