[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: dd SIGUSR1 race
From: |
Federico Simoncelli |
Subject: |
Re: dd SIGUSR1 race |
Date: |
Tue, 30 Sep 2014 11:00:48 -0400 (EDT) |
----- Original Message -----
> From: "Pádraig Brady" <address@hidden>
> To: "Federico Simoncelli" <address@hidden>
> Cc: "Coreutils" <address@hidden>
> Sent: Monday, September 29, 2014 1:32:48 PM
> Subject: Re: dd SIGUSR1 race
>
> On 09/26/2014 06:39 PM, Federico Simoncelli wrote:
> > ----- Original Message -----
> >> From: "Pádraig Brady" <address@hidden>
> >> To: "Federico Simoncelli" <address@hidden>
> >> Cc: "Bernhard Voelker" <address@hidden>, "Coreutils"
> >> <address@hidden>
> >> Sent: Friday, September 26, 2014 6:05:33 PM
> >> Subject: Re: dd SIGUSR1 race
> >>
> >>> Many other commands are providing an explicit flag: wget, curl,
> >>> qemu-img, etc.
> >>
> >> Yes, I see qemu-img supports both.
> >> If not too invasive, we could accept a status=progress patch to output
> >> stats every approx 1s (noting the caveats of being blocked behind large
> >> reads/writes)
> >
> > I'll try to investigate if I can easily use sigusr1 with your new patch,
> > meanwhile I came up with a patch adding status=progress.
> >
> > It's a simple draft and I am open to hear all comments about it,
> > especially on what's the format to report the progress.
> >
> > For example qemu-img uses '\r' so that the output is always on the same
> > line.
> >
> > Patch in attachment.
>
> I like the idea of '\r', but it involved a little adjustment to deal with.
> I've updated your patch (attached) with the following changes:
>
> - Augmented the texinfo and NEWS entries
> - Added documentation to --help/man
> - Adjusted periodic output to use \r rather than \n
> - Used gethrxtime() rather than clock_gettime() which is not generally
> available
> - Avoided a race and CPU spinning in the test
Awesome, thanks! I tried the patch and the behavior is correct in all
the scenario I tested (status=progress, various signals SIGINT/TERM,
etc.)
LGTM
--
Federico
- Re: dd SIGUSR1 race, (continued)
- Re: dd SIGUSR1 race, Bernhard Voelker, 2014/09/26
- Re: dd SIGUSR1 race, Pádraig Brady, 2014/09/26
- Re: dd SIGUSR1 race, Pádraig Brady, 2014/09/26
- Re: dd SIGUSR1 race, Federico Simoncelli, 2014/09/26
- Re: dd SIGUSR1 race, Pádraig Brady, 2014/09/26
- Re: dd SIGUSR1 race, Federico Simoncelli, 2014/09/26
- Re: dd SIGUSR1 race, Pádraig Brady, 2014/09/29
- Re: dd SIGUSR1 race, Bernhard Voelker, 2014/09/29
- Re: dd SIGUSR1 race, Pádraig Brady, 2014/09/29
- Re: dd SIGUSR1 race, Pádraig Brady, 2014/09/30
- Re: dd SIGUSR1 race,
Federico Simoncelli <=
- Re: dd SIGUSR1 race, Bernhard Voelker, 2014/09/26
- Re: dd SIGUSR1 race, Pádraig Brady, 2014/09/26