Page MenuHomeFreeBSD

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

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

Details

Reviewers
eadler
markj
bcr
Group Reviewers
Restricted Owners Package(Owns No Changed Paths)
manpages
Summary

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

Repository
rS FreeBSD src repository
Lint
Lint OK
Unit
No Unit Test Coverage
Build Status
Buildable 21457
Build 20776: arc lint + arc unit

Event Timeline

farrokhi created this revision.Dec 9 2018, 5:47 PM
Owners added a reviewer: Restricted Owners Package.Dec 9 2018, 5:47 PM
farrokhi updated this revision to Diff 51782.Dec 9 2018, 5:53 PM

Update man page

bcr accepted this revision.Dec 9 2018, 6:19 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
farrokhi updated this revision to Diff 51798.Dec 10 2018, 8:16 AM

Bumped .Dd at the beginning of the man page

This revision now requires review to proceed.Dec 10 2018, 8:16 AM
markj added a comment.Dec 11 2018, 2:10 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?