Re: [PATCH 2/8] perf debuginfo: Fetch debuginfo keyed by build ID using debuginfod

From: Arnaldo Carvalho de Melo

Date: Sun Sep 13 2026 - 21:55:52 EST


On Sun, Sep 13, 2026 at 06:34:44PM -0700, Namhyung Kim wrote:
> On Sun, Sep 13, 2026 at 07:28:14PM -0300, Arnaldo Carvalho de Melo wrote:
> > From: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>

<SNIP>

> > Querying servers, possibly third party ones, sends off-box the build
> > IDs of the binaries being analysed and a fetch can take a while, so
> > this is opt-out: on by default, off with --no-debuginfod, with
> > core.debuginfod=false, per tool with report.debuginfod and
> > top.debuginfod, and, since users that set buildid.dir to /dev/null
> > (e.g. Linus) or otherwise turn the local build-id cache off clearly
> > don't want fetched files stored on the box, off too in that case.
> >
> > When a fetch is in progress in a terminal, stdio, the way it prints
> > progress is how one gets out of it: 's' aborts the current fetch via
> > the debuginfod client's progress callback protocol and remembers the
> > build ID, so that the rest of the session doesn't ask for it again,
> > the user may have skipped it for being too big; 'd' additionally
> > disables debuginfod for the rest of the session and points at 'perf
> > config core.debuginfod=false' to make that permanent -- rewriting the
> > user's ~/.perfconfig from a keypress would silently drop its comments
> > -- and SIGINT/SIGTERM are intercepted while the terminal is in raw
> > mode, so that it is restored and the signal is re-raised when the user
> > interrupts a fetch.

<SNIP>

> > +++ b/tools/perf/builtin-annotate.c
> > @@ -733,6 +733,8 @@ int cmd_annotate(int argc, const char **argv)
> > OPT_BOOLEAN(0, "stdio2", &annotate.use_stdio2, "Use the stdio interface"),
> > OPT_BOOLEAN(0, "ignore-vmlinux", &symbol_conf.ignore_vmlinux,
> > "don't load vmlinux even if found"),
> > + OPT_BOOLEAN(0, "debuginfod", &symbol_conf.debuginfod,
> > + "fetch debuginfo keyed by build ID from the debuginfod servers, on by default, use --no-debuginfod to turn off"),
>
> I'm not sure what would be the good default. But with this, it can slow
> down the process especially when the binary is not in the debuginfod.

That is why it allows the user to press 's' to skip it or 'd' to do a
one-time only disablement of this feature.

This is similar to gdb, that at session start asks if the debuginfo
files for the binary and its libraries should be downloaded, well, a bit
better because it allows the user to completely disable this at first
sight by pressing 'd'.

It also already honours configs that disable the ~/.debug cache.

- Arnaldo

> Thanks,
> Namhyung
>
>
> > OPT_STRING('k', "vmlinux", &symbol_conf.vmlinux_name,
> > "file", "vmlinux pathname"),
> > OPT_BOOLEAN('m', "modules", &symbol_conf.use_modules,