aboutsummaryrefslogtreecommitdiff
path: root/bin/ps/extern.h
Commit message (Collapse)AuthorAgeFilesLines
* bin: Remove ancient SCCS tags.Warner Losh2023-11-271-2/+0
| | | | | | | | Remove ancient SCCS tags from the tree, automated scripting, with two minor fixup to keep things compiling. All the common forms in the tree were removed with a perl script. Sponsored by: Netflix
* Remove $FreeBSD$: one-line .h patternWarner Losh2023-08-161-1/+0
| | | | Remove /^\s*\*+\s*\$FreeBSD\$.*$\n/
* bin/ps: Avoid function name conflict with libc uname()Alex Richardson2021-07-191-1/+1
| | | | | | | | This prevents ps from being built with address sanitizer instrumentation. Reviewed By: trasz MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D31048
* ps(1): don't try to handle non-SMP systemsPiotr Pawel Stefaniak2020-06-271-1/+1
| | | | | | | | | | As reported by kib, sysctl machdep.smp_active doesn't exist and on UP we return CPU 0 for all threads anyway. Reported by: kib Notes: svn path=/head/; revision=362707
* ps(1): reuse keyword "cpu" to show CPU numberPiotr Pawel Stefaniak2020-06-271-1/+2
| | | | | | | | | | | | | | | | | | | | | | | This flag will now show the processor number on which a process is running. This change was inspired by PR129965. Initially I didn't think that the patch attached to it was correct -- it sacrificed ki_estcpu use in "cpu" for ki_lastcpu and I thought that the old functionality should be kept and the new (cpu#) one added to it. But I've since discovered that ki_estcpu is sched_4bsd-specific. What's worse, it represents the same thing as ki_pctcpu, except ki_pctcpu is universal -- so "%cpu" has been using it successfully. Therefore, I've decided to replace information based on ki_estcpu with information based on ki_oncpu/ki_lastcpu. Key parts of the code and manual changes were borrowed from top(1). PR: 129965 Reported by: Nikola Knežević MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D25377 Notes: svn path=/head/; revision=362705
* Add a "jail" keyword to list the name of a jail rather than its ID.John Baldwin2018-03-131-0/+1
| | | | | | | | | | Inspired by: mwlucas Reviewed by: jamie MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D14683 Notes: svn path=/head/; revision=330872
* General further adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-201-0/+2
| | | | | | | | | | | | | | | | | Mainly focus on files that use BSD 3-Clause license. The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensource licenses. We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts. Special thanks to Wind River for providing access to "The Duke of Highlander" tool: an older (2014) run over FreeBSD tree was useful as a starting point. Notes: svn path=/head/; revision=326025
* Renumber copyright clause 4Warner Losh2017-02-281-1/+1
| | | | | | | | | | | | Renumber cluase 4 to 3, per what everybody else did when BSD granted them permission to remove clause 3. My insistance on keeping the same numbering for legal reasons is too pedantic, so give up on that point. Submitted by: Jan Schaumann <jschauma@stevens.edu> Pull Request: https://github.com/freebsd/freebsd/pull/96 Notes: svn path=/head/; revision=314436
* Include the thread name along with the command name when displaying theJohn Baldwin2013-01-181-1/+1
| | | | | | | | | | | | command name of a thread from a multi-threaded process that doesn't have an available argument list (such as kernel processes) and threads display is enabled via -H. Reviewed by: alfred, delphij, eric@vangyzen.net MFC after: 1 week Notes: svn path=/head/; revision=245610
* Make ps(1) automatically size its column widths.Edward Tomasz Napierala2011-09-291-49/+38
| | | | Notes: svn path=/head/; revision=225868
* Add "gid" and "group" keywords to display the effective group IDEdward Tomasz Napierala2011-06-141-0/+2
| | | | | | | | | | and effective group name. Also, add "egid", "egroup" and "euid" aliases. PR: bin/146331 Submitted by: Jeremie Le Hen <jeremie at le-hen dot org> Notes: svn path=/head/; revision=223086
* Add proper width calculation for time fields (time, cputime and usertime).Edward Tomasz Napierala2011-03-241-0/+3
| | | | | | | This fixes the ugly overflow in "ps aux" output for "[idle]". Notes: svn path=/head/; revision=219972
* Make "LOGIN" and "CLASS" columns width scale properly instead of wasting space.Edward Tomasz Napierala2011-03-241-0/+2
| | | | Notes: svn path=/head/; revision=219967
* Implement the usertime and systime keywords for ps, printing theKonstantin Belousov2011-03-171-0/+2
| | | | | | | | | | corresponding times reported by getrusage(). Submitted by: Dan Nelson <dnelson allantgroup com> MFC after: 1 week Notes: svn path=/head/; revision=219713
* Export login class information via kinfo and make it possible to viewEdward Tomasz Napierala2011-03-051-0/+1
| | | | | | | it using "ps -o class". Notes: svn path=/head/; revision=219307
* Correct sort order.Ed Maste2010-09-221-1/+1
| | | | Notes: svn path=/head/; revision=213012
* o) Add a keyword to displaying elapsed time in integer seconds, "etimes".Juli Mallett2010-03-171-0/+1
| | | | | | | | | o) Give slightly better (i.e. any) documentation of the format of "etime". Reviewed by: jilles Notes: svn path=/head/; revision=205271
* [1] When showing threads, the thread name just appears if the commAttilio Rao2009-02-261-0/+1
| | | | | | | | | | | | | | | | | | | | | | label is choosen as last printout (ucomm suffers of this such bug too). That bug is caused by the fact that the fixed size of printout doesn't leave enough space for them to be printed out. Implement ucomm and comm commands with a dynamic size lenght for buffers. [2] On AMD64 architecture pointers don't have enough chars space to be shown (8 chars while they need 16). Fix them by providing a variadic space so that it fits well on both 64 and 32 bits architectures. [3] Check a return value of malloc() that wasn't checked before. PR: bin/128841, bin/128842 Reviewed by: jhb, emaste Sponsored by: Sandvine Incorporated Notes: svn path=/head/; revision=189078
* Introduce a way to make pure kernal threads.Julian Elischer2007-10-261-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | kthread_add() takes the same parameters as the old kthread_create() plus a pointer to a process structure, and adds a kernel thread to that process. kproc_kthread_add() takes the parameters for kthread_add, plus a process name and a pointer to a pointer to a process instead of just a pointer, and if the proc * is NULL, it creates the process to the specifications required, before adding the thread to it. All other old kthread_xxx() calls return, but act on (struct thread *) instead of (struct proc *). One reason to change the name is so that any old kernel modules that are lying around and expect kthread_create() to make a process will not just accidentally link. fix top to show kernel threads by their thread name in -SH mode add a tdnam formatting option to ps to show thread names. make all idle threads actual kthreads and put them into their own idled process. make all interrupt threads kthreads and put them in an interd process (mainly for aesthetic and accounting reasons) rename proc 0 to be 'kernel' and it's swapper thread is now 'swapper' man page fixes to follow. Notes: svn path=/head/; revision=173004
* Change "struct varent" to use the standard queue(8) macros, instead ofGarance A Drosehn2004-06-231-1/+1
| | | | | | | | | using it's own version of the same basic algorithm. Submitted by: part by Cyrille Lefevre, part of it done by me Notes: svn path=/head/; revision=130999
* Make sure the value of "upr" (scheduling priority on return from system call)Garance A Drosehn2004-06-231-0/+1
| | | | | | | | | is scaled in the same way that "pri" (scheduling priority) is scaled. Submitted by: Cyrille Lefevre Notes: svn path=/head/; revision=130974
* Oops. Undo that last 'const' change. It expects similar changes to someGarance A Drosehn2004-06-221-1/+1
| | | | | | | other files that I am not ready to commit yet... Notes: svn path=/head/; revision=130896
* Add 'const' to a few places.Garance A Drosehn2004-06-221-1/+1
| | | | | | | | PR: bin/65803 Submitted by: Cyrille Lefevre Notes: svn path=/head/; revision=130895
* Add the `-O emul' format option, which prints the name of the system-callGarance A Drosehn2004-06-201-0/+1
| | | | | | | | | | | emulation environment the process is in. "emul" as a keyword is picked up from OpenBSD. PR: bin/65803 Submitted by: Cyrille Lefevre Notes: svn path=/head/; revision=130830
* Remove clause 3 from the UCB licenses.Mark Murray2004-04-061-4/+0
| | | | | | | OK'ed by: imp, core Notes: svn path=/head/; revision=127958
* Implement the nwchan keyword that has been in the man page, but wasHartmut Brandt2003-08-131-0/+1
| | | | | | | | not implemented. This is just handy if you want to ddb the address some process is waiting on. Notes: svn path=/head/; revision=118857
* When inserting a non-user-specified (e.g. not via -o or -O) format, don't dupeJuli Mallett2003-01-191-1/+2
| | | | | | | | | | | one that is already there. This is consistent with GNU ps(1)'s BSD mode, and POLA. Reported by: Andy Farkas <andyf@speednet.com.au> Tested by: Andy Farkas <andyf@speednet.com.au> Notes: svn path=/head/; revision=109502
* The hw.availpages sysctl has an unsigned long value now, fix the retrievalThomas Moestl2002-11-011-1/+2
| | | | | | | to match that. Notes: svn path=/head/; revision=106318
* Use the MAC interface to list process MAC labels rather than usingRobert Watson2002-10-241-1/+2
| | | | | | | | | | | | | the LOMAC-specific interface (which is being deprecated). The revised LOMAC using the MAC framework will export levels listable using this mechanism. Approved by: re Obtained from: TrustedBSD Project Sponsored by: DARPA, Network Associates Laboratories Notes: svn path=/head/; revision=105831
* Catch up to SMTX -> SLOCK changes.John Baldwin2002-10-021-1/+1
| | | | Notes: svn path=/head/; revision=104388
* Conglomerate printing of ps_pgtok'd data into a PLONG type. I couldn't thinkJuli Mallett2002-09-171-2/+0
| | | | | | | | of a better name, except PINT, but I decided to go with assuming LONG to be safe, rather than assuming INT. Notes: svn path=/head/; revision=103438
* Perform keyword.c:1.27 properly, implement -orss in the New World Order ofJuli Mallett2002-09-161-0/+1
| | | | | | | | | | | ps(1) formatting, using pgtok() to get the value in K, rather than printing it in pages. This is consistent with behaviour before keyword.c:1.26 (et al) which exists in STABLE today, and which uses the same metric as VSZ. Submitted by: bde Notes: svn path=/head/; revision=103422
* Fixed unsorting.Bruce Evans2002-06-081-1/+1
| | | | Notes: svn path=/head/; revision=98030
* Use a global `now' variable for the current time, and initialise it atJuli Mallett2002-06-061-0/+1
| | | | | | | startup, right after calling setlocale(3). Notes: svn path=/head/; revision=97966
* Implement a SUSv3-ignorant but "time"-similar format for "etime", elapsedJuli Mallett2002-06-061-0/+1
| | | | | | | | run time (NOT cpu time). cputime() and elapsed() both need to honour SUSv3 now. Notes: svn path=/head/; revision=97965
* Support the SUSv3 `rgroup' format.Juli Mallett2002-06-061-0/+2
| | | | | | | Clean up some local style bogons. Notes: svn path=/head/; revision=97961
* SUSv3 conform on the "comm" and "args" formats, and make correct the "command"Juli Mallett2002-06-061-0/+1
| | | | | | | format, since it's BSDlike, and "comm" is actually different. Notes: svn path=/head/; revision=97958
* Fixed unsorting.Bruce Evans2002-02-231-6/+6
| | | | Notes: svn path=/head/; revision=91171
* Revert wchan functionality. Add 'mwchan' to supply new duel mutex/msleepMatthew Dillon2002-02-211-0/+1
| | | | | | | | | functionality and make it the default. With additional improvements by: Mark Peek <mp@FreeBSD.org> Notes: svn path=/head/; revision=91028
* WARNS=4 fixes (incomplete, so set NO_WERROR), and lots of extraMark Murray2002-02-031-8/+3
| | | | | | | cleanup courtesy of automatic checking (lint). Notes: svn path=/head/; revision=90143
* o __P has been reovedWarner Losh2002-02-021-37/+37
| | | | | | | | | | | | o Old-style K&R declarations have been converted to new C89 style o register has been removed o prototype for main() has been removed (gcc3 makes it an error) o int main(int argc, char *argv[]) is the preferred main definition. o Attempt to not break style(9) conformance for declarations more than they already are. Notes: svn path=/head/; revision=90110
* Add LOMAC options (the "Z" flag in both cases) to display extra informationBrian Feldman2001-11-261-0/+1
| | | | | | | | | in ls(1) and ps(1). Sponsored by: DARPA, NAI Labs Notes: svn path=/head/; revision=86922
* Small optimization: set use_ampm only when neededAndrey A. Chernov2001-03-031-1/+1
| | | | Notes: svn path=/head/; revision=73369
* Use AM/PM time only when available in localeAndrey A. Chernov2001-03-021-1/+1
| | | | Notes: svn path=/head/; revision=73367
* Catch up to new priority interface.Jake Burkholder2001-02-121-1/+1
| | | | Notes: svn path=/head/; revision=72377
* Change the proc information returned from the kernel so that itKirk McKusick2000-12-121-3/+1
| | | | | | | | | | | | | | | no longer contains kernel specific data structures, but rather only scalar values and structures that are already part of the kernel/user interface, specifically rusage and rtprio. It no longer contains proc, session, pcred, ucred, procsig, vmspace, pstats, mtx, sigiolst, klist, callout, pasleep, or mdproc. If any of these changed in size, ps, w, fstat, gcore, systat, and top would all stop working. The new structure has over 200 bytes of unassigned space for future values to be added, yet is nearly 100 bytes smaller per entry than the structure that it replaced. Notes: svn path=/head/; revision=69896
* Introduce a 'mtxname' keyword that displays the current mutex that aJohn Baldwin2000-11-291-0/+1
| | | | | | | process is blocked on or '-'. Notes: svn path=/head/; revision=69372
* $Id$ -> $FreeBSD$Peter Wemm1999-08-271-1/+1
| | | | Notes: svn path=/head/; revision=50471
* If no value is present for the login name set it to '-'.Steve Price1998-05-251-1/+2
| | | | | | | | | | Also pretty-up the display of 'ps -Ortprio'. PR: 4947 Submitted by: Martin Kammerhofer <dada@sbox.tu-graz.ac.at> Notes: svn path=/head/; revision=36352
* Kill #ifndef NEWVM etc. It affected a lot of other things besidesPeter Wemm1997-08-031-4/+1
| | | | | | | | | | VM structure (eg: credentials etc) and it's highly unlikely we'll ever get to see the "tainted" BSD<=4.3 VM code in public use. Although it indicated the way some things used to be done, it obfuscates things too much. Notes: svn path=/head/; revision=27856