]> git.ipfire.org Git - thirdparty/elfutils.git/commit
PR29472: debuginfod: add metadata query webapi, C api, client
authorFrank Ch. Eigler <fche@redhat.com>
Mon, 31 Oct 2022 21:40:01 +0000 (17:40 -0400)
committerFrank Ch. Eigler <fche@redhat.com>
Mon, 3 Jun 2024 15:22:49 +0000 (11:22 -0400)
commitd47d93b1049ecfad2f9bb9db30dc630c3d6131ca
treef5b2beb0c35c98d0d6d3084ffafe1e6f0371861e
parentf4d79637f994457b915af5d8a52b922453f6e6fe
PR29472: debuginfod: add metadata query webapi, C api, client

This patch extends the debuginfod API with a "metadata query"
operation.  It allows clients to request an enumeration of file names
known to debuginfod servers, returning a JSON response including the
matching buildids.  This lets clients later download debuginfo for a
range of versions of the same named binaries, in case they need to to
prospective work (like systemtap-based live-patching).  It also lets
server operators implement prefetch triggering operations for popular
but slow debuginfo slivers like kernel vdso.debug files on fedora.

Implementation requires a modern enough json-c library, namely 0.11,
which dates from 2014.  Without that, debuginfod client/server bits
will refuse to build.

% debuginfod-find metadata file /bin/ls
% debuginfod-find metadata glob "/usr/local/bin/c*"

Refactored several functions in debuginfod-client.c, because the
metadata search logic is different for multiple servers (merge all
responses instead of first responder wins).

Documentation and testing are included.

Signed-off-by: Ryan Goldberg <rgoldber@redhat.com>
Signed-off-by: Frank Ch. Eigler <fche@redhat.com>
18 files changed:
NEWS
config/elfutils.spec.in
configure.ac
debuginfod/Makefile.am
debuginfod/debuginfod-client.c
debuginfod/debuginfod-find.c
debuginfod/debuginfod.cxx
debuginfod/debuginfod.h.in
debuginfod/libdebuginfod.map
doc/Makefile.am
doc/debuginfod-client-config.7
doc/debuginfod-find.1
doc/debuginfod.8
doc/debuginfod_find_debuginfo.3
doc/debuginfod_find_metadata.3 [new file with mode: 0644]
tests/Makefile.am
tests/debuginfod-subr.sh
tests/run-debuginfod-find-metadata.sh [new file with mode: 0755]