| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
| |
MFC after: 1 week
Reported by: kris
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- 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)
|
| |
|
|
|
|
|
|
|
| |
play nicer in prisons. It also simplifies things.
Reviewed by: rwatson
Bumped into by: Jilles Tjoelker
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
|
| |
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).
|
|
|
|
|
|
| |
up checking the wrong variable for NULL.
Submitted by: bde
|
|
|
|
| |
in addition to "/dev/ttyp0" or "p0" and "/dev/console" or "co".
|
|
|
|
|
|
| |
using it's own version of the same basic algorithm.
Submitted by: part by Cyrille Lefevre, part of it done by me
|
|
|
|
|
|
|
| |
(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
|
|
|
|
| |
Submitted by: Cyrille Lefevre
|
|
|
|
| |
Submitted by: Cyrille Lefevre
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
his eyes at quite so much... (actually someone else pointed this out
to me a long time ago, but apparently I never fixed it)
|
|
|
|
|
|
| |
is to drop a call to setuid() which has not been needed for years.
Noticed by: bde
|
|
|
|
|
| |
remove the #ifdef for it for now. I might add the feature for real at
some later date, there isn't much reason for the #ifdef for now.
|
|
|
|
| |
Noticed by: bde
|
|
|
|
|
|
|
| |
process id, instead of using pid==0. Ie, `ps -p 12,' and `ps -p ,12'
are now errors (instead of being treated like `ps -p 0 -p 12').
Noticed by: Cyrille Lefevre on freebsd-arch
|
|
|
|
|
|
|
|
| |
is treated like `ps -t p0', instead of changing it to `ps -T p0'.
Note that `ps t' is still changed to `ps -T', since that is one of
the main reasons for this kludge processing...
Noticed by: Jilles Tjoelker on freebsd-arch
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
more special situations. This is the code which process `ps blah',
when "blah" does not include a leading '-'.
This change also removes a long-undocumented BACKWARD_COMPATIBILITY
compile-time option, where:
ps -options arg1 arg2
(with no '-' on "arg1" and "arg2") was treated as:
ps -options -N arg1 -M arg2
This also changes `ps' to check for any additional arguments after
processing all the '-'-options, and attempt to use those arguments as
a pid or pidlist. If an extra argument is not a valid pidlist, then
`ps' will print an error and exit. This seems a more generally useful
extension of the kludge-option processing than the -N/-M behavior, and
has fewer confusing side-effects.
Reviewed by: freebsd-arch
|
|
|
|
|
|
|
| |
(session-pointer) info which was dropped from `ps' earlier in 5.x.
PR: bin/59423
Submitted by: Jilles Tjoelker
|
|
|
|
|
|
|
|
| |
same as `ps -tpt', instead of being changed into `ps -tpT'.
PR: bin/52489
Submitted by: Jilles Tjoelker
MFC after: 1 week
|
|
|
|
|
|
|
|
| |
(if trying to match only one real-group or one session-id), now that
those options are implemented in src/sys/kern/kern_proc.c (v1.203).
PR: bin/65803 (a very tiny piece of the PR)
Submitted by: Cyrille Lefevre
|
|
|
|
| |
OK'ed by: imp, core
|
| |
|
|
|
|
|
| |
up the PS_ARGS string in revision 1.69 (and which was apparently not
missed by anyone...).
|
|
|
|
|
| |
because some compilers (such as gcc 2.95.4) do not support having an
unnamed union for a field in a struct.
|
|
|
|
|
|
|
| |
this to correctly handle UID's and GID's larger than 2147483647.
Noticed by: bde
MFC after: 1 week
|
|
|
|
|
|
|
| |
this way (although I still think it "looks weird"...).
Requested by: bde
MFC after: 1 week
|
|
|
|
|
| |
Noticed by: bde
MFC after: 1 week
|
|
|
|
|
|
|
|
|
|
|
| |
This corrects a problem of lost-precision for `-r' (sort-by-CPU). Also,
for sort-by-CPU and sort-by-memory, any processes which have the same
value CPU or MEMORY are now sorted by TTY and then (if needed) by pid.
(* - I just added the NODEV checks, after doing some testing of my own)
Submitted by: bde
MFC after: 1 week
|
|
|
|
| |
Noticed by: bde
|
|
|
|
|
|
|
| |
values such as P_CONTROLT and PS_INMEM. But this still won't define
PID_MAX for us, since that is hidden inside of '#ifdef _KERNEL'.
Noticed by: bde
|
|
|
|
| |
Noticed by: bde
|
|
|
|
| |
Suggested by: bde (well, for most of them)
|
|
|
|
|
|
| |
so that non-pointers are listed after pointer-type variables.
Noticed by: bde
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
| |
(if any) and exit, thus matching the behavior on -stable and other OS's.
My earlier attempt to fix this (v1.65) only seemed to work because of a
lucky random value in nentries (which was not being initialized back
when I tested that earlier patch).
|
|
|
|
|
| |
a fatal error instead of a minor warning. It is possible that a few
users are used to the previous behavior, but I'm claiming it was a bug.
|
| |
|
|
|
|
|
|
| |
is compiled with LAZY_PS, so that there is only one PS_ARGS string to
modify when changing the option-list. Also get `-f' to show up in the
usage() statement when compiled with LAZY_PS.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- Change `-p' to allow a list of process IDs, and `-t' to allow a list
of terminal names, instead of only a single value for each.
- Add the `-A' option of SUSv3, which is exactly the same as `-ax'.
- Add the `-G gidlist' (group id).
- Allow any of these "selector options" to be specified multiple times,
and have `ps' keep adding to a given list -- instead of replacing the
previously-specified values.
- Fix interactions between selector-options, so that: "If any are
specified, ... ps shall select the processes represented by the
inclusive OR of all the selection-criteria options." (from SUSv3)
- Add a `-X' option, which is the reverse of the `-x' option.
- various minor improvements in parsing and error handling.
This does not get us to match POSIX/SUSv3, but it gets us closer. The
`-g pgidlist', `-R ruserlist' and `-s sidlist' options mentioned in
freebsd-standards are still under debate, so they skipped for now.
It should be true that this introduces no user-visible incompatible
changes, except to support "new stuff" that was not supported before.
|
|
|
|
|
|
|
|
| |
if no processes were matched. Also sorts the list of 'int's in main, as
long as I had to add another one...
Noticed by: Nate Lawson
MFC after: 10 days
|
|
|
|
|
|
|
|
|
|
|
| |
just print the header (if any) and exit, thus matching the behavior on -stable
and other OS's.
Also adds support for <x> being a comma-separated list of processes, and does
a much better checking for invalid-values of <x>, such as 'ps -p someword'.
Reviewed by: mentioned on freebsd-current
MFC after: 10 days
|