public inbox for archer@sourceware.org
 help / color / mirror / Atom feed
From: Tom Tromey <tromey@redhat.com>
To: Daniel Jacobowitz <drow@false.org>
Cc: archer@sourceware.org
Subject: Re: Initial psymtab replacement results
Date: Tue, 15 Dec 2009 23:39:00 -0000	[thread overview]
Message-ID: <m3ws0nn6y5.fsf@fleche.redhat.com> (raw)
In-Reply-To: <20091214230947.GA31362@caradoc.them.org> (Daniel Jacobowitz's message of "Mon, 14 Dec 2009 18:09:47 -0500")

>>>>> "Daniel" == Daniel Jacobowitz <drow@false.org> writes:

Daniel> Or you could drag another bit of GDB into this century, and use
Daniel> SQLite or some other in-process database.

I played with this a bit today.  In particular I changed my gdb to dump
an SQLite database from the psymtabs.  I used this schema:

CREATE TABLE IF NOT EXISTS index_version (version INTEGER);
CREATE TABLE IF NOT EXISTS objfile (name, mtime INTEGER, size INTEGER,
                inode INTEGER);
CREATE TABLE IF NOT EXISTS cus (offset INTEGER UNIQUE);
CREATE TABLE IF NOT EXISTS filenames (cu INTEGER REFERENCES cus (offset),
                name, is_primary INTEGER);
CREATE TABLE IF NOT EXISTS symbols (cu INTEGER REFERENCES cus (offset),
                name NOT NULL, psym_domain INTEGER, psym_class INTEGER,
                is_public INTEGER);
CREATE INDEX IF NOT EXISTS byname ON symbols (name);
CREATE TABLE IF NOT EXISTS addresses (cu INTEGER REFERENCES cus (offset),
                low INTEGER, high INTEGER);


The 'byname' index really slows down populating the database.  It took
more than a minute to write out the database for gdb.  However, without
the index, name lookups are extremely slow (as in, I can count to 2
seconds when running a select command in sqlite3).

Maybe I'm misusing SQLite somehow, I'll try to look at this a little
more.  I'm not an SQL wizard, so if I've done something weird, please
let me know, as I'm sure there was no good reason for it.

The other issue is that the resulting database is very big.  For
example, the database for gdb is 72M, but the gdb executable itself is
119M.

I didn't write the reader side of this yet, but that won't be too bad.

I guess one idea would be to write the database in a background thread.
Or just not write it at all by default.

Daniel> Mappable data structures are tricky; one thing I'd definitely
Daniel> insist on is host neutrality.  IMO that is not optional.

Yeah, that does make it trickier.


I'm starting to get a bit discouraged by this project.  I think at this
point we've got strikes against all the ideas:

* .debug_pub*.  These require DWARF extensions and GCC bug fixes, don't
  work nicely with comdat or the other (planned) post-processors.

* .debug_gnu_index.  Pretty much the same problems except that we're
  also inventing it ourselves.

* Mappable data structure.  A pain to make host-independent; and I
  suspect that would kill performance.

* SQLite.  Too big and too slow to create.


I suppose we could write out the equivalent of .debug_gnu_index, only
not as an ELF section, and not as a mappable data structure.  We already
know that will perform adequately.  This won't meet all of my goals but
it would definitely help some use cases.

Maybe I can add code to do a psymtab-like scan of .debug_info in a
background thread.  That might make "gdb gdb" feel faster.


I think we ought to change GCC to drop the .debug_pub* sections (and
maybe .debug_aranges), at least on Linux.  AFAIK they aren't used by
anything, and indeed are barely usable due to historic bugs -- so they
are just wasting time and space.

Let me know what you think,
Tom

  reply	other threads:[~2009-12-15 23:39 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-10 21:54 Tom Tromey
2009-12-11 23:10 ` Tom Tromey
2009-12-11 23:59   ` Daniel Jacobowitz
2009-12-14 22:40     ` Tom Tromey
2009-12-14 23:09       ` Daniel Jacobowitz
2009-12-15 23:39         ` Tom Tromey [this message]
2009-12-16  3:01           ` Roland McGrath
2009-12-16 18:20             ` Tom Tromey
2009-12-16 18:57               ` Roland McGrath
2009-12-16 19:46                 ` Tom Tromey
2009-12-16 19:52                   ` Roland McGrath
2009-12-16 18:11           ` Daniel Jacobowitz
2009-12-16 19:31             ` Tom Tromey
2009-12-23 18:29           ` Tom Tromey
2009-12-23 18:35             ` Daniel Jacobowitz
2009-12-24 17:07             ` Tom Tromey
2010-01-06 23:05               ` Tom Tromey
2009-12-17 16:39         ` Paul Pluzhnikov
2009-12-17 16:53           ` Daniel Jacobowitz
2009-12-17 17:20             ` Paul Pluzhnikov
2009-12-17 18:16               ` Daniel Jacobowitz
2009-12-18 23:58                 ` Tom Tromey
2009-12-21 13:54                   ` Daniel Jacobowitz
2009-12-21 21:29                     ` Tom Tromey
2009-12-15  1:04       ` Roland McGrath
2009-12-15 18:36         ` Tom Tromey

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=m3ws0nn6y5.fsf@fleche.redhat.com \
    --to=tromey@redhat.com \
    --cc=archer@sourceware.org \
    --cc=drow@false.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).