46 Commits

Author SHA1 Message Date
lizhenlin efba194008 update version to 0.193
Signed-off-by: lizhenlin <lizhenlin2@h-partners.com>
2025-11-12 14:48:40 +08:00
unknown 705c22626b update to v0.190
Signed-off-by: unknown <zhangchun39@huawei.com>
2024-12-06 15:48:16 +08:00
zhanghaibo e660ab2124 upgrade to v0.188
Signed-off-by: zhanghaibo <zhanghaibo0@huawei.com>
Change-Id: I83c8756f5ce0a464b037bc963cfdce43df82921b
2023-04-25 18:45:37 +08:00
Frank Ch. Eigler 6c8b68b024 PR27701: debuginfod client: encourage reused debuginfod_client objects
Client objects now carry long-lived curl handles for outgoing
connections.  This makes it more efficient for multiple sequential
queries, because the TCP connections and/or TLS state info are kept
around awhile, avoiding O(100ms) setup latencies.  debuginfod is
adjusted to take advantage of this for federation.  Other clients
should gradually do this too, perhaps including elfutils itself (in
the libdwfl->debuginfod_client hooks).

A large gdb session with 117 debuginfo downloads was observed to run
twice as fast (45s vs. 1m30s wall-clock time), just in nuking this
extra setup latency.  This was tested via a debuginfod intermediary:
it should be even faster once gdb reuses its own debuginfod_client.

Signed-off-by: Frank Ch. Eigler <fche@redhat.com>
2021-04-30 21:26:27 -04:00
Frank Ch. Eigler a8e925ec75 doc/debuginfod.8: fix wrong parameter name for .deb files in description
One place in the description referred to the parameter for
.deb/.ddeb files as "-D" as opposed to the correct "-U".

Signed-off-by: Andreas Ziegler <andreas.ziegler@fau.de>
2021-04-04 21:57:20 -04:00
Frank Ch. Eigler aa121ea7f1 PR27092: debuginfod low-memory handling
A couple of closely related pieces of work allow more early warning
about low storage/memory conditions:

- New prometheus metrics to track filesystem freespace, and more
  details about some errors.
- Frequent checking of $TMPDIR freespace, to trigger fdcache
  emergency flushes.
- Switch to floating point prometheus metrics, to communicate
  fractions - and short time intervals - accurately.
- Fix startup-time pthread-creation error handling.

Testing is smoke-test-level only as it is hard to create
free-space-limited $TMPDIRs. Locally tested against tiny through
medium tmpfs filesystems, with or without sqlite db also there.  Shows
a pleasant stream of diagnostics and metrics during shortage but
generally does not fail outright.  However, catching an actual
libstdc++- or kernel-level OOM is beyond our ken.

Signed-off-by: Frank Ch. Eigler <fche@redhat.com>
2021-02-05 12:38:50 -05:00
Dmitry V. Levin 920f61ed8c doc: fix spelling typos
filesytem -> filesystem
requries -> requires
hte -> the
recieve -> receive
varients -> variants
preceeded -> preceded

Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
2020-12-11 14:10:16 +01:00
Dmitry V. Levin fc5e808d54 debuginfod: export DEBUGINFOD_SONAME macro in debuginfod.h
Add DEBUGINFOD_SONAME macro to API for use by those of libdebuginfod
clients that would like to dlopen the library in the same way as
__libdwfl_debuginfod_init does.

Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
2020-12-09 20:38:07 +01:00
Mark Wielaard 609053a588 debuginfod-client: Add debuginfod_set_verbose_fd and DEBUGINFOD_VERBOSE
Introduce a new function debuginfod_set_verbose_fd which will produce
verbose output on a given file descriptor (STDERR_FILENO if the
environment variable DEBUGINFOD_VERBOSE is set) showing how the search
for a particular client query is going.

Example output:

debuginfod_find_debuginfo 1234567890
server urls "https://debuginfod.elfutils.org/ http://dbgd.usersys.com:3632/"
checking build-id
checking cache dir /home/mark/.cache/debuginfod_client
using timeout 90
init server 0 https://debuginfod.elfutils.org/
url 0 https://debuginfod.elfutils.org/buildid/1234567890/debuginfo
init server 1 http://dbgd.usersys.com:3632/
url 1 http://dbgd.usersys.com:3632/buildid/1234567890/debuginfo
query 2 urls in parallel
server response HTTP response code said error
url 0 The requested URL returned error: 404 Not Found
server response HTTP response code said error
url 1 The requested URL returned error: 404 Not Found
not found No such file or directory (err=-2)

