Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   Crash Utility (http://www.linux-archive.org/crash-utility/)
-   -   fix a mistake of output for task's state (http://www.linux-archive.org/crash-utility/703044-fix-mistake-output-tasks-state.html)

qiaonuohan 09-12-2012 07:21 AM

fix a mistake of output for task's state
 
Hello Dave,

Please refer to the attachment. I think the string of state is not
correct.

--
--
Regards
Qiao Nuohan


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

Dave Anderson 09-12-2012 01:18 PM

fix a mistake of output for task's state
 
----- 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@redhat.com
https://www.redhat.com/mailman/listinfo/crash-utility

Dave Anderson 09-12-2012 03:28 PM

fix a mistake of output for task's state
 
----- 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

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


All times are GMT. The time now is 06:08 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.