[Crash-utility] [PATCH] display ST when using ps -l

qiaonuohan qiaonuohan at cn.fujitsu.com
Thu Mar 8 02:12:55 UTC 2012


At 2012-3-7 23:36, Dave Anderson wrote:
>
>
> ----- Original Message -----
>> Hello Dave,
>>
>> I was recommended to add the display of ST when using ps -l. Because it
>> is simple, so I made the patch at first and then talk about the merit of
>> patch with you.
>>
>> The display is like below:
>>
>> crash>  ps -l
>> [100126284069406]  PID: 2389   TASK: ffff88047416aa80  ST:IN  CPU: 12  COMMAND: "kondemand/12"
>> [100126285814043]  PID: 795    TASK: ffff880470cb3540  ST:UN  CPU: 0   COMMAND: "jbd2/sda2-8"
>> [100126284061076]  PID: 2377   TASK: ffff88047426c100  ST:IN  CPU: 0   COMMAND: "kondemand/0"
>> [100126284058337]  PID: 70050  TASK: ffff88045beaeac0  ST:RU  CPU: 3   COMMAND: "crash"
>> [100126285834369]  PID: 70781  TASK: ffff88046929e100  ST:RU  CPU: 0   COMMAND: "dd"
>> ...
>>
>> I think "ps -l", which displays task sorted by last_run/timestamp, is
>> concerning about the state of the task. Taking it into consideration, on
>> a live system with original code, we use "ps -l" to show the sorted
>> tasks at first, then use "ps" to display the state. The two pieces of
>> information in such situation are not consonant. This is the reason why
>> ST is needed.
>
> Your patch is unacceptable as-is because it changes the task header display
> for *all* context-specific commands, like "bt", "vm", "files", "task", etc.
>
> But it does make sense that the task's timestamp and its state could
> be correlated by "ps -l" output.  Maybe something like this, with an
> explanation in the ps help page?:
>
>    crash>  ps -l
>    [100126284069406] [IN]  PID: 2389   TASK: ffff88047416aa80  CPU: 12  COMMAND: "kondemand/12"
>    [100126285814043] [UN]  PID: 795    TASK: ffff880470cb3540  CPU: 0   COMMAND: "jbd2/sda2-8"
>    [100126284061076] [IN]  PID: 2377   TASK: ffff88047426c100  CPU: 0   COMMAND: "kondemand/0"
>    [100126284058337] [RU]  PID: 70050  TASK: ffff88045beaeac0  CPU: 3   COMMAND: "crash"
>    [100126285834369] [RU]  PID: 70781  TASK: ffff88046929e100  CPU: 0   COMMAND: "dd"
>    ...

String like "PID: 2389   TASK: ffff88047416aa80  CPU: 12  COMMAND: 
"kondemand/12"" is printed by a function. The change of the function, 
which I made in the last patch, causes the change of other commands. The 
new patch will add "ST:.." out of the command, the output is like below:

[2567398667393]  ST:IN  PID: 154    TASK: ffff880475292b40  CPU: 0 
COMMAND: "kblockd/0"
[2567399925204]  ST:IN  PID: 4380   TASK: ffff880464665500  CPU: 1 
COMMAND: "qemu-system-x86"
[2567396569308]  ST:IN  PID: 4411   TASK: ffff880467227500  CPU: 1 
COMMAND: "qemu-system-x86"
[2567395016839]  ST:RU  PID: 5338   TASK: ffff880464664ac0  CPU: 2 
COMMAND: "crash"



>
> Dave
>
>
>
>
> --
> Crash-utility mailing list
> Crash-utility at redhat.com
> https://www.redhat.com/mailman/listinfo/crash-utility
>
>


-- 
--
Regards
Qiao Nuohan
--------------------------------------------------
Qiao Nuohan
Development Dept.I
Nanjing Fujitsu Nanda Software Tech. Co., Ltd.(FNST)
No. 6 Wenzhu Road, Nanjing, Nanjing, 210012, China
TEL: +86+25-86630566-8526 FUJITSU
INTERNAL: 7998-8526 FAX: +86+25-83317685
EMail: qiaonuohan at cn.fujitsu.com
--------------------------------------------------
This communication is for use by the intended
recipient(s) only and may contain information that
is privileged, confidential and exempt from
disclosure under applicable law. If you are not an
intended recipient of this communication, you are
hereby notified that any dissemination,
distribution or copying hereof is strictly
prohibited. If you have received this communication
in error, please notify me by reply e-mail,
permanently delete this communication from your
system, and destroy any hard copies you may have
printed


-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: ps.patch
URL: <http://listman.redhat.com/archives/crash-utility/attachments/20120308/23aa4e98/attachment.ksh>


More information about the Crash-utility mailing list