[Crash-utility] [PATCH v2] Fix the "foreach DE" task identifier displays incorrect state tasks.

HAGIO KAZUHITO(萩尾 一仁) k-hagio-ab at nec.com
Thu Aug 3 04:55:39 UTC 2023


On 2023/08/03 12:23, lijiang wrote:

>>> +             if ((fd->flags & FOREACH_STATE) &&
>>> +                     (!STRNEQ(task_state_string(tc->task, buf, 0),
>> fd->state)))
>>> +                     continue;
>>
>> Thank you for the update.
>>
>> sorry for kind of nitpicking, why is this STRNEQ()?
>>
>>
> When using the task_state_string(), the returned string may end with the
> "EX" in some specific cases, let's also handle this situation.
> 
> char *
> task_state_string(ulong task, char *buf, int verbose)
> {
> ...
>          if (valid && exclusive)
>                  strcat(buf, "EX");  ---> This will add the string "EX" at
> the end of the actual task state string.
>          return buf;
> }

Thanks.

It looks like an old legacy state, but the STRNEQ() is right on the code 
logic.  Applied.
https://github.com/crash-utility/crash/commit/558aecc98987e54b122a09ce0d3c3484b034277f

Thanks,
Kazu


More information about the Crash-utility mailing list