From 609053a588a3857bb74a342c8468db77c3af88d4 Mon Sep 17 00:00:00 2001 From: Mark Wielaard Date: Wed, 11 Nov 2020 00:23:08 +0100 Subject: 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 --- doc/ChangeLog | 7 +++++++ doc/debuginfod_find_debuginfo.3 | 17 +++++++++++++++++ 2 files changed, 24 insertions(+) (limited to 'doc') diff --git a/doc/ChangeLog b/doc/ChangeLog index 8c33f174..fdf352e7 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,3 +1,10 @@ +2020-11-11 Mark Wielaard + + * debuginfod_find_debuginfo.3: Document debuginfod_set_verbose_fd + and DEBUGINFOD_VERBOSE. + * debuginfod_set_verbose_fd.3: New redirect to + debuginfod_find_debuginfo.3 + 2020-10-29 Frank Ch. Eigler PR26775 diff --git a/doc/debuginfod_find_debuginfo.3 b/doc/debuginfod_find_debuginfo.3 index eec04e5e..3c6d52f5 100644 --- a/doc/debuginfod_find_debuginfo.3 +++ b/doc/debuginfod_find_debuginfo.3 @@ -50,6 +50,8 @@ OPTIONAL FUNCTIONS .BI " long a, long b);" .BI "void debuginfod_set_progressfn(debuginfod_client *" client "," .BI " debuginfod_progressfn_t " progressfn ");" +.BI "void debuginfod_set_verbose_fd(debuginfod_client *" client "," +.BI " int " fd ");" .BI "void debuginfod_set_user_data(debuginfod_client *" client "," .BI " void *" data ");" .BI "void* debuginfod_get_user_data(debuginfod_client *" client ");" @@ -143,6 +145,15 @@ continue the work, or any other value to stop work as soon as possible. Consequently, the \fBdebuginfod_find_*\fP() function will likely return with an error, but might still succeed. +.SS "VERBOSE OUTPUT" + +The \fBdebuginfod_find_*\fP() functions may use several techniques +to retrieve the requested files, through the cache or through one +or multiple servers or file URLs. To show how a query is handled hte +.BR debuginfod_set_verbose_fd () +can be used to set a particular file descriptor on which verbose +output is given about the query steps and eventual errors encountered. + .SS "USER DATA POINTER" A single \fIvoid *\fP pointer associated with the connection handle @@ -235,6 +246,12 @@ configure a default progressfn. This function will append a simple progress message periodically to stderr. The default is no progress function output. +.TP 21 +.B DEBUGINFOD_VERBOSE +This environment variable governs the default file descriptor for +verbose output. If set, and if a verbose fd is not explicitly set, +then the verbose output will be produced on STDERR_FILENO. + .TP 21 .B DEBUGINFOD_CACHE_PATH This environment variable governs the location of the cache where -- cgit v1.2.1