| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When -H is specified, for kernel threads the command is formatted as
"<proc name>/<td name>" and truncated to MAXCOMLEN. But each of the
proc name and td name may be up to MAXCOMLEN bytes in length.
Also handle the ki_moretdname field to ensure that the full thread name
gets printed. This is already handled correctly when formatting for
"-o tdname".
Reported by: freqlabs
Reviewed by: freqlabs
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D25840
Notes:
svn path=/head/; revision=363649
|
| |
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
|
|
|
|
| |
Apparently libxo was fixed to do the right thing on FreeBSD,
and calling xo_no_setlocale() is no longer needed.
Reported by: phil
Notes:
svn path=/head/; revision=361962
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Use %hs (locale-based encoding) instead of %s (UTF-8) format for
strings that are expected to be in current locale encoding (date/time,
process names/argument list).
PR: 241491
Reviewed by: phil
Differential Revision: https://reviews.freebsd.org/D22160
Notes:
svn path=/head/; revision=361887
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Initially it seemed that there were multiple possible ways to do it.
Processing option -p could conditionally add selected processes and
their descendants to the list for further work, but it is not guaranteed
to know whether the -d option has been used or not, and it also doesn't
have access to the process list just yet.
There is also descendant_sort() which has access to all possibly needed
information, but serves the purely post-processing purpose of sorting
output.
Then there is the loop that uses invocation information and full process
list to create a list of processes for final display. It seems the most
natural place to implement this, but indeterminate state of the process
list and volatility of the final list that is being created obstruct
adding an elegant search for all elements of process descendancy trees.
So I opted for adding another loop, just before the one I mentioned
above. For all selected processes it conditionally adds direct
descendants to the end of this list of selected processes.
Possible usage:
* ps -auxd -p $$
* ps -auxd -p 1
* while x=$(pgrep svnlite); do clear; ps auxd -p $x; sleep 2; done
* ps -auxd -p `pgrep make`
Reviewed by: kevans, kaktus (earlier version)
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D24380
Notes:
svn path=/head/; revision=360786
|
| |
|
|
|
|
|
|
|
| |
- fracmem and mempages are double. ki_rssize should be too
- remove default case that is fully covered by all existing cases
- mark usage as dead
Notes:
svn path=/head/; revision=335023
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Apply patch submitted with PR 217159 to make ps use unlimited
width when not associated with a terminal (i.e., none of stdout, stdin,
or stderr is a tty). Update comments and man page correspondingly.
This change was requested to work around lack of -ww in scripts from
third-party packages, including Hadoop, and adds a small measure of
Linux compatibility. Hopefully few if any non-interactive scripts
depend on the old default of 79.
PR: 217159
Submitted by: n.deepak at gmail.com
Reviewed by: vangyzen jhb
Differential Revision: https://reviews.freebsd.org/D14614
Notes:
svn path=/head/; revision=330712
|
| |
|
|
|
|
|
|
|
|
|
| |
Revert r314685, and add a comment describing the original
behavior and the intent.
Reviewed by: dab@ vangyzen@ jhb@
Differential Revision: https://reviews.freebsd.org/D14530
Notes:
svn path=/head/; revision=330091
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously it just didn't work at all - kvm_getprocs(3) doesn't update
the &nentries when it returns NULL. The end result was that ps(1) showed
garbage data instead of reporting kinfo_proc size mismatch.
Reviewed by: cem
Obtained from: CheriBSD
MFC after: 2 weeks
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D12414
Notes:
svn path=/head/; revision=324367
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
A follow-up fix for r314685.
Because the -w flag is parsed after ps(1) infers termwidth from COLUMNS and
stdout, and UNLIMITED happens to be the zero value, the single -w flag in
combination with a non-terminal stdout or COLUMNS=0 could result in output
truncated at 131 characters. (Despite the output being unlimited without
-w.)
Obviously, adding more -w shouldn't truncate output lines.
The committed patch is from bdrewery@, and I've reviewed and tested it.
Submitted by: bdrewery@
Reported by: bdrewery@
Sponsored by: Dell EMC Isilon
Notes:
svn path=/head/; revision=314832
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
If stdout isn't a tty, use unlimited width output rather than truncating to
79 characters. This is helpful for shell scripts or e.g., 'ps | grep foo'.
This hardcoded width has some history: In The Beginning of History[0], the
width of ps was hardcoded as 80 bytes. In 1985, Bloom@ added detection
using TIOCGWINSZ on stdin.[1] In 1986, Kirk merged a change to check
stdout's window size instead. In 1990, the fallback checks to stderr and
stdin's TIOCGWINSZ were added by Marc@, with the commit message "new
version."[2]
OS X Darwin has a very similar modification to ps(1), which simply sets
UNLIMITED for all non-tty outputs.[3] I've chosen to respect COLUMNS
instead of behaving identically to Darwin here, but I don't feel strongly
about that. We could match OS X for parity if that is desired.
[0]: https://svnweb.freebsd.org/csrg/bin/ps/ps.c?annotate=1065
[1]: https://svnweb.freebsd.org/csrg/bin/ps/ps.c?r1=18105&r2=18106
[2]:
https://svnweb.freebsd.org/csrg/bin/ps/ps.c?r1=40675&r2=40674&pathrev=40675
[3]:
https://opensource.apple.com/source/adv_cmds/adv_cmds-168/ps/ps.c.auto.html
PR: 217159
Reported by: Deepak Nagaraj <n.deepak at gmail.com>
Notes:
svn path=/head/; revision=314685
|
| |
|
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
|
|
|
| |
Reported by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Notes:
svn path=/head/; revision=303213
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
Notes:
svn path=/head/; revision=300648
|
| |
|
|
|
|
|
|
|
| |
kvm_open(3) will return NULL when it cannot access kernel virtual memory.
MFC after: 2 weeks.
Notes:
svn path=/head/; revision=298233
|
| |
|
|
|
|
|
|
|
|
| |
and it is not used anymore after the convertion to use libxo at revision r283304.
Differential Revision: D2678
Reviewed by: marcel
Notes:
svn path=/head/; revision=283867
|
| |
|
|
|
|
|
|
| |
Obtained from: Phil Shafer <phil@juniper.net>
Sponsored by: Juniper Networks, Inc.
Notes:
svn path=/head/; revision=283304
|
| |
|
|
|
|
|
|
|
|
| |
The "-h" option may access an uninitialized value. Prevent it
by properly initializing the value.
CID: 1006559
Notes:
svn path=/head/; revision=277979
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
-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
Notes:
svn path=/head/; revision=265229
|
| |
|
|
|
|
|
|
| |
- Update shadow copy of fmt_argv() prototype in w.c and fix calls for
additional parameter.
Notes:
svn path=/head/; revision=245635
|
| |
|
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
|
|
|
| |
define.
Reviewed by: jhb
Notes:
svn path=/head/; revision=244154
|
| |
|
|
|
|
|
| |
PR: bin/171174
Notes:
svn path=/head/; revision=239883
|
| |
|
|
| |
Notes:
svn path=/head/; revision=229782
|
| |
|
|
|
|
|
| |
MFC after: 2 weeks
Notes:
svn path=/head/; revision=227840
|
| |
|
|
| |
Notes:
svn path=/head/; revision=225868
|
| |
|
|
|
|
|
| |
Found by: codespell
Notes:
svn path=/head/; revision=222178
|
| |
|
|
| |
Notes:
svn path=/head/; revision=220574
|
| |
|
|
|
|
|
|
|
|
|
| |
allows the -M option to be used without specifying -N.
PR: bin/138146
Approved by: rrs (mentor)
MFC after: 3 days
Notes:
svn path=/head/; revision=203688
|
| |
|
|
|
|
|
|
|
| |
Submitted by: Emil Mikulic - emil at dmr dot ath dot cx
Approved by: re (kib)
MFC after: 1 week
Notes:
svn path=/head/; revision=195830
|
| |
|
|
| |
Notes:
svn path=/head/; revision=192280
|
| |
|
|
|
|
|
|
|
| |
This is similar to linux's -H (or -f) switch.
MFC after: 3 weeks
Notes:
svn path=/head/; revision=192239
|
| |
|
|
| |
Notes:
svn path=/head/; revision=180596
|
| |
|
|
|
|
|
|
| |
MFC after: 1 week
Reported by: kris
Notes:
svn path=/head/; revision=173492
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- p_sflag was mostly protected by PROC_LOCK rather than the PROC_SLOCK or
previously the sched_lock. These bugs have existed for some time.
- Allow swapout to try each thread in a process individually and then
swapin the whole process if any of these fail. This allows us to move
most scheduler related swap flags into td_flags.
- Keep ki_sflag for backwards compat but change all in source tools to
use the new and more correct location of P_INMEM.
Reported by: pho
Reviewed by: attilio, kib
Approved by: re (kensmith)
Notes:
svn path=/head/; revision=172207
|
| |
|
|
| |
Notes:
svn path=/head/; revision=141578
|
| |
|
|
|
|
|
|
|
|
| |
play nicer in prisons. It also simplifies things.
Reviewed by: rwatson
Bumped into by: Jilles Tjoelker
Notes:
svn path=/head/; revision=137890
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
printing of the process environment will fail silently.
-define a function which will check to see if procfs is mounted on /proc
-Implement this test if the user specified -e
-If procfs is not mounted on /proc and -e was specified, print a warning.
informing the user that procfs(5) is required.
Reviewed by: wes, rwatson
Notes:
svn path=/head/; revision=137696
|
| |
|
|
| |
Notes:
svn path=/head/; revision=137670
|
| |
|
|
|
|
|
|
| |
an invalid <dev> is specified. Aside: It turns out that the S_ISCHR()
check is true for almost every device that we have (not just tty's).
Notes:
svn path=/head/; revision=131209
|
| |
|
|
|
|
|
|
|
| |
up checking the wrong variable for NULL.
Submitted by: bde
Notes:
svn path=/head/; revision=131024
|
| |
|
|
|
|
|
| |
in addition to "/dev/ttyp0" or "p0" and "/dev/console" or "co".
Notes:
svn path=/head/; revision=131010
|
| |
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
|
|
|
|
| |
(aka "command") will display "<defunct>", as does the output from "comm"
for those processes. Also do better checking for malloc() failures.
Submitted by: Cyrille Lefevre
Notes:
svn path=/head/; revision=130991
|
| |
|
|
|
|
|
| |
Submitted by: Cyrille Lefevre
Notes:
svn path=/head/; revision=130973
|
| |
|
|
|
|
|
| |
Submitted by: Cyrille Lefevre
Notes:
svn path=/head/; revision=130972
|
| |
|
|
|
|
|
|
|
|
| |
when copying per-process info before starting to sort the list. This way,
sort-by-CPU or sort-by-memory will only calculate values once-per-process,
instead of twice-per-comparison. Also take advantage of this to simplify
the pscomp() routine.
Notes:
svn path=/head/; revision=130816
|