public inbox for elfutils@sourceware.org
 help / color / mirror / Atom feed
From: Petr Machata <pmachata@redhat.com>
To: elfutils-devel@lists.fedorahosted.org
Subject: Re: Transparent imports of partial units
Date: Fri, 31 Oct 2014 19:26:02 +0100	[thread overview]
Message-ID: <m2sii4ayf9.fsf@redhat.com> (raw)
In-Reply-To: 1414766403.18323.50.camel@bordewijk.wildebeest.org

[-- Attachment #1: Type: text/plain, Size: 2370 bytes --]

Mark Wielaard <mjw@redhat.com> writes:

> So, assuming we can use the long int padding field as Dwarf_Die pointer,

In other words, do we want to keep backward compatibility on LLP64
architectures?  I know Widnows do use this model, do we care?  Any
Unices with this model out there?  FWIW, x32 and (MIPS) n32 are both
ILP32 ABI's.

If this is a concern, we can keep it as is and use the value as an index
into an internal array of cached DIE's instead of raw pointer.

Actually, we may want to choose this way also because it allows us to
take only part of the remaining space, and save the rest for rainy day.
But the savings can't be too aggresive.  We can save a bit by storing
import points at target partial unit instead of putting it all together
at Dwarf, but the space complexity will still be essentially O(number of
DIE's in Dwarf).  I'm reluctantly proposing 24 bits as a "good enough
for everybody" number.  That would allow us to index 16 million import
paths to any partial units, and save 8 bits for whatever else we need.
But I'm not quite convinced myself, I have Dwarfs with 16 million DIE's
in my personal dwgrep test bench.

> each Dwarf_Die returned by dwarf_child_aggregate (ugly name!) that came

Not only dwarf_child_aggregate, also dwarf_siblingof_aggregate.  I think
it's perfectly valid to have an import-point in the middle of sibling
chain, or to have several import points in one chain.

> through an imported_unit DIE would point back to that imported_unit and
> dwarf_sibling_aggregate would propagate that back pointer to each
> sibling. And when there are no more sibling and the back pointer is set,
> then dwarf_sibling_aggregate would continue at the imported DIE pointed
> to and take the next sibling there?

That's the idea.

> I don't immediately see any drawbacks. The only thing I can think of is
> that we might want to provide a equal/identity function for Dwarf_Die,
> in case people want to know whether two "raw" DIEs are really the same
> (although people can already do that given the addr and CU fields I see
> now).

Yeah, they would just have to throw our pointer/index thingy into the
mix.  Having an interface for this seems more prudent, and would allow
us to tweak the exact representation should the need arise (such as when
we run out of space).

Thanks,
Petr

             reply	other threads:[~2014-10-31 18:26 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-31 18:26 Petr Machata [this message]
  -- strict thread matches above, loose matches on Subject: below --
2014-11-07 14:08 Mark Wielaard
2014-10-31 22:48 Josh Stone
2014-10-31 14:40 Mark Wielaard
2014-10-14  0:24 Petr Machata

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=m2sii4ayf9.fsf@redhat.com \
    --to=pmachata@redhat.com \
    --cc=elfutils-devel@lists.fedorahosted.org \
    /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).