Signed-off-by: Mark Wielaard <mark@klomp.org>
2020-11-23 16:58:36 +01:00
Frank Ch. Eigler 2237828857 PR26775: make grooming progress visible & interruptible
On very large servers, it's desirable to be able to interrupt a rescan
or groom cycle.  SIGUSR[12] now do that.  (Unfortunately, this is not
practically testable in the testsuite, since these cycles are so fast
on that small dataset.)  We also expose more internal progress count
about the grooming pass, so the administrator can assess possible need
to interrupt.

Signed-off-by: Frank Ch. Eigler <fche@redhat.com>
2020-10-30 10:09:29 -04:00
Mark Wielaard 747a84b60e debuginfod: Translate CURLE_PEER_FAILED_VERIFICATION to ECONNREFUSED.
When a file couldn't be retrieved because of an bad HTTPS certificate
find-debuginfod currently says:
Server query failed: No such file or directory

With this patch it will say:
Server query failed: Connection refused

Signed-off-by: Mark Wielaard <mark@klomp.org>
2020-10-26 22:55:29 +01:00
Frank Ch. Eigler 759ee34bd2 debuginfod-find.1: Fix formatting on wide consoles
The SYNOPSIS section looks less funny with missing
.br directives added in.

Signed-off-by: Frank Ch. Eigler <fche@redhat.com>
2020-10-07 19:19:48 -04:00
Mark Wielaard f7f0cdc59a debuginfod: Add --disable-libdebuginfod and --enable-libdebuginfod=dummy.
Make it possible to build just the debuginfod client or to create a
dummy libdebuginfod that doesn't link against libcurl. The dummy library
can be used for bootstrapping. For testing purposes you can also build
debuginfod against the dummy libdebuginfod but then the debuginfod
server will not be able to do delegation.

Signed-off-by: Mark Wielaard <mark@klomp.org>
2020-07-04 01:30:07 +02:00
Mark Wielaard 7ddceee2b6 debuginfod: Document and sanity check debuginfod_add_http_header format.
Document and sanity check the format of the header string form that can
be passed to debuginfod_add_http_header. It should contain precisely
one colon, which cannot be the first or last character. And the function
should only be used to add optional headers, not replace any existing
standard ones. Anything else isn't supported.

Signed-off-by: Mark Wielaard <mark@klomp.org>
2020-03-30 00:57:30 +02:00
Mark Wielaard b2035c1148 PR25728: disable debuginfod --port=0
When starting debuginfod with --port=0 it would start using a random port
(possibly different for ipv4 and ipv6). This seems to be an accidental
and not very useful functionality. Just produce an error when started
with --port=0.

https://sourceware.org/bugzilla/show_bug.cgi?id=25728

Signed-off-by: Mark Wielaard <mark@klomp.org>
Signed-off-by: Frank Ch. Eigler <fche@redhat.com>
2020-03-28 16:44:41 -04:00
Frank Ch. Eigler 3a9c5da0ac PR25722: debuginfod-find: accept /path/names in place of buildid hex
Extend the debuginfod-find command line interface to permit
/file/names instead of only buildid hexadecimal strings.

v2: move code into debuginfod-find; client API remains buildid only.

Signed-off-by: Frank Ch. Eigler <fche@redhat.com>
2020-03-27 20:47:45 -04:00
Frank Ch. Eigler dbfaf36ac2 debuginfod: User-Agent and X-Forwarded-For header relay
Extend the debuginfod client API with a function to stuff outgoing
headers into libcurl http transfers.  Use this from debuginfod so
federated trees of debuginfod/httpd can trace back to to the
originating client for administrative purposes.  Docs & test included.

Signed-off-by: Frank Ch. Eigler <fche@redhat.com>
2020-03-27 12:44:42 -04:00
Frank Ch. Eigler 6ae21361ab debuginfod: document and workaround fedora31 zstd compression
Old enough (even RHEL8 era) rpm/libarchive tools cannot grok fedora31
zstd-compressed rpms.  Disable those tests if necessary.  Document -Z
based workaround for these debuginfod users.

https://fedoraproject.org/wiki/Changes/Switch_RPMs_to_zstd_compression

