Page MenuHomeFreeBSD

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

Authored by farrokhi on Dec 9 2018, 5:47 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Mar 4, 10:18 PM
Unknown Object (File)
Mon, Mar 4, 7:44 PM
Unknown Object (File)
Feb 20 2024, 1:59 PM
Unknown Object (File)
Jan 25 2024, 8:54 PM
Unknown Object (File)
Dec 28 2023, 1:57 AM
Unknown Object (File)
Dec 17 2023, 9:04 PM
Unknown Object (File)
Dec 17 2023, 2:42 PM
Unknown Object (File)
Nov 26 2023, 3:57 AM
Subscribers

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 - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 21457
Build 20776: 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?