[Crash-utility] [PATCH] fix a mistake of output for task's state
Dave Anderson
anderson at redhat.com
Wed Sep 12 15:28:35 UTC 2012
----- Original Message -----
>
>
> ----- 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
And related to the above, I'll also update the "foreach" command's state
qualifier to accept a "TR" option. As it is now, there's no way to
filter out traced tasks.
Dave
More information about the Crash-utility
mailing list