git: kernel - Change fill_kinfo_lwp() and fix top

Matthew Dillon dillon at
Tue Jun 18 23:03:06 PDT 2019

commit 5deae5c64cbddbf476d650cf6d16e0f1981e10d8
Author: Matthew Dillon <dillon at>
Date:   Tue Jun 18 22:59:07 2019 -0700

    kernel - Change fill_kinfo_lwp() and fix top
    * Change fill_kinfo_lwp(), an internal function used by kern_proc.c
      and libkvm, to aggregate lwp data instead of replace it.
      Note that fill_kinfo_proc() will zero the lwp sub-structure and is
      already typically called before zero or more fill_kinfo_lwp() calls,
      so the new aggregation essentially just works even though the API is
      a bit different.
      In addition, when getprocs is told to aggregate lwps the tid field
      will be set to -1 since it is not applicable in the aggregation case.
    * 'top' will now properly aggregate the threads belonging to a process
      when thread mode 'H' is not in effect.
    * Also allow top to display cpu percentages above 100%, since in the
      aggregation case the sum of threads can easily exceed 100% of one core.
    Requested-by: hsw

Summary of changes:
 lib/libkvm/kvm_proc.c     | 10 ++-----
 sys/kern/kern_kinfo.c     | 70 +++++++++++++++++++++++++++++++++++++++--------
 sys/kern/kern_proc.c      | 22 +++++++++++----
 usr.bin/top/m_dragonfly.c |  4 +--
 4 files changed, 81 insertions(+), 25 deletions(-)

DragonFly BSD source repository

More information about the Commits mailing list