From: Andrew Burgess <aburgess@redhat.com>
To: Ilya Leoshkevich via Gdb-patches <gdb-patches@sourceware.org>,
Tom Tromey <tromey@adacore.com>
Cc: Ulrich Weigand <ulrich.weigand@de.ibm.com>,
Andreas Arnez <arnez@linux.ibm.com>,
Ilya Leoshkevich <iii@linux.ibm.com>,
gdb-patches@sourceware.org
Subject: Re: [PATCH v2] gdb: do not add const sections to the section map
Date: Mon, 23 May 2022 18:22:57 +0100 [thread overview]
Message-ID: <87k0aci2oe.fsf@redhat.com> (raw)
In-Reply-To: <87mtf8i3e2.fsf@redhat.com>
Andrew Burgess <aburgess@redhat.com> writes:
> I know there's been a little discussion of this patch on the v1 thread,
> but I wanted to record my thoughts, and here seemed the better place.
>
> Ilya Leoshkevich via Gdb-patches <gdb-patches@sourceware.org> writes:
>
>> From: Ulrich Weigand <ulrich.weigand@de.ibm.com>
>>
>> build_objfile_section_table () creates four synthetic sections, which
>> significantly slow down section map sorting. This is especially
>> noticeable when debugging JITs that report a lot of objfiles. Since
>> these sections are not useful for find_pc_section (), do not add them
>> to the section map.
>
> This description could really be fleshed out a little more.
>
> You say "which significantly slow down section map sorting", but I'd
> like this to say which sort(s), in which function(s), otherwise I'm
> expected to either know, or go figure it out myself.
>
> You then jump to say the sections are not useful for "find_pc_section",
> but it's not immediately obvious how that relates to the change you're
> making.
>
> I think you should spell out that insert_section_p is only used by
> update_section_map, which updates the struct objfile_pspace_info
> sections table, which is only used from find_pc_section. Then you'd
> need to explain why non of these sections can ever be returned from
> find_pc_section, though it's not clear (from the discussion on the v1
> thread) if the ABS section might be returned in some cases or not..
>
> I tracked down the patch which I think originally added these synthetic
> sections, though I don't know if this helps much:
>
> https://sourceware.org/pipermail/gdb-patches/2013-February/100257.html
>
>
>> ---
>> v1: https://sourceware.org/pipermail/binutils/2022-May/120863.html
>> v1 -> v2: Fix code style, post to the correct mailing list (Andrew).
>>
>> gdb/objfiles.c | 5 +++++
>> 1 file changed, 5 insertions(+)
>>
>> diff --git a/gdb/objfiles.c b/gdb/objfiles.c
>> index 80f68fda1c1..8a297c57530 100644
>> --- a/gdb/objfiles.c
>> +++ b/gdb/objfiles.c
>> @@ -1005,6 +1005,11 @@ insert_section_p (const struct bfd *abfd,
>
> You'll need to update the comment just before this function.
>
>> if ((bfd_section_flags (section) & SEC_THREAD_LOCAL) != 0)
>> /* This is a TLS section. */
>> return 0;
>> + if (bfd_is_const_section (section))
>> + {
>> + /* This is one of the global *ABS*, *UND*, *IND*, or *COM* sections. */
>> + return 0;
>> + }
>>
>> return 1;
>> }
>
> The final thing I think you need to add with this patch is some
> testing. We don't have much (that I'm aware of) in the way of
> performance testing, but what we can do, is add a mechanism by which we
> can gather performance data.
>
> Below you will find a patch that extends one of the existing JIT tests
> to gather performance data. I tried this before and after applying your
> patch, and I can confirm that the performance improvement with your
> change is significant. I think something like this should be included
> with this patch.
FYI, here's a graph of the performance change I'm seeing when loading
500 JIT ELF files:
https://ibb.co/kQrGjtb
Thanks,
Andrew
next prev parent reply other threads:[~2022-05-23 17:23 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-17 20:03 Ilya Leoshkevich
2022-05-23 17:07 ` Andrew Burgess
2022-05-23 17:22 ` Andrew Burgess [this message]
2022-05-23 19:13 ` Pedro Alves
2022-05-24 8:17 ` Andrew Burgess
2022-05-24 8:53 ` Ilya Leoshkevich
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=87k0aci2oe.fsf@redhat.com \
--to=aburgess@redhat.com \
--cc=arnez@linux.ibm.com \
--cc=gdb-patches@sourceware.org \
--cc=iii@linux.ibm.com \
--cc=tromey@adacore.com \
--cc=ulrich.weigand@de.ibm.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 read-only IMAP folder(s) and NNTP newsgroup(s).