[Crash-utility] [PATCH] RESEND: Suppress lkcd_speedo() spinner in redirected output
Sam Watters
watters.sam at gmail.com
Thu Feb 12 17:27:11 UTC 2015
> On Feb 12, 2015, at 10:03 AM, Dave Anderson <anderson at redhat.com> wrote:
>
>
>
> ----- Original Message -----
>> Resent using a benign email client
>>
>> When redirecting output to a file or script the 'spinner' written by the
>> lkcd_speedo() function complicates parsing output.
>>
>> Currently the spinner is only suppressed if crash is run with the '-s'
>> option or the command 'set silent on' has been executed. The change in
>> this patch suppresses the spinner when the output is redirected to a
>> pipe or file.
>>
>> ---
>> diff -Nurp crash-7.1.0//lkcd_common.c crash-7.1.0+//lkcd_common.c
>> --- crash-7.1.0//lkcd_common.c 2015-02-06 12:44:11.000000000 -0600
>> +++ crash-7.1.0+//lkcd_common.c 2015-02-11 13:50:11.000000000 -0600
>> @@ -623,7 +623,8 @@ lkcd_speedo(void)
>> {
>> static int i = 0;
>>
>> - if (pc->flags & SILENT) {
>> + if (pc->flags & SILENT ||
>> + pc->redirect & (REDIRECT_TO_PIPE | REDIRECT_TO_FILE)) {
>> return;
>> }
>>
>>
>
> I wish the LKCD folks never put that thing in there to begin with.
>
> Without thinking about it, I tested the patch by simply doing this:
>
> $ crash vmlinux vmcore > /tmp/output
>
> and of course it doesn't even work in that case -- which would seem
> to be as desirable as doing it for individual commands.
>
> I would accept a patch that removes the function entirely.
>
> Would anybody object to that?
>
> Dave
I prefer it removed, such a patch will be posted later today unless anyone objects before I post.
Thank you,
— Sam
More information about the Crash-utility
mailing list