Bug 230872 - top(1): column alignment is off-by-one in per-thread mode
Summary: top(1): column alignment is off-by-one in per-thread mode
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Only Me
Assignee: Eitan Adler
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-08-24 23:48 UTC by Mark Johnston
Modified: 2020-10-07 15:42 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Johnston freebsd_committer freebsd_triage 2018-08-24 23:48:46 UTC
PID USERNAME    THR PRI NICE   SIZE    RES STATE    C   TIME    WCPU COMMAND
 4641 markj        41  20    0  1728M   411M select   3   0:53   2.87% /usr/local/lib/firefox/firefox -contentproc -childID 5 -isForBrowser -prefsLen 13213 -
 2452 markj         5  20    0   158M    10M select   4   0:05   0.62% /usr/local/bin/pulseaudio --start --log-target=syslog
 2421 markj        51  20    0  2353M   994M select   4   4:49   0.59% /usr/local/lib/firefox/firefox -contentproc -childID 1 -isForBrowser -prefsLen 9631 -s
 1285 root          1  20    0    11M  2388K select   3   0:04   0.52% /usr/sbin/moused -p /dev/ums0 -t auto -I /var/run/moused.ums0.pid
 2162 markj         8  20    0   176M   112M select   6   0:30   0.41% /usr/local/bin/X :0 -auth /home/mark/.serverauth.2071 (Xorg)
   12 root         23 -56    -      0   368K WAIT     4   0:24   0.40% [intr]

vs.

  PID USERNAME    PRI NICE   SIZE    RES STATE    C   TIME    WCPU COMMAND
 4641 markj       20    0  1725M   409M select   3   0:28   1.03% /usr/local/lib/firefox/firefox -contentproc -childID 5 -isForBrowser -prefsLen 13213 -sched
 2421 markj       20    0  2352M   993M select   0   3:47   1.02% /usr/local/lib/firefox/firefox -contentproc -childID 1 -isForBrowser -prefsLen 9631 -schedu
 2452 markj       20    0   158M    10M select   4   0:04   0.47% /usr/local/bin/pulseaudio --start --log-target=syslog{pulseaudio}
 1285 root        20    0    11M  2388K select   0   0:04   0.37% /usr/sbin/moused -p /dev/ums0 -t auto -I /var/run/moused.ums0.pid
 2162 markj       20    0   177M   112M select   7   0:28   0.37% /usr/local/bin/X :0 -auth /home/mark/.serverauth.2071 (Xorg){Xorg}
 4641 markj       20    0  1725M   409M uwait    7   0:01   0.27% /usr/local/lib/firefox/firefox -contentproc -childID 5 -isForBrowser -prefsLen 13213 -sched
   12 root       -96    -      0   368K WAIT     6   0:02   0.26% [intr{irq267: hdac0}]

It looks like the issue starts with the PRI column.
Comment 1 commit-hook freebsd_committer freebsd_triage 2018-08-25 16:00:06 UTC
A commit references this bug:

Author: markj
Date: Sat Aug 25 15:59:51 UTC 2018
New revision: 338315
URL: https://svnweb.freebsd.org/changeset/base/338315

Log:
  Fix column alignment in per-thread mode.

  PR:		230872
  Approved by:	re (marius)
  MFC after:	1 week

Changes:
  head/usr.bin/top/machine.c
Comment 2 Eitan Adler freebsd_committer freebsd_triage 2018-08-26 07:23:37 UTC
The fix, while functionally correct, is not in line with the remainder of the file. I'l l fix thsx once the freeze is over.