[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAJUgMyKBFkF9rKFnzP6S_c9ma3P7a-NsCubV1DiTwoGUbByk+w@mail.gmail.com>
Date: Wed, 3 Sep 2025 16:26:50 -0400
From: Zecheng Li <zecheng@...gle.com>
To: Namhyung Kim <namhyung@...nel.org>
Cc: Peter Zijlstra <peterz@...radead.org>, Ingo Molnar <mingo@...hat.com>,
Arnaldo Carvalho de Melo <acme@...nel.org>, Mark Rutland <mark.rutland@....com>,
Alexander Shishkin <alexander.shishkin@...ux.intel.com>, Jiri Olsa <jolsa@...nel.org>,
Ian Rogers <irogers@...gle.com>, Adrian Hunter <adrian.hunter@...el.com>,
"Liang, Kan" <kan.liang@...ux.intel.com>, Masami Hiramatsu <mhiramat@...nel.org>,
Xu Liu <xliuprof@...gle.com>, linux-perf-users@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 06/10] perf annotate: Track arithmetic instructions on pointers
> 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
Powered by blists - more mailing lists