summaryrefslogtreecommitdiffstats
path: root/bin/ps
Commit message (Collapse)AuthorAgeFilesLines
* MFC r309676vangyzen2016-12-151-6/+10
| | | | | | | | | | | | | Export the whole thread name in kinfo_proc kinfo_proc::ki_tdname is three characters shorter than thread::td_name. Add a ki_moretdname field for these three extra characters. Add the new field to kinfo_proc32, as well. Update all in-tree consumers to read the new field and assemble the full name, except for lldb's HostThreadFreeBSD.cpp, which I will handle separately. Bump __FreeBSD_version. Sponsored by: Dell EMC
* MFC r303423:kib2016-08-151-0/+1
| | | | Force SIGSTOP to be the first signal reported after the attach.
* MFC 302900,302902,302921,303461,304009:jhb2016-08-151-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a mask of optional ptrace() events. 302900: Add a test for user signal delivery. This test verifies we get the correct ptrace event details when a signal is posted to a traced process from userland. 302902: Add a mask of optional ptrace() events. ptrace() now stores a mask of optional events in p_ptevents. Currently this mask is a single integer, but it can be expanded into an array of integers in the future. Two new ptrace requests can be used to manipulate the event mask: PT_GET_EVENT_MASK fetches the current event mask and PT_SET_EVENT_MASK sets the current event mask. The current set of events include: - PTRACE_EXEC: trace calls to execve(). - PTRACE_SCE: trace system call entries. - PTRACE_SCX: trace syscam call exits. - PTRACE_FORK: trace forks and auto-attach to new child processes. - PTRACE_LWP: trace LWP events. The S_PT_SCX and S_PT_SCE events in the procfs p_stops flags have been replaced by PTRACE_SCE and PTRACE_SCX. PTRACE_FORK replaces P_FOLLOW_FORK and PTRACE_LWP replaces P2_LWP_EVENTS. The PT_FOLLOW_FORK and PT_LWP_EVENTS ptrace requests remain for compatibility but now simply toggle corresponding flags in the event mask. While here, document that PT_SYSCALL, PT_TO_SCE, and PT_TO_SCX both modify the event mask and continue the traced process. 302921: Rename PTRACE_SYSCALL to LINUX_PTRACE_SYSCALL. 303461: Note that not all optional ptrace events use SIGTRAP. New child processes attached due to PTRACE_FORK use SIGSTOP instead of SIGTRAP. All other ptrace events use SIGTRAP. 304009: Remove description of P_FOLLOWFORK as this flag was removed.
* MFC r303213:kib2016-07-301-0/+1
| | | | | | Add missed required call to xo_finish() when only header is printed. Approved by: re (gjb)
* ps(1): Expand variables to match expanded fieldscem2016-06-012-2/+2
| | | | | | | | ki_flag and ki_tdflag have been 'long', not 'int', since 2000 and 2005, respectively. Submitted by: Shawn Wills <swills at isilon dot com> Sponsored by: EMC / Isilon Storage Division
* Fix CID 1011370 (Resource leak) in ps.truckman2016-05-252-8/+11
| | | | | | | | | | | | | There is no need to to call strdup() on the value returned by fmt(). The latter calls fmt_argv() which always returns a dynamically allocated string, and calling strdup() on that leaks the memory allocated by fmt_argv(). Wave some const magic on ki_args and ki_env to make the direct assignment happy. This requires a tweak to the asprintf() case to avoid a const vs. non-const mismatch. Reported by: Coverity CID: 1011370 MFC after: 1 week
* Use NULL instead of 0 for pointers.araujo2016-04-191-1/+1
| | | | | | kvm_open(3) will return NULL when it cannot access kernel virtual memory. MFC after: 2 weeks.
* MFHgjb2016-02-101-1/+1
|\ | | | | | | Sponsored by: The FreeBSD Foundation
| * Rename P_KTHREAD struct proc p_flag to P_KPROC.kib2016-02-091-1/+1
| | | | | | | | | | | | | | | | I left as is an apparent bug in ntoskrnl_var.h:AT_PASSIVE_LEVEL() definition. Suggested by: jhb Sponsored by: The FreeBSD Foundation
* | Explicitly add unmarked bin/ binaries to the runtime package.gjb2016-02-091-0/+1
|/ | | | | | | | Note: tcsh(1) has a MK_TCSH=no test, so this should be a separate package, which requires pre-install/post-install scripts, to be added later. Sponsored by: The FreeBSD Foundation
* Fix spelling, as recommended by igor tool.rodrigc2015-12-011-1/+1
|
* Add more text to explain --libxo flag.rodrigc2015-12-011-1/+8
|
* Update dependencies after r291406 added libelf to libkvm.bdrewery2015-12-011-0/+1
| | | | | | | | Unfortunately filemon/meta mode tracks all indirect dependencies here since ld(1) is reading libelf when linking in libkvm. Churn would be reduced if this was able to be limited to direct dependencies. Sponsored by: EMC / Isilon Storage Division
* Make libxo depend on libutil because it uses humanize_number after r287111ngie2015-10-181-1/+1
| | | | | | | | Remove overlinking in lib/libxo/tests, sbin/savecore, and usr.bin/{iscsictl,wc,xo} PR: 203673 Sponsored by: EMC / Isilon Storage Division
* Update META_MODE dependencies.bdrewery2015-09-171-0/+1
|
* Upgrade libxo to 0.4.5.marcel2015-08-241-1/+1
| | | | | | | Local changes incorporated by 0.4.5: r284340 Local changes retained: r276260, r282117 Obtained from: https://github.com/Juniper/libxo
* mdoc: minor Xr fixesjoel2015-07-141-2/+2
|
* Add META_MODE support.sjg2015-06-131-0/+22
|\ | | | | | | | | | | | | | | | | | | | | Off by default, build behaves normally. WITH_META_MODE we get auto objdir creation, the ability to start build from anywhere in the tree. Still need to add real targets under targets/ to build packages. Differential Revision: D2796 Reviewed by: brooks imp
| * dirdeps.mk now sets DEP_RELDIRsjg2015-06-081-2/+0
| |
| * Merge sync of headsjg2015-05-277-177/+260
| |\
| * \ Merge from head@274682sjg2014-11-192-2/+4
| |\ \
| * \ \ Merge head from 7/28sjg2014-08-192-1/+15
| |\ \ \
| * | | | Updated dependenciessjg2014-05-161-1/+0
| | | | |
| * | | | Updated dependenciessjg2014-05-101-0/+3
| | | | |
| * | | | Merge from headsjg2014-05-083-7/+62
| |\ \ \ \
| * \ \ \ \ Merge headsjg2014-04-282-10/+5
| |\ \ \ \ \
| * \ \ \ \ \ Merge from headsjg2013-09-052-0/+4
| |\ \ \ \ \ \
| * \ \ \ \ \ \ sync from headsjg2013-04-121-1/+5
| |\ \ \ \ \ \ \
| * | | | | | | | Updated dependenciessjg2013-03-111-0/+1
| | | | | | | | |
| * | | | | | | | Updated dependenciessjg2013-02-161-2/+0
| | | | | | | | |
| * | | | | | | | Sync with HEAD.obrien2013-02-084-14/+35
| |\ \ \ \ \ \ \ \
| | \ \ \ \ \ \ \ \
| | \ \ \ \ \ \ \ \
| *-. \ \ \ \ \ \ \ \ Sync from headsjg2012-11-044-7/+15
| |\ \ \ \ \ \ \ \ \ \
| * | | | | | | | | | | Sync FreeBSD's bmake branch with Juniper's internal bmake branch.marcel2012-08-221-0/+21
| | |/ / / / / / / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Requested by: Simon Gerraty <sjg@juniper.net>
* | | | | | | | | | | Remove unused variable, this variable fmtstr was introduced at revision r225868araujo2015-06-011-6/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | and it is not used anymore after the convertion to use libxo at revision r283304. Differential Revision: D2678 Reviewed by: marcel
* | | | | | | | | | | Document recent p_flag2 additions.pluknet2015-05-271-1/+4
| |_|_|_|_|_|_|_|_|/ |/| | | | | | | | |
* | | | | | | | | | Convert to use libxo. Document use of libxo as well.marcel2015-05-226-166/+253
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Obtained from: Phil Shafer <phil@juniper.net> Sponsored by: Juniper Networks, Inc.
* | | | | | | | | | Use 24h timestamps in the ps(1) STARTED columnfeld2015-03-172-9/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The previous 12h AM/PM format was perplexing as it didn't follow the locale of the user and was a minor annoyance to FreeBSD users coming from Linux. Additionally, the man page was incorrect about the strftime format. There are three time formats that may be displayed in the STARTED column depending on the age of the process. Below is an example. For a process started at 14:30 on Monday 16 March 2015, the following formats may be used: 14:30 for process < 24h old (24h Timestamp) Mon14 for process > 24h, < 1 week old (Weekday Hour) 16Mar15 for process > 1 week old (Day Month Year) Differential Revision: https://reviews.freebsd.org/D1620 Reviewed by: brd Approved by: trasz
* | | | | | | | | | Prevent access to an uninitialized variablepfg2015-01-311-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The "-h" option may access an uninitialized value. Prevent it by properly initializing the value. CID: 1006559
* | | | | | | | | | Add facility to stop all userspace processes. The supposed use of thekib2014-12-131-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | feature is to quisce the system before suspend. Stop is implemented by reusing the thread_single(9) with the special mode SINGLE_ALLPROC. SINGLE_ALLPROC differs from the existing single-threading modes by allowing (requiring) caller to operate on other process. Interruptible sleeps for !TDF_SBDRY threads are suspended like SIGSTOP does it, instead of aborting the sleep, like SINGLE_NO_EXIT, to avoid spurious EINTRs on resume. Provide debugging sysctl debug.stop_all_proc, which causes total stop and suspends syncer, while waiting for variable reset for resume. It is used for debugging; should be removed after the real use of the interface is added. In collaboration with: pho Discussed with: avg Sponsored by: The FreeBSD Foundation MFC after: 2 weeks
* | | | | | | | | | Convert bin/ to LIBADD, reduce overlinking allow to build all components asbapt2014-11-251-2/+1
| |_|_|_|_|_|_|_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | static
* | | | | | | | | Return real parent pid in kinfo (used by e.g. ps)mjg2014-08-282-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a separate field which exports tracer pid and add a new keyword ("tracer") for ps to display it. This is a follow up to r270444. Reviewed by: kib MFC after: 1 week Relnotes: yes
* | | | | | | | | Correct the problems with the ptrace(2) making the debuggee an orphan.kib2014-08-071-2/+1
| |_|_|_|_|_|_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | One problem is inferior(9) looping due to the process tree becoming a graph instead of tree if the parent is traced by child. Another issue is due to the use of p_oppid to restore the original parent/child relationship, because real parent could already exited and its pid reused (noted by mjg). Add the function proc_realparent(9), which calculates the parent for given process. It uses the flag P_TREE_FIRST_ORPHAN to detect the head element of the p_orphan list and than stepping back to its container to find the parent process. If the parent has already exited, the init(8) is returned. Move the P_ORPHAN and the new helper flag from the p_flag* to new p_treeflag field of struct proc, which is protected by proctree lock instead of proc lock, since the orphans relationship is managed under the proctree_lock already. The remaining uses of p_oppid in ptrace(PT_DETACH) and process reapping are replaced by proc_realparent(9). Phabric: D417 Reviewed by: jhb Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 2 weeks
* | | | | | | | Add support for inspecting process flags set in p_flag2.pluknet2014-06-062-1/+15
| |_|_|_|_|_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | Reviewed by: jhb MFC after: 1 week
* | | | | | | Add -J to filter by matching jail IDs and names.bdrewery2014-05-023-7/+62
| |_|_|_|_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | -J 0 can be used to show only host processes. Patch partially based on work by bz@ PR: bin/78763 MFC after: 2 weeks Relnotes: yes
* | | | | | Correct the description of the V state, which indicates that the process'markj2013-12-281-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | parent is suspended, not the process itself. MFC after: 3 days
* | | | | | Don't test arrays for being NULL.trasz2013-10-211-7/+1
| |_|_|_|/ |/| | | | | | | | | | | | | | MFC after: 1 month
* | | | | Add the ability to display the default FIB number for a process to thewill2013-08-262-0/+4
| |_|_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ps(1) utility, e.g. "ps -O fib". bin/ps/keyword.c: Add the "fib" keyword and default its column name to "FIB". bin/ps/ps.1: Add "fib" as a supported keyword. sys/compat/freebsd32/freebsd32.h: sys/kern/kern_proc.c: sys/sys/user.h: Add the default fib number for a process (p->p_fibnum) to the user land accessible process data of struct kinfo_proc. Submitted by: Oliver Fromme <olli@fromme.com>, gibbs
* | | | Add a few examples.joel2013-03-151-1/+5
| | | | | | | | | | | | | | | | Obtained from: OpenBSD
* | | | Document P_PPTRACE.kib2013-02-071-1/+2
| |_|/ |/| | | | | | | | MFC after: 2 weeks
* | | - Move 'showthreads' check out of fmt.c.jhb2013-01-192-2/+2
| | | | | | | | | | | | | | | - Update shadow copy of fmt_argv() prototype in w.c and fix calls for additional parameter.
OpenPOWER on IntegriCloud