[Crash-utility] [PATCH] Fix "ps/vm" commands to display the memory usage for exiting tasks

lijiang lijiang at redhat.com
Fri Aug 25 02:40:38 UTC 2023


On Fri, Aug 25, 2023 at 9:15 AM HAGIO KAZUHITO(萩尾 一仁) <k-hagio-ab at nec.com>
wrote:

> >>> -     if (!task_mm(task, TRUE))
> >>> +     if (!(addr = task_mm(task, TRUE)))
> >>> +             return;
> >>> +
> >>> +     if (!readmem(addr + OFFSET(mm_struct_mm_count), KVADDR,
> &mm_count,
> >>> +             sizeof(int), "mm_struct mm_count", RETURN_ON_ERROR))
> >>> +             return;
>
> tt->mm_struct is filled in task_mm(), I think we can use this:
>
>    mm_count = INT(tt->mm_struct + OFFSET(mm_struct_mm_count));
>
> The following code in get_task_mem_usage() also use this.
>

Good idea. I will post v2 with this change later.

Thanks.
Lianbo


>
> Thanks,
> Kazu
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/crash-utility/attachments/20230825/335338dd/attachment.htm>


More information about the Crash-utility mailing list