Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix "foreach" command with "DE" state to display only expected tasks
Currently, the "foreach DE ps -m" command may display "DE" as well as "ZO" state tasks as below: crash> foreach DE ps -m ... [0 00:00:00.040] [ZO] PID: 11458 TASK: ffff91c75680d280 CPU: 7 COMMAND: "ora_w01o_p01mci" [0 00:00:00.044] [ZO] PID: 49118 TASK: ffff91c7bf3e8000 CPU: 19 COMMAND: "oracle_49118_p0" [0 00:00:00.050] [ZO] PID: 28748 TASK: ffff91a7cbde3180 CPU: 2 COMMAND: "ora_imr0_p01sci" [0 00:00:00.050] [DE] PID: 28405 TASK: ffff91a7c8eb0000 CPU: 27 COMMAND: "ora_vktm_p01sci" [0 00:00:00.051] [ZO] PID: 31716 TASK: ffff91a7f7192100 CPU: 6 COMMAND: "ora_p001_p01sci" ... That is not expected behavior, the "foreach" command needs to handle such cases. Let's add a check to determine if the task state identifier is specified and the specified identifier is equal to the actual task state identifier, so that it can filter out the unspecified state tasks. With the patch: crash> foreach DE ps -m [0 00:00:00.050] [DE] PID: 28405 TASK: ffff91a7c8eb0000 CPU: 27 COMMAND: "ora_vktm_p01sci" crash> Signed-off-by: Lianbo Jiang <lijiang@redhat.com>
- Loading branch information