Signed-off-by: Frank Ch. Eigler <fche@redhat.com>
2020-03-26 15:00:18 -04:00
Frank Ch. Eigler d63a809da4 PR25548: support canonicalized source-path names in debuginfod webapi
Programs are sometimes compiled with source path names containing
noise like /./ or // or /foo/../, and these survive into DWARF.  This
code allows either raw or canonicalized pathnames in the webapi, by
letting the client pass things verbatim, and letting the server
store/accept both raw and canonicalized path names for source files.
Tests included & docs updated.

Signed-off-by: Frank Ch. Eigler <fche@redhat.com>
Reported-by: Eli Schwartz <eschwartz@archlinux.org>
Tested-by: Eli Schwartz <eschwartz@archlinux.org>
2020-03-26 10:35:38 -04:00
Frank Ch. Eigler 5d67e9d3ea debuginfod client API: add get_url function
This function lets a client know, during or after a progressfn
callback, what the url of the winning outgoing download is/was.

Signed-off-by: Frank Ch. Eigler <fche@redhat.com>
2020-03-22 16:46:16 -04:00
Frank Ch. Eigler b40e255683 debuginfod client API: add get/set user_data functions
Add a pair of functions to associate a void* parameter with a client
object.  Requested by GDB team as a way to pass file names and such
user-interface data through to a progressfn callback.

Signed-off-by: Frank Ch. Eigler <fche@redhat.com>
2020-03-22 16:46:14 -04:00
Aaron Merey e939590219 debuginfod-client: default to XDG cache.
PR25502: debuginfod client should default to XDG cache

Location of client cache now defaults to $XDG_CACHE_HOME/debuginfod_client.
If XDG_CACHE_HOME is not set then fallback to $HOME/.cache/debuginfod_client.
Also maintain backwards compatibility with the previous default path-
if $HOME/.debuginfod_client_cache exists, use that instead of the new
defaults.

Signed-off-by: Aaron Merey <amerey@redhat.com>
2020-02-28 14:21:55 +01:00
Frank Ch. Eigler 37d56e9275 debuginfod PR25583: map -R to -Z.rpm
It was reported that libarchive (bsdtar) at least as far back as rhel7
(3.1.2) can natively process RPM files, so there's no need to mediate
those accesses through rpm2cpio.  There's no noteworthy performance or
testing impact.

Signed-off-by: Frank Ch. Eigler <fche@redhat.com>
Signed-off-by: Mark Wielaard <mark@klomp.org>
2020-02-25 14:30:45 -05:00
Frank Ch. Eigler 577170fc84 PR25375: fdcache prefetching to reduce repeated archive decompression
Introduce new option --fdcache-prefetch to accelerate repeated
queries from the same debuginfo archive.

Signed-off-by: Frank Ch. Eigler <fche@redhat.com>
2020-02-25 12:05:28 -05:00
Konrad Kleine 69660c6a82 debuginfod/doc: Fix typo debuginfo_progressfn_t -> debuginfod_progressfn_t
I've copied the type name for the progress function from the manual and
noticed that it didn't compile...

Signed-off-by: Konrad Kleine <kkleine@redhat.com>
2020-02-12 09:11:10 -05:00
Frank Ch. Eigler 8ef876aa17 debuginfod: generalized archive support
Add a '-Z EXT[=CMD]' option to debuginfod, which lets it scan any given
extension and run CMD on it to unwrap distro archives.  For example,
for arch-linux pacman files, -Z '.tar.zst=zstdcat' lets debuginfod
grok debug and source content in split-debuginfo files.

Signed-off-by: Frank Ch. Eigler <fche@redhat.com>
2020-02-10 11:09:49 -05:00
Mark Wielaard 2319680b33 doc: Fix DEBUGINFOD_PROGRESS description to just mention output on stderr.
An earlier variant of the default progress function could write to any
file. Which is still in the documentation. But the actual implementation
just uses stderr. Fix the documentation to match.

Signed-off-by: Mark Wielaard <mark@klomp.org>
2020-01-12 17:14:52 +01:00
Frank Ch. Eigler 1905518e16 debuginfod: extracted-from-archive file cache
Add a facility to service webapi and dwz/altdebug requests that
resolve to archives via a $TMPDIR file cache.  This permits
instantaneous dwz resolution during -debuginfo rpm scanning, and also
instantanous duplicate webapi requests.  The cache is limited both in
number of entries and in storage space.  Heuristics provide
serviceable defaults.

