Up to [local] / src / usr.bin / top
Request diff between arbitrary revisions
Default branch: MAIN
Revision 1.17 / (download) - annotate - [select for diffs], Sat May 18 01:51:44 2024 UTC (3 weeks, 2 days ago) by jsg
Branch: MAIN
CVS Tags: HEAD
Changes since 1.16: +1 -8 lines
Diff to previous 1.16 (colored) to selected 1.1 (colored)
remove prototypes with no matching function
Revision 1.16 / (download) - annotate - [select for diffs], Sat Sep 10 16:58:51 2022 UTC (20 months, 4 weeks ago) by cheloha
Branch: MAIN
CVS Tags: OPENBSD_7_5_BASE,
OPENBSD_7_5,
OPENBSD_7_4_BASE,
OPENBSD_7_4,
OPENBSD_7_3_BASE,
OPENBSD_7_3,
OPENBSD_7_2_BASE,
OPENBSD_7_2
Changes since 1.15: +2 -2 lines
Diff to previous 1.15 (colored) to selected 1.1 (colored)
top(1): remove last vestiges of "last pid" support millert@ removed most of the "last pid" support from top(1) in 1997. See, e.g. top/machine.c,v1.7: http://cvsweb.openbsd.org/src/usr.bin/top/machine.c?rev=1.7&content-type=text/x-cvsweb-markup Let's remove the rest of it: - Eliminate system_info.last_pid. - Remove mpid parameter and "last pid" printing code from i_loadave(). Link: https://marc.info/?l=openbsd-tech&m=166277253606823&w=2 ok millert@
Revision 1.15 / (download) - annotate - [select for diffs], Sat Nov 17 23:10:08 2018 UTC (5 years, 6 months ago) by cheloha
Branch: MAIN
CVS Tags: OPENBSD_7_1_BASE,
OPENBSD_7_1,
OPENBSD_7_0_BASE,
OPENBSD_7_0,
OPENBSD_6_9_BASE,
OPENBSD_6_9,
OPENBSD_6_8_BASE,
OPENBSD_6_8,
OPENBSD_6_7_BASE,
OPENBSD_6_7,
OPENBSD_6_6_BASE,
OPENBSD_6_6,
OPENBSD_6_5_BASE,
OPENBSD_6_5
Changes since 1.14: +2 -2 lines
Diff to previous 1.14 (colored) to selected 1.1 (colored)
Add new KERN_CPUSTATS sysctl(2) so we can identify offline CPUs. Because of hw.smt we need a way to determine whether a given CPU is "online" or "offline" from userspace. KERN_CPTIME2 is an array, and so cannot be cleanly extended for this purpose, so add a new sysctl(2) KERN_CPUSTATS with an extensible struct. At the moment it's just KERN_CPTIME2 with a flags member, but it can grow as needed. KERN_CPUSTATS appears to have been defined by BSDi long ago, but there are few (if any) packages in the wild still using the symbol so breakage in ports should be near zero. No other system inherited the symbol from BSDi, either. Then, use the new sysctl(2) in systat(1) and top(1): - systat(1) draws placeholder marks ('-') instead of percentages for offline CPUs in the cpu view. - systat(1) omits offline CPU ticks when drawing the "big bar" in the vmstat view. The upshot is that the bar isn't half idle when half your logical CPUs are disabled. - top(1) does not draw lines for offline CPUs; if CPUs toggle on or offline in interactive mode we redraw the display to expand/reduce space for the new/missing CPUs. This is consistent with what some top(1) implementations do on Linux. - top(1) omits offline CPUs from the totals when CPU totals are combined into a single line (the '-1' flag). Originally prompted by deraadt@. Discussed endlessly with deraadt@, ketennis@, and sthen@. Tested by jmc@ and jca@. Earlier versions also discussed with jca@. Earlier versions tested by jmc@, tb@, and many others. docs ok jmc@, kernel bits ok ketennis@, everything ok sthen@, "Is your stuff in yet?" deraadt@
Revision 1.14 / (download) - annotate - [select for diffs], Fri Oct 5 18:56:57 2018 UTC (5 years, 8 months ago) by cheloha
Branch: MAIN
CVS Tags: OPENBSD_6_4_BASE,
OPENBSD_6_4
Changes since 1.13: +1 -1 lines
Diff to previous 1.13 (colored) to selected 1.1 (colored)
Revert KERN_CPTIME2 ENODEV changes in kernel and userspace. ok kettenis deraadt
Revision 1.13 / (download) - annotate - [select for diffs], Wed Sep 26 17:23:13 2018 UTC (5 years, 8 months ago) by cheloha
Branch: MAIN
Changes since 1.12: +2 -2 lines
Diff to previous 1.12 (colored) to selected 1.1 (colored)
KERN_CPTIME2: set ENODEV if the CPU is offline. This lets userspace distinguish between idle CPUs and those that are not schedulable because hw.smt=0. A subsequent commit probably needs to add documentation for this to sysctl.2 (and perhaps elsewhere) after the dust settles. Also included here are changes to systat(1) and top(1) that account for the ENODEV case and adjust behavior accordingly: - systat(1)'s cpu view prints placeholder marks ('-') instead of percentages for each state if the given CPU is offline. - systat(1)'s vmstat view checks for offline CPUs when computing the machine state total and excludes them, so the CPU usage graph only represents the states for online CPUs. - top(1) does not draw CPU rows for offline CPUs when the view is redrawn. If CPUs "go offline", percentages for each state are replaced by placeholder marks ('-'); the view will need to be redrawn to remove these rows. If CPUs "go online" the view will need to be redrawn to show these new CPUs. In "combined CPU" mode, the count and the state totals only represent online CPUs. Ports using KERN_CPTIME2 will need to be updated. The changes described above to make systat(1) and top(1) aware of the ENODEV case *and* gracefully handle a changing HW_NCPUONLINE while the application is running are not necessarily appropriate for each and every port. The changes described above are so extensive in part to demonstrate one way a program *might* be made robust to changing CPU availability. In particular, changing hw.smt after boot is an extremely rare event, and this needs to be weighed when updating ports. The logic needed to account for the KERN_CPTIME2 ENODEV case is very roughly: if (sysctl(...) == -1) { if (errno != ENODEV) { /* Actual error occurred. */ } else { /* CPU is offline. */ } } else { /* CPU is online and CPU states were set by sysctl(2). */ } Prompted by deraadt@. Basic idea for ENODEV from kettenis@. Discussed at length with kettenis@. Additional testing by tb@. No complaints from hackers@ after a week. ok kettenis@, "I think you should commit [now]" deraadt@
Revision 1.12 / (download) - annotate - [select for diffs], Mon Jan 14 21:33:59 2013 UTC (11 years, 4 months ago) by guenther
Branch: MAIN
CVS Tags: OPENBSD_6_3_BASE,
OPENBSD_6_3,
OPENBSD_6_2_BASE,
OPENBSD_6_2,
OPENBSD_6_1_BASE,
OPENBSD_6_1,
OPENBSD_6_0_BASE,
OPENBSD_6_0,
OPENBSD_5_9_BASE,
OPENBSD_5_9,
OPENBSD_5_8_BASE,
OPENBSD_5_8,
OPENBSD_5_7_BASE,
OPENBSD_5_7,
OPENBSD_5_6_BASE,
OPENBSD_5_6,
OPENBSD_5_5_BASE,
OPENBSD_5_5,
OPENBSD_5_4_BASE,
OPENBSD_5_4,
OPENBSD_5_3_BASE,
OPENBSD_5_3
Changes since 1.11: +2 -2 lines
Diff to previous 1.11 (colored) to selected 1.1 (colored)
When showing threads, say so. Fix up some comments and names at the same time. original diff by zhuk@ ok jsing@ mpi@ zhuk@
Revision 1.11 / (download) - annotate - [select for diffs], Thu Nov 22 11:01:04 2007 UTC (16 years, 6 months ago) by otto
Branch: MAIN
CVS Tags: OPENBSD_5_2_BASE,
OPENBSD_5_2,
OPENBSD_5_1_BASE,
OPENBSD_5_1,
OPENBSD_5_0_BASE,
OPENBSD_5_0,
OPENBSD_4_9_BASE,
OPENBSD_4_9,
OPENBSD_4_8_BASE,
OPENBSD_4_8,
OPENBSD_4_7_BASE,
OPENBSD_4_7,
OPENBSD_4_6_BASE,
OPENBSD_4_6,
OPENBSD_4_5_BASE,
OPENBSD_4_5,
OPENBSD_4_4_BASE,
OPENBSD_4_4,
OPENBSD_4_3_BASE,
OPENBSD_4_3
Changes since 1.10: +2 -2 lines
Diff to previous 1.10 (colored) to selected 1.1 (colored)
Diff from Mark Lumsden: cleanup of reading strings and numbers, to make sure command line args and interactive reading of numbers use the same code. More concrete, interactive use of 'd' and 'n' now also interpret 'max', 'infinite' and 'all' and handle non-numbers correctly. tested by a few
Revision 1.10 / (download) - annotate - [select for diffs], Fri Jul 27 13:59:27 2007 UTC (16 years, 10 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_4_2_BASE,
OPENBSD_4_2
Changes since 1.9: +2 -2 lines
Diff to previous 1.9 (colored) to selected 1.1 (colored)
u_endscreen()'s argument is entirely unused; inspired by zinovik@cs.karelia.ru
Revision 1.9 / (download) - annotate - [select for diffs], Tue May 29 00:56:56 2007 UTC (17 years ago) by otto
Branch: MAIN
Changes since 1.8: +30 -23 lines
Diff to previous 1.8 (colored) to selected 1.1 (colored)
Instead of using hand-crafted redraws minimizing screen updates, use curses. Enables nice things like process highlighting without hurting the brain. ok deraadt@
Revision 1.8 / (download) - annotate - [select for diffs], Sat Mar 4 06:58:12 2006 UTC (18 years, 3 months ago) by otto
Branch: MAIN
CVS Tags: OPENBSD_4_1_BASE,
OPENBSD_4_1,
OPENBSD_4_0_BASE,
OPENBSD_4_0
Changes since 1.7: +1 -2 lines
Diff to previous 1.7 (colored) to selected 1.1 (colored)
Show the CPU state %'s on first display as well. "looks good" deraadt@
Revision 1.7 / (download) - annotate - [select for diffs], Wed Jun 8 22:36:43 2005 UTC (19 years ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_3_9_BASE,
OPENBSD_3_9,
OPENBSD_3_8_BASE,
OPENBSD_3_8
Changes since 1.6: +3 -3 lines
Diff to previous 1.6 (colored) to selected 1.1 (colored)
Multi-cpu support for top. Each cpu now gets its own stats line. Based on work by todd@ at the hackathon.
Revision 1.6 / (download) - annotate - [select for diffs], Fri Jun 13 04:29:59 2003 UTC (21 years ago) by pvalchev
Branch: MAIN
CVS Tags: OPENBSD_3_7_BASE,
OPENBSD_3_7,
OPENBSD_3_6_BASE,
OPENBSD_3_6,
OPENBSD_3_5_BASE,
OPENBSD_3_5,
OPENBSD_3_4_BASE,
OPENBSD_3_4
Changes since 1.5: +2 -4 lines
Diff to previous 1.5 (colored) to selected 1.1 (colored)
use proper varargs(3), as opposed to a hack; ok millert
Revision 1.5 / (download) - annotate - [select for diffs], Thu Jun 12 22:30:23 2003 UTC (21 years ago) by pvalchev
Branch: MAIN
Changes since 1.4: +2 -2 lines
Diff to previous 1.4 (colored) to selected 1.1 (colored)
cleanup; ok deraadt
Revision 1.4 / (download) - annotate - [select for diffs], Mon Jul 15 17:20:36 2002 UTC (21 years, 11 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_3_3_BASE,
OPENBSD_3_3,
OPENBSD_3_2_BASE,
OPENBSD_3_2
Changes since 1.3: +29 -1 lines
Diff to previous 1.3 (colored) to selected 1.1 (colored)
license change from William LeFebvre <wnl@groupsys.com>; top is now BSD licensed. this same license will show up on his next release as well.
Revision 1.3 / (download) - annotate - [select for diffs], Sat Feb 16 21:27:55 2002 UTC (22 years, 3 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_3_1_BASE,
OPENBSD_3_1
Changes since 1.2: +23 -23 lines
Diff to previous 1.2 (colored) to selected 1.1 (colored)
Part one of userland __P removal. Done with a simple regexp with some minor hand editing to make comments line up correctly. Another pass is forthcoming that handles the cases that could not be done automatically.
Revision 1.2 / (download) - annotate - [select for diffs], Fri Aug 22 07:16:27 1997 UTC (26 years, 9 months ago) by downsj
Branch: MAIN
CVS Tags: OPENBSD_3_0_BASE,
OPENBSD_3_0,
OPENBSD_2_9_BASE,
OPENBSD_2_9,
OPENBSD_2_8_BASE,
OPENBSD_2_8,
OPENBSD_2_7_BASE,
OPENBSD_2_7,
OPENBSD_2_6_BASE,
OPENBSD_2_6,
OPENBSD_2_5_BASE,
OPENBSD_2_5,
OPENBSD_2_4_BASE,
OPENBSD_2_4,
OPENBSD_2_3_BASE,
OPENBSD_2_3,
OPENBSD_2_2_BASE,
OPENBSD_2_2
Changes since 1.1: +25 -1 lines
Diff to previous 1.1 (colored)
First sweep. Prototype, type fixes, long fixes, mostly compiles with -Wall.
Revision 1.1 / (download) - annotate - [selected], Thu Aug 14 14:00:21 1997 UTC (26 years, 10 months ago) by downsj
Branch: MAIN
top 3.4, with a few changes. Still needs more work.