[Crash-utility] improve ps performance

Dave Anderson anderson at redhat.com
Fri Sep 5 20:23:19 UTC 2014



----- Original Message -----

> Unfortunately I can't see a obvious way to remove the new
> tc->tgid_context_index field...

Perhaps something like this...

Coming into get_task_mem_usage() function, you could get the 
tgid of the incoming task by calling task_tgid().

Since the tgid_task_context[] array is sorted by tgid number,
perhaps a binary search of the array could quickly find 
the associated entry (or one of the entries if multi-threaded)?
That shouldn't be a very time-consuming process.

Dave




More information about the Crash-utility mailing list