Re: [PATCH] fix a mistake of output for task's state

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




----- Original Message -----
> Hello Dave,
> 
> Please refer to the attachment. I think the string of state is not
> correct.
> 
> --
> --
> Regards
> Qiao Nuohan
>
>
>   --- a/task.c
>   +++ b/task.c
>   @@ -4633,7 +4633,7 @@ task_state_string(ulong task, char *buf, int verbose)
>
>       if (valid_task_state(_TRACING_STOPPED_) &&
>           (state & _TRACING_STOPPED_)) {
>   -           sprintf(buf, "ST");
>   +           sprintf(buf, "TS");
>               valid++;
>               set++;
>       }
~      

Actually it is shown as "ST" on purpose, because it goes back to 
older kernels where there was no separate "traced" state, and both
"stopped" and "traced" states were essentially the same.  The flag
bits keep changing over time, but the original list of states shown
by "ps" has always been: 

   crash> help ps
   ...
      5. the task state (RU, IN, UN, ZO, ST, DE, SW).
   ...

However I agree with you that for clarity's sake the traced state should
be differentiated.  But I think it would be better to change it to "TR" 
instead of your "TS" suggestion -- note that the verbose translation
used by the "set" command shows "TASK_TRACED":

        if (state & _TRACING_STOPPED_)
                sprintf(&buf[strlen(buf)], "%sTASK_TRACED",
                        count++ ? "|" : "");

I'll update the "ps" help page with the new "TR" identifier.

Thanks,
  Dave

--
Crash-utility mailing list
Crash-utility@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/crash-utility


[Index of Archives]     [Fedora Development]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [KDE Users]     [Fedora Tools]

 

Powered by Linux