public inbox for elfutils@sourceware.org
 help / color / mirror / Atom feed
From: Daniel Thornburgh <dthorn@google.com>
To: elfutils-devel@sourceware.org
Subject: Local Build ID Directory Lookup (DEBUGINFOD_LOCAL_PATH)
Date: Wed, 31 May 2023 15:17:36 -0700	[thread overview]
Message-ID: <CAEdiOyeCSvpUijvZwJ=W2ncsGokefdm8z3yKVG+u4jkAgXcumw@mail.gmail.com> (raw)

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

Hi elfutils-devel@,

I've been working on adding debuginfod support to various LLVM utilities,
while simultaneously setting up production use of debuginfod for a managed
developer environment.

One issue that keeps cropping up is that there's often quite a few places
to get debug files from locally, in addition to various remote backends.
For example, the output of local build systems, prebuilt packages and
tarballs that a developer is working on, etc.

One of the best things about debuginfod is that you can set up a service
once, then point an astonishingly wide array of tools at the server, with
one configuration.

This isn't the case for files available locally, but there is some prior
art: GDB's build ID directory layout (commonly
`/usr/lib/debug/.build-id/<first 2 chars of build ID>/<remainder of build
ID>`). GDB has a flag to control this (`--with-separate-debug-dir`), but
that flag isn't shared by other tools. For example, binutils supports this
layout, but it simply hardcodes a list of directories to search for, with
no way to extend or override it. LLVM also supports this, but has a
differently named flag for it.

Local files can be served to localhost using a debuginfod server, but this
incurs the overhead of transferring the files over a local socket on first
access, and the much worse overhead of storing an additional copy of the
file on disk in the debuginfod cache. With sufficiently large projects,
this gets pretty rough.

It would be really nice if there were, a DEBUGINFOD_LOCAL_PATH environment
variable that provided a colon-separated list of directories in the GDB
`.build-id/<xx>/<xxxxxx>` format to locally fetch files out of before
attempting remote servers. This would allow imbuing local build ID fetching
to tools that wouldn't otherwise support it, with one common configuration
language for how to do it.

I did definitely want to raise this on the mailing list before starting to
implement something like this though, since it increases the scope of
libdebuginfod to include local fetching out of more than just out of its
own cache. It would stretch debuginfod towards a more general "library for
obtaining debug info writ large", rather than a straightforward remote
client library.

Daniel Thornburgh | dthorn@google.com

             reply	other threads:[~2023-05-31 22:17 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-31 22:17 Daniel Thornburgh [this message]
2023-05-31 22:35 ` Paul Smith
2023-05-31 22:35 ` Frank Ch. Eigler
2023-05-31 22:45   ` Daniel Thornburgh
2023-05-31 23:04     ` Frank Ch. Eigler
2023-06-01 14:58     ` Frank Ch. Eigler
2023-06-01 20:54       ` Daniel Thornburgh
2023-06-01 21:21         ` Frank Ch. Eigler
2023-06-01 23:51           ` Daniel Thornburgh
2023-05-31 23:44 ` Roland McGrath
2023-06-14 15:57   ` Mark Wielaard
2023-06-14 19:43     ` Roland McGrath
2023-06-19 11:53       ` Mark Wielaard

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='CAEdiOyeCSvpUijvZwJ=W2ncsGokefdm8z3yKVG+u4jkAgXcumw@mail.gmail.com' \
    --to=dthorn@google.com \
    --cc=elfutils-devel@sourceware.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).