Signed-off-by: Frank Ch. Eigler <fche@redhat.com>
2020-01-11 22:41:54 -05:00
Frank Ch. Eigler 32ed4e6f8e debuginfod: rework threading model for file/archive scanning
We switch from a thread per supplied PATH, with a semaphore based
concurrency control, to a fixed number of worker threads collecting
the result of a plain directory traversal being put into a work queue.
This allows maximal continuous concurrency, even if the PATH
directories are dramatically differently sized.  There is no more need
to use concurrency-motivated subdirectory wildcards for PATH entries:
just a single top level directory will work fast.  doc & tests incl.
2020-01-11 09:47:02 -05:00
Mark Wielaard b8d85ed024 debuginfod: Use DEBUGINFOD_TIMEOUT as seconds to get at least 100K.
Use just one timeout using CURLOPT_LOW_SPEED_TIME (default 90 seconds)
and CURLOPT_LOW_SPEED_LIMIT (100K).

Signed-off-by: Mark Wielaard <mark@klomp.org>
2020-01-10 00:12:00 +01:00
Frank Ch. Eigler 5de5dc7d1b debuginfod server: support .deb/.ddeb archives
Add support for scanning .deb / .ddeb files, enabled with a new
command line option "-U".  Using a synthetic .deb/.ddeb from a Ubuntu
18 machine, extend the debuginfod testsuite with some .deb processing,
if the dpkg-deb binary is installed.

Signed-off-by: Frank Ch. Eigler <fche@redhat.com>
2019-12-22 20:54:10 -05:00
Frank Ch. Eigler 76ad56c430 debuginfod: usability tweaks, incl. $DEBUGINFOD_PROGRESS client support
This facility allows a default progress-printing function to be
installed if the given environment variable is set.  Some larger usage
experience (systemtap fetching kernels) indicates the default timeout
is too short, so forked it into a connection timeout (default short)
and a transfer timeout (default unlimited).

Signed-off-by: Frank Ch. Eigler <fche@redhat.com>
2019-12-19 09:57:13 -05:00
Mark Wielaard fa0226a78a debuginfod: add client context
Add a mandatory debuginfod_begin()/_end() call pair to manage a client
object that represents persistent but non-global state.  From libdwfl,
dlopen the debuginfod.so client library early on.  This hopefully
makes sure that the code (and the libcurl.so dependency) is loaded
before the program goes into multi-threaded mode.

Signed-off-by: Mark Wielaard <mark@klomp.org>
2019-11-23 01:03:13 +01:00
Frank Ch. Eigler 8d5a05a7f0 debuginfod 5: add /metrics endpoint
This webapi extensions allows admins to hook up debuginfod to a
prometheus-compatible monitoring system for general situational
statistics.  The metrics are simple enough that local curl requests
can give a user a sense of what's going on.  The metrics are
documented as unstable with respect to future versions.
2019-11-23 00:31:26 +01:00
Frank Ch. Eigler 0587c28365 debuginfod 4: symbolic link traversal mode
In order to support file/rpm archives that are organized via symlink
trees, add an "-L" option to debuginfod, meaning about the same as for
find(1) or ls(1): to traverse rather than ignore symlinks.
2019-11-22 23:56:25 +01:00
Frank Ch. Eigler 3d7a08d5d3 debuginfod 3/3: client interruptability
For interactive clients such as gdb, interruptibility is important for
usability during longer downloads.  This patchset adds a
download-progress callback function to the debuginfod client library,
with which a caller app can interrupt a download as well as be
notified of its quantitative progress.
2019-11-22 23:26:21 +01:00
Frank Ch. Eigler e27e30cae0 debuginfod 2/2: server side
Add the server to the debuginfod/ subdirectory.  This is a highly
multithreaded c++11 program (still buildable on rhel7's gcc 4.8,
which is only partly c++11 compliant).  Includes an initial suite
of tests, man pages, and a sample systemd service.

Signed-off-by: Frank Ch. Eigler <fche@redhat.com>
Signed-off-by: Aaron Merey <amerey@redhat.com>
2019-11-22 23:02:29 +01:00
Aaron Merey 288f6b199a debuginfod 1/2: client side
Introduce the debuginfod/ subdirectory, containing the client for a
new debuginfo-over-http service, in shared-library and command-line
forms.  Two functions in libdwfl make calls into the client library to
fetch elf/dwarf files by buildid, as a fallback.  Instead of normal
dynamic linking (thus pulling in a variety of curl dependencies),
the libdwfl hooks use dlopen/dlsym.  Server & tests coming in patch 2.

