From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Namhyung Kim <namhyung@kernel.org>
Cc: Zecheng Li <zecheng@google.com>,
Peter Zijlstra <peterz@infradead.org>,
Ingo Molnar <mingo@redhat.com>,
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 01/10] perf dwarf-aux: Use signed variable types in match_var_offset
Date: Wed, 3 Sep 2025 12:49:49 -0300 [thread overview]
Message-ID: <aLhjnex4_SXpV_8N@x1> (raw)
In-Reply-To: <aK_8kt5Yf9MDoPdu@google.com>
On Wed, Aug 27, 2025 at 11:52:02PM -0700, Namhyung Kim wrote:
> On Mon, Aug 25, 2025 at 07:54:03PM +0000, Zecheng Li wrote:
> > match_var_offset compares address offsets to determine if an access
> > falls within a variable's bounds. The offsets involved for those
> > relative to base registers from DW_OP_breg can be negative.
> > The current implementation uses unsigned types (u64) for these offsets,
> > which rejects almost all negative values.
> Right, I thought it cannot get negative offsets except for stack access
> (e.g. fbreg). But it turns out that container_of() trick can generate
> them with optimizing compilers.
> > Change the signature of match_var_offset to use signed types (s64). This
> > ensures correct behavior when addr_offset or addr_type are negative.
> > Signed-off-by: Zecheng Li <zecheng@google.com>
> I've confirmed it produced slightly better results on my test sets.
> Reviewed-by: Namhyung Kim <namhyung@kernel.org>
Cherry picked this first patch to make a bit of progress in the
perf-tools-next front.
- Arnaldo
next prev parent reply other threads:[~2025-09-03 15:49 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-25 19:54 [PATCH v2 00/10] perf tools: Some improvements on data type profiler Zecheng Li
2025-08-25 19:54 ` [PATCH v2 01/10] perf dwarf-aux: Use signed variable types in match_var_offset Zecheng Li
2025-08-28 6:52 ` Namhyung Kim
2025-09-03 15:49 ` Arnaldo Carvalho de Melo [this message]
2025-09-03 22:05 ` Arnaldo Carvalho de Melo
2025-09-05 19:50 ` Namhyung Kim
2025-09-13 14:34 ` Arnaldo Carvalho de Melo
2025-08-25 19:54 ` [PATCH v2 02/10] perf dwarf-aux: More accurate variable type match for breg Zecheng Li
2025-08-28 7:18 ` Namhyung Kim
2025-08-28 18:36 ` Zecheng Li
2025-08-30 0:53 ` Namhyung Kim
2025-08-25 19:54 ` [PATCH v2 03/10] perf dwarf-aux: Better variable collection for insn tracking Zecheng Li
2025-08-30 1:22 ` Namhyung Kim
2025-08-25 19:54 ` [PATCH v2 04/10] perf annotate: Skip annotating data types to lea instructions Zecheng Li
2025-08-30 6:41 ` Namhyung Kim
2025-08-25 19:54 ` [PATCH v2 05/10] perf dwarf-aux: Find pointer type to a type Zecheng Li
2025-08-30 6:48 ` 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=aLhjnex4_SXpV_8N@x1 \
--to=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 \
--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;
as well as URLs for NNTP newsgroup(s).