Return a reasonable number for top or ps to display for M:N thread,
since there is no direct association between M:N thread and kse, sometimes, a thread does not have a kse, in that case, return a pctcpu from its last kse, it is not perfect, but gives a good number to be displayed.
This commit is contained in:
parent
e31d6d8149
commit
685a6c448a
@ -723,6 +723,8 @@ sched_pctcpu(struct thread *td)
|
||||
struct kse *ke;
|
||||
|
||||
ke = td->td_kse;
|
||||
if (ke == NULL)
|
||||
ke = td->td_last_kse;
|
||||
if (ke)
|
||||
return (ke->ke_pctcpu);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user