From: Jiri Olsa <olsajiri@gmail.com>
To: Alan Maguire <alan.maguire@oracle.com>
Cc: acme@kernel.org, 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, olsajiri@gmail.com
Subject: Re: [PATCH v2 dwarves 0/2] Check DW_OP_[GNU_]entry_value for possible parameter matching
Date: Fri, 15 Nov 2024 10:34:35 +0100 [thread overview]
Message-ID: <ZzcVq8zcdFm0mNxJ@krava> (raw)
In-Reply-To: <20241114155822.898466-1-alan.maguire@oracle.com>
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>
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
>
next prev parent reply other threads:[~2024-11-15 9:34 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 ` Jiri Olsa [this message]
2024-11-15 14:52 ` [PATCH v2 dwarves 0/2] Check DW_OP_[GNU_]entry_value for possible parameter matching Arnaldo Carvalho de Melo
2024-11-15 15:00 ` Jiri Olsa
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=ZzcVq8zcdFm0mNxJ@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.