Hello Dave,
I'd like to discuss about the following feature with you and get some advise.
vm command is used to display virtual memory information of a task. But if the
task is exiting(according to crash, 'tsk->flags & PF_EXITING' is true), vm
will
set mm to 0 in get_task_mem_usage(). But the mm may be not freed yet, the mm and
its related virtual information is helpful when debuging a exiting task.
I was considering to ignore the IS_EXITING(task) in get_task_mem_usage() and
if tsk->mm is set to NULL but the mm is not freed(see the following case), then we
can specify the mm manually.
CASE(the code is from kernel):
<cut>
exit_mm()
{
...
tsk->mm = NULL; --> dump after this, and before mmput() freeing mm
...
mmput(mm);
}
<cut>
But I guess it is not a good design to you. So I reconsidered it. What about specifying
mm to vm just like task's pid or address. Then vm can retrieve virtual memory
information
from specified mm directly. And get the owner task from mm->owner.
--
Regards
Qiao Nuohan