Signed-off-by: Aaron Merey <amerey@redhat.com>
Signed-off-by: Frank Ch. Eigler <fche@redhat.com>
2019-11-22 22:49:21 +01:00
Mark Wielaard 08986c35d7 readelf: Add --dyn-sym option.
It is already possible to select the symbol table to print by name,
using --symbols=SECTION. This allows printing the dynamic symbol table
with --symbols=.dynsym. binutils readelf allows printing just the
dynamic symbol table by type using --dyn-sym. Add the same option
and document it. Also add a testcase to show --symbols=.dynsym and
--dyn-sym produce the same output.

Signed-off-by: Mark Wielaard <mark@klomp.org>
2019-09-10 15:45:53 +02:00
Mark Wielaard c950e8a995 config: Fix spec file, add manpages and new GFDL license.
Now that we have manpages lets also package them. Rename COPYING to
COPYING-GFDL to make it not clash with the top-level COPYING file.
Also fix up the spec file so it can be used to create a srpm again.
Add eu-stack to the file list.

Signed-off-by: Mark Wielaard <mark@klomp.org>
2019-08-29 18:17:11 +02:00
Ben Woodard f0a5176739 Begin adding some docs to elfutils
- Added doc/README
- Updated doc/ChangeLog
- Added a eu-readelf manpage based on the one from binutils.
- Added a brand new manpage for eu-elfclassify the new utility.
- Add some new files in the doc directory and sync makefile with upstream.
- Reenable the compilation of doc directory.
- Disable sgml file building
- Build man pages the automake way

Since V1
- Put man pages in the proper directories.
- Added copy of Gnu Free Documentation License
- Modified eu-readelf.1 man page to match the supported options.

Signed-off-by: Ben Woodard <woodard@redhat.com>
Signed-off-by: Mark Wielaard <mark@klomp.org>
2019-08-27 13:42:50 +02:00
Mark Wielaard de2ed97f33 Update name, license and contributor policy.
* Change name from "Red Hat elfutils" to "elfutils".
* Update license of standalone tools and test from GPLv2 to GPLv3+.
* Change license of libraries from GPLv2+exception to GPLv2/LGPLv3+.
* Add Developer Certificate of Origin based contributor policy.

top-level:

- COPYING: Upgraded from GPLv2 to GPLv3.
- CONTRIBUTING, COPYING-GPLv2, COPYING-LGPLv3: New files.
- NEWS: Added note about new contribution and license policy.
- Makefile.am: Updated to GPLv3, added new files to EXTRA_DIST.
- configure.ac: Update to GPLv3, changed AC_INIT name to 'elfutils'.

backends, lib, libasm, libcpu, libdw, libdwfl, libebl, libelf:

- All files updated to GPLv2/LGPLv3+. Except some very small files
  (<5 lines) which didn't have any headers at all before, the linker
  .maps files and the libcpu/defs files which only contain data and
  libelf/elf.h which comes from glibc and is under LGPLv2+.

config:

- elfutils.spec.in: Add new License: headers and new %doc files.
- Update all license headers to GPLv2/LGPLv3+ for files used by libs.

src, tests:

- All files updated to GPLv3+. Except for the test bz2 data files, the
  linker maps and script files and some very small files (<5 lines)
  that don't have any headers.

Signed-off-by: Richard Fontana <rfontana@redhat.com>
Signed-off-by: Mark Wielaard <mjw@redhat.com>
2012-06-05 23:12:05 +02:00
Mark Wielaard 5128fb4487 Remove .mtn-ignore and .cvsignore files.
We use .gitignore these days.
2012-06-05 14:55:29 +02:00
Ulrich Drepper 1e9ef50681 Fix FSF address. No exception for libdwarf. 2006-04-04 22:29:06 +00:00
Ulrich Drepper 361df7da6d propagate from branch 'com.redhat.elfutils.roland.pending' (head 4f8fc821345feef58624f0aa5b470d4827577d8c)
to branch 'com.redhat.elfutils' (head 76e26cb54695fd3b21ee8fb5be3036bd68200633)
2006-04-04 21:38:57 +00:00
Ulrich Drepper b08d5a8fb4 Adjust for monotone. 2005-07-26 05:00:05 +00:00