From: Jiri Olsa <olsajiri@gmail.com>
To: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: Jiri Olsa <olsajiri@gmail.com>,
Alan Maguire <alan.maguire@oracle.com>,
yonghong.song@linux.dev, dwarves@vger.kernel.org, ast@kernel.org,
andrii@kernel.org, bpf@vger.kernel.org, daniel@iogearbox.net,
kernel-team@fb.com, song@kernel.org, eddyz87@gmail.com
Subject: Re: [PATCH v2 dwarves 0/2] Check DW_OP_[GNU_]entry_value for possible parameter matching
Date: Fri, 15 Nov 2024 16:00:15 +0100 [thread overview]
Message-ID: <Zzdh_4Z-e8nl50L6@krava> (raw)
In-Reply-To: <ZzdgNqf14cTjonaF@x1>
On Fri, Nov 15, 2024 at 11:52:38AM -0300, Arnaldo Carvalho de Melo wrote:
> On Fri, Nov 15, 2024 at 10:34:35AM +0100, Jiri Olsa wrote:
> > On Thu, Nov 14, 2024 at 03:58:20PM +0000, Alan Maguire wrote:
> > > Currently, pahole relies on DWARF to find whether a particular func
> > > has its parameter mismatched with standard or optimized away.
> > > In both these cases, the func will not be put in BTF and this
> > > will prevent fentry/fexit tracing for these functions.
> > >
> > > The current parameter checking focuses on the first location/expression
> > > to match intended parameter register. But in some cases, the first
> > > location/expression does not have expected matching information,
> > > but further location like DW_OP_[GNU_]entry_value can provide
> > > information which matches the expected parameter register.
> > >
> > > Patch 1 supports this; patch 2 adds locking around dwarf_getlocation*
> > > as it is unsafe in a multithreaded environment.
> > >
> > > Run ~4000 times without observing a segmentation fault (as compared
> > > to without patch 2, where a segmentation fault is observed approximately
> > > every 200 invokations).
> > >
> > > Changes since v1:
> > >
> > > - used Eduard's approach of using a __dwarf_getlocations()
> > > internal wrapper (Eduard, patch 1).
> > > - renamed function to parameter__reg(); did not rename
> > > __dwarf_getlocations() since its functionality is based around
> > > retrieving DWARF location info rather than parameter register
> > > indices (Yonghong, patch 2)
> > > - added locking around dwarf_getlocation*() usage in dwarf_loader
> > > to avoid segmentation faults reported by Eduard (Jiri, Arnaldo,
> > > patch 2)
> >
> > looks good, I got 95 more functions in clang build including perf_event_read
> > and there's no change in generated functions with gcc build
> >
> > Acked-by: Jiri Olsa <jolsa@kernel.org>
>
> I think since you tested it we can stick this, right?
>
> Tested-by: Jiri Olsa <jolsa@kernel.org>
yep, sure
jirka
>
> > thanks,
> > jirka
> >
> > >
> > > Alan Maguire (1):
> > > dwarf_loader: use libdw__lock for dwarf_getlocation(s)
> > >
> > > Eduard Zingerman (1):
> > > dwarf_loader: Check DW_OP_[GNU_]entry_value for possible parameter
> > > matching
> > >
> > > dwarf_loader.c | 121 +++++++++++++++++++++++++++++++++++++++----------
> > > 1 file changed, 96 insertions(+), 25 deletions(-)
> > >
> > > --
> > > 2.31.1
> > >
prev parent reply other threads:[~2024-11-15 15:00 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-14 15:58 [PATCH v2 dwarves 0/2] Check DW_OP_[GNU_]entry_value for possible parameter matching Alan Maguire
2024-11-14 15:58 ` [PATCH v2 dwarves 1/2] dwarf_loader: " Alan Maguire
2024-11-14 16:51 ` Yonghong Song
2024-11-14 16:59 ` Alan Maguire
2024-11-14 18:21 ` Eduard Zingerman
2024-11-14 20:04 ` Yonghong Song
2024-11-14 21:38 ` Eduard Zingerman
2024-11-15 8:47 ` Jiri Olsa
2024-11-14 15:58 ` [PATCH v2 dwarves 2/2] dwarf_loader: use libdw__lock for Alan Maguire
2024-11-14 18:01 ` Eduard Zingerman
2024-11-15 9:34 ` [PATCH v2 dwarves 0/2] Check DW_OP_[GNU_]entry_value for possible parameter matching Jiri Olsa
2024-11-15 14:52 ` Arnaldo Carvalho de Melo
2024-11-15 15:00 ` Jiri Olsa [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=Zzdh_4Z-e8nl50L6@krava \
--to=olsajiri@gmail.com \
--cc=acme@kernel.org \
--cc=alan.maguire@oracle.com \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=dwarves@vger.kernel.org \
--cc=eddyz87@gmail.com \
--cc=kernel-team@fb.com \
--cc=song@kernel.org \
--cc=yonghong.song@linux.dev \
/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