[PATCH] debuginfod-find: Be a bit less verbose with -v

Mark Wielaard mark@klomp.org
Wed Nov 11 21:24:54 GMT 2020


Hi Frank,

On Wed, 2020-11-11 at 15:57 -0500, Frank Ch. Eigler wrote:
> On Wed, Nov 11, 2020 at 09:31:38PM +0100, Mark Wielaard wrote:
> > debuginfod-find -v enables a progressfn that prints the Progress
> > every
> > time the callback is called. [...]
> > [...]
> > -  fprintf (stderr, "Progress %ld / %ld\n", a, b);
> > [...]
> 
> Another option is to use something close what the builtin env
> DEBUGINFOD_PROGRESS=1 code does: print self-overwriting messages with
> \r rather than \n.  That way many messages can come, but they don't
> overpower the screen.  Really, the main reason I put in this
> progressfn into debuginfod-find was to help test that API within the
> testsuite.  Maybe now, we don't need that option to do anything but
> set the env var, therby using the common code.

It was indeed the specific testcase that made me keep the messages as
is. And it seems a good idea to have a code path that explicitly uses
the api calls instead of relying on the environment variable. Also I
found it a bit more difficult to combine the self-overwriting messages
with other verbose output. See my followup patch for producing verbose
output. I think the "per line" verbose/progress for debuginfod-find -v
works out well.

Cheers,

Mark


More information about the Elfutils-devel mailing list