summaryrefslogtreecommitdiff
path: root/bin/ps
AgeCommit message (Collapse)Author
2022-01-26remove double t from targeted, add missing r to arbitraryandvar
And fix few more typos along the way in comments and man pages.
2021-11-06s/maxiumum/maximum/msaitoh
2021-09-15Don't assign v to newvar, so we can still access the original length.christos
2021-09-14reflect reality on flags.christos
2021-09-14use emalloc and friends, add ktrace flag printing.christos
2021-09-14Provide symbolic printing of some keywords by capitalizing them.christos
2021-09-10bin: remove unnecessary lint comment CONSTCONDrillig
Since 2021-01-31, lint no longer warns about 'do ... while (0)'. No functional change.
2021-06-04use parsenum like everywhere else in the code.christos
2021-06-04Sort options in usage.wiz
2021-06-04Sort options in synopsis.wiz
2021-06-04PR standards/11223cjep
Add -G to take a single group argument heading towards POSIX.2 compliance. Patch from jperkin and reviewed by simonb.
2021-04-17Remove SCCS workaround. No binary change.maya
2021-04-06- dedup codechristos
- add a safe_strftime() to handle error cases
2021-04-06Fix the column width calculation for the lstart column if an emptysimonb
column header is specified. Fixes bug pointed out by Ted Spradley in https://mail-index.netbsd.org/netbsd-users/2021/04/05/msg026808.html .
2021-04-06We only need -Wno-format-y2k for print.c .simonb
2020-08-26Don't rely on the USPACE kernel define as a fallback if the vm.uspacesimonb
sysctl fails. We've got bigger problems if the sysctl fail anyway.
2019-09-15ps(1): Guard freeing the memory of pinfo with __NO_LEAKS.kamil
No more leaks are detected by LSan/NetBSD as of the LLVM snapshot (clang10svn) from 2019-09-15.
2019-09-11Plug memory leak in ps(1)kamil
pinfo is allocated in setpinfo() with calloc(3). Free it when no longer used, just before the program termination. Detected with LSan.
2019-08-06Restore maxrss, idrss, isrss, ixrss printing in ps(1)kamil
The RSS related statistics are now back in the NetBSD kernel. These values were disabled since day0 until today. libkvm(3) users will still receive inappropriate values as RSS statistics are updated upon sysctl(3) call. Patch submitted by <Krzysztof Lasocki>
2019-06-19Add a fallback definition of LSDEAD in ps(1)kamil
The symbol is no longer available in headers. Requested by <mrg>
2019-06-18Make LSDEAD usage conditionalkamil
LSDEAD is not used since NetBSD-5.0 and will be gone. The same conditional usage is already in ps.c in the same program.
2018-09-19Don't display l_wchan, either there is something in l_wmesg and we displaymaxv
it, or there's nothing and we print "-".
2018-04-11kvm_geterr() already contains errno, use errx.christos
2018-04-11use EXIT_FAILURE instead of 1christos
2018-01-12Fix an unitialized memory read bug in ps(1)kamil
rawcpu of type int, is declared inside main(){} and it can be passed as uninitialized to setpinfo(). The setpinfo() function has a switch checking the value of rawcpu: if (!rawcpu) pi[i].pcpu /= 1.0 - exp(ki[i].p_swtime * log_ccpu); rawcpu is set to 1 with the command line argument "-C". -C Change the way the CPU percentage is calculated by using a "raw" CPU calculation that ignores "resident" time (this normally has no effect). Bug reproducible with an invocation: "ps u". It hides with "ps uC". Initialize rawcpu by default to 0, before the getopt(3) machinery. Detected with MSan running on NetBSD/amd64. Sponsored by <The NetBSD Foundation>
2017-12-09ps: Rename local routine name from uname to usrnamekamil
This removes symbol name routine clash with libc's uname(3). This allows to build ps(1) against LLVM Sanitizers. Sponsored by <The NetBSD Foundation>
2017-08-28Bump date for previous. Remove/replace bogus Tn uses.wiz
2017-08-28Remove the filesystem tracing featurekamil
This is a legacy interface from 4.4BSD, and it was introduced to overcome shortcomings of ptrace(2) at that time, which are no longer relevant (performance). Today /proc/#/ctl offers a narrow subset of ptrace(2) commands and is not applicable for modern applications use beyond simplistic tracing scenarios. This removal will simplify kernel internals. Users will still be able to use all the other /proc files. This change won't affect other procfs files neither Linux compat features within mount_procfs(8). /proc/#/ctl isn't available on Linux. Remove: - /proc/#/ctl from mount_procfs(8) - P_FSTRACE note from the documentation of ps(1) - /proc/#/ctl and filesystem tracing documentation from mount_procfs(8) - KAUTH_REQ_PROCESS_PROCFS_CTL documentation from kauth(9) - source code file miscfs/procfs/procfs_ctl.c - PFSctl and procfs_doctl() from sys/miscfs/procfs/procfs.h - KAUTH_REQ_PROCESS_PROCFS_CTL from sys/sys/kauth.h - PSL_FSTRACE (0x00010000) from sys/sys/proc.h - P_FSTRACE (0x00010000) from sys/sys/sysctl.h Reduce code complexity after removal of this functionality. Update TODO.ptrace accordingly: remove two entries about /proc tracing. Do not keep legacy notes as comments in the headers about removed PSL_FSTRACE / P_FSTRACE, as this interface had little number of users (close or equal to zero). Proposed on tech-kern@. All filesystem tracing utility users are encouraged to switch to ptrace(2). Sponsored by <The NetBSD Foundation>
2017-07-03Remove workaround for ancient HTML generation code.wiz
2016-12-26simplify logic; there must be no CPU usage when p_swtime is zerorin
2016-12-12Handle functions that use the offset from either kinfo_proc2/kinfo_lwp properly.christos
2016-12-02provide a tree like display with -d, from FreeBSDchristos
2016-11-28Calculate CPU usage (pcpu) once per process if it is required. This changerin
significantly improves performance for slow machines when output is sorted by pcpu. ok martin
2016-11-28for donlist{,_sysctl}:rin
- obtain log_ccpu = log(ccpu) rather than ccpu itself - use common default values and warn users appropriately when errors occur ok martin
2016-11-28KNFrin
ok martin
2016-09-05Drop main() prototype.sevan
2016-08-10Earliest reference in the TUHS archive is v3sevan
Unfortunately only the source code for the compiler is present for that release. The v2 archive is missing the manuals & only contains a some of the commands. Switch to v3 and reference manual category eight, as per r1.32 of src/bin/ps/ps.1 from OpenBSD. Heads up from Ingo Schwarze.
2016-08-10Document the version ps first appeared.sevan
2015-06-16remove \n from error messageschristos
2014-11-15Use l_wmesg if the string is not empty. Don't bother checking l_name forjoerg
nullness.
2014-06-28Don't print junk errnos. Avoids:dholland
% ps -tfoo ps: /dev/ttyfoo: Undefined error: 0 Exit 1
2014-04-20Don't bother using variables whose value is never changed from thedholland
initialization value.
2014-04-20Use an enum type for PRINTMODE vs. WIDTHMODE. Compiler output diffs havedholland
been checked.
2014-02-19Remove some pointless inclusions os sys/user.hdsl
2014-01-15Bump date for previous.wiz
2014-01-15Make ps -s use LTIME instead of TIME in the default output format.mlelstv
2014-01-15Add an LTIME column that prints lwp cputime.mlelstv
2012-06-03Switch device database to cdb(5). Rework ttyname(3) and ttyname_r(3) tojoerg
depend on new devname_r(3) as heart. Add /dev/pts magic directly to devname(3). While it can lead to returning non-existing paths, the behavior is more consistent that way. Drop caching layer in devname(3), it doesn't buy anything for the common case of having access to the database. Teach devname(3) proper fallback behavior of scanning /dev. Create both old-style and new-style database for now in /etc/rc.d/sysdb.
2012-05-07Push logic to convert a ttyname to a device number into its ownjoerg
function. Improve dealing with ptyfs by explicitly handling missing pts/%d entries, if the kernel supports the pts device (PR 40813).
2012-04-15Increase width of table column so it formats more nicely.wiz