linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Namhyung Kim <namhyung@kernel.org>
To: Arnaldo Carvalho de Melo <acme@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: Fri, 5 Sep 2025 12:50:30 -0700	[thread overview]
Message-ID: <aLs_BuzNJZt6Wl2g@google.com> (raw)
In-Reply-To: <aLi7o0hB23v7wpJ9@x1>

On Wed, Sep 03, 2025 at 07:05:23PM -0300, Arnaldo Carvalho de Melo wrote:
> On Wed, Sep 03, 2025 at 12:49:49PM -0300, Arnaldo Carvalho de Melo wrote:
> > 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.
> 
> It is in perf-tools-next/perf-tools-next now (this first reviewed one):
> 
> https://web.git.kernel.org/pub/scm/linux/kernel/git/perf/perf-tools-next.git/log/?h=perf-tools-next

Thanks for doing that.  Please pick up the patch 2 and 3 as well.
Namhyung


  reply	other threads:[~2025-09-05 19:50 UTC|newest]

Thread overview: 16+ 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
2025-09-03 22:05       ` Arnaldo Carvalho de Melo
2025-09-05 19:50         ` Namhyung Kim [this message]
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=aLs_BuzNJZt6Wl2g@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;
as well as URLs for NNTP newsgroup(s).