Page MenuHomeFreeBSD

top(1): Add ability to sort by cpu core number
Needs ReviewPublic

Authored by farrokhi on Dec 9 2018, 5:47 PM.


Group Reviewers
Restricted Owners Package(Owns No Changed Paths)

When binding processes/threads to certain cpu cores, being able to sort top(1) output by core number would be very useful. This patch adds the ability to sort the top(1) output by cpu core.

Test Plan
  • Apply the patch
  • Run top -o core

Diff Detail

rS FreeBSD src repository - subversion
Lint OK
No Unit Test Coverage
Build Status
Buildable 21470
Build 20788: arc lint + arc unit

Event Timeline

Owners added a reviewer: Restricted Owners Package.Dec 9 2018, 5:47 PM
bcr added a subscriber: bcr.

You need to bump the .Dd at the beginning of the man page when making the commit as this is a content change. The change itself looks good from the manpage side of things.

This revision is now accepted and ready to land.Dec 9 2018, 6:19 PM

Bumped .Dd at the beginning of the man page

This revision now requires review to proceed.Dec 10 2018, 8:16 AM

I would suggest explaining the difference between -o cpu and -o core in the description of the -o option.

I find it odd to use ki_lastcpu in the sort key. On a system with many idle processes it means that we will not show a busy thread on CPU 0. For your use-case, shouldn't a running thread always come before an idle thread?