| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
to pull vm_param.h was removed. Other big dependency of vm_page.h on
vm_param.h are PA_LOCK* definitions, which are only needed for
in-kernel code, because modules use KBI-safe functions to lock the
pages.
Stop including vm_param.h into vm_page.h. Include vm_param.h
explicitely for the kernel code which needs it.
Suggested and reviewed by: alc
MFC after: 2 weeks
|
|
|
|
|
| |
Approved by: rwatson
MFC after: 3 days
|
|
|
|
| |
MFC after: 3 days
|
|
|
|
|
|
|
| |
userspace using the obscure spare int field in struct kinfo_proc.
Submitted by: Andrey Zonov <andrey zonov org>
MFC after: 1 week
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
to the process id. It follows the ptrace(2) interface and allows debugging
libraries to use thread ids directly, without slow and verbose conversion
of thread id into pid.
The PGET_NOTID flag is provided to allow a specific sysctl to disallow
this behaviour. All current callers of pget(9) have useful semantic to
operate on tid and do not need this flag.
Reviewed by: jhb, trocini
MFC after: 1 week
|
|
|
|
|
|
| |
Suggested by: kib
Reviewed by: kib
MFC after: 2 weeks
|
|
|
|
|
| |
Requested by: src
MFC after: 1 week
|
|
|
|
|
|
|
| |
Submitted by: Dmitry Banschikov <me ubique spb ru>
Discussed with: kib, rwatson
Reviewed by: kib
MFC after: 2 weeks
|
|
|
|
|
|
| |
PS_STRINGS sysctls: they are read only.
MFC after: 1 week
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- retrive only one, specified limit for a process, not the whole
array, as it was previously (the sysctl has been added recently and
has not been backported to stable yet, so this change is ok);
- allow to set a resource limit for another process.
Submitted by: Andrey Zonov <andrey at zonov.org>
Discussed with: kib
Reviewed by: kib
MFC after: 2 weeks
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
to read strings completely to know the actual size.
As a side effect it fixes the issue with kern.proc.args and kern.proc.env
sysctls, which didn't return the size of available data when calling
sysctl(3) with the NULL argument for oldp.
Note, in get_ps_strings(), which does actual work for proc_getargv() and
proc_getenvv(), we still have a safety limit on the size of data read in
case of a corrupted procces stack.
Suggested by: kib
MFC after: 3 days
|
|
|
|
| |
MFC after: 1 week
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
locate a process calling pfind() and do some additional checks like
p_candebug(). To reduce this code duplication a new function pget() is
introduced and used.
As the function may be useful not only in kern_proc.c it is in the
kernel name space.
Suggested by: kib
Reviewed by: kib
MFC after: 2 weeks
|
|
|
|
|
|
|
| |
was intended to be in r228288.
Spotted by: many
MFC after: 1 week
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Citing jilles:
If we are ever going to do ASLR, the AUXV information tells an attacker
where the stack, executable and RTLD are located, which defeats much of
the point of randomizing the addresses in the first place.
Given that the AUXV information seems to be used by debuggers only anyway,
I think it would be good to move it to p_candebug() now.
The full virtual memory maps (KERN_PROC_VMMAP, procstat -v) are already
under p_candebug().
Suggested by: jilles
Discussed with: rwatson
MFC after: 1 week
|
|
|
|
|
|
| |
for P_WEXIT and P_SYSTEM flags.
Reviewed by: kib
|
|
|
|
|
| |
Suggested by: kib
Reviewed by: kib
|
|
|
|
|
|
| |
need to hold it when checking process sv_flags.
MFC after: 2 weeks
|
|
|
|
|
| |
Reviewed by: kib
MFC after: 2 weeks
|
|
|
|
| |
Discussed with: kib
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
environment strings and ELF auxiliary vectors from a process stack.
Make sysctl_kern_proc_args to read not cached arguments from the
process stack.
Export proc_getargv() and proc_getenvv() so they can be reused by
procfs and linprocfs.
Suggested by: kib
Reviewed by: kib
Discussed with: kib, rwatson, jilles
Tested by: pho
MFC after: 2 weeks
|
|
|
|
|
|
| |
properly done with the acquired vmspace reference.
Pointed out by: kib
|
|
|
|
| |
of p->p_vmspace like it is done in sysctl_kern_proc_vmmap().
|
|
|
|
|
|
|
| |
entries with superpages.
Submitted by: Mel Flynn <mel.flynn+fbsd.hackers@mailing.thruhere.net>
Reviewed by: alc, rwatson
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
patch modifies makesyscalls.sh to prefix all of the non-compatibility
calls (e.g. not linux_, freebsd32_) with sys_ and updates the kernel
entry points and all places in the code that use them. It also
fixes an additional name space collision between the kernel function
psignal and the libc function of the same name by renaming the kernel
psignal kern_psignal(). By introducing this change now we will ease future
MFCs that change syscalls.
Reviewed by: rwatson
Approved by: re (bz)
|
|
|
|
|
|
|
|
|
|
| |
query the needed size for a sysctl result by passing in a NULL old
pointer and a valid oldsize. The kern.proc.args sysctl handler broke
this assumption by not calling SYSCTL_OUT() if the old pointer was
NULL.
Approved by: re (kib)
MFC after: 3 days
|
|
|
|
|
|
|
|
|
| |
Provide backward compatibility defines under BURN_BRIDGES.
Suggested by: jhb
Reviewed by: emaste
Sponsored by: Sandvine Incorporated
Approved by: re (kib)
|
|
|
|
|
|
|
|
|
|
|
|
| |
ki_rusage member when KERN_PROC_INC_THREAD is passed to one of the
process sysctls.
- Correctly account for the current thread's cputime in the thread when
doing the runtime fixup in calcru().
- Use TIDs as the key to lookup the previous thread to compute IO stat
deltas in IO mode in top when thread display is enabled.
Reviewed by: kib
Approved by: re (kib)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
file and processes information retrieval from the running kernel via sysctl
in the form of new library, libprocstat. The library also supports KVM backend
for analyzing memory crash dumps. Both procstat(1) and fstat(1) utilities have
been modified to take advantage of the library (as the bonus point the fstat(1)
utility no longer need superuser privileges to operate), and the procstat(1)
utility is now able to display information from memory dumps as well.
The newly introduced fuser(1) utility also uses this library and able to operate
via sysctl and kvm backends.
The library is by no means complete (e.g. KVM backend is missing vnode name
resolution routines, and there're no manpages for the library itself) so I
plan to improve it further. I'm commiting it so it will get wider exposure
and review.
We won't be able to MFC this work as it relies on changes in HEAD, which
was introduced some time ago, that break kernel ABI. OTOH we may be able
to merge the library with KVM backend if we really need it there.
Discussed with: rwatson
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- Hold the proc lock while changing the state from PRS_NEW to PRS_NORMAL
in fork to honor the locking requirements. While here, expand the scope
of the PROC_LOCK() on the new process (p2) to avoid some LORs. Previously
the code was locking the new child process (p2) after it had locked the
parent process (p1). However, when locking two processes, the safe order
is to lock the child first, then the parent.
- Fix various places that were checking p_state against PRS_NEW without
having the process locked to use PROC_LOCK(). Every place was already
locking the process, just after the PRS_NEW check.
- Remove or reduce the use of PROC_SLOCK() for places that were checking
p_state against PRS_NEW. The PROC_LOCK() alone is sufficient for reading
the current state.
- Reorder fill_kinfo_proc() slightly so it only acquires PROC_SLOCK() once.
MFC after: 1 week
|
|
|
|
| |
it using "ps -o class".
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
compiled conditionally on options CAPABILITIES:
Add a new credential flag, CRED_FLAG_CAPMODE, which indicates that a
subject (typically a process) is in capability mode.
Add two new system calls, cap_enter(2) and cap_getmode(2), which allow
setting and querying (but never clearing) the flag.
Export the capability mode flag via process information sysctls.
Sponsored by: Google, Inc.
Reviewed by: anderson
Discussed with: benl, kris, pjd
Obtained from: Capsicum Project
MFC after: 3 months
|
|
|
|
|
|
|
|
| |
automatically traced. Extend the ptrace(PL_LWPINFO) to report that child
just forked.
Reviewed by: davidxu, jhb
MFC after: 2 weeks
|
| |
|
|
|
|
| |
MFC after: 1 week
|
|
|
|
|
|
| |
PR: kern/148710
Tested by: Chip Camden <sterling at camdensoftware.com>
MFC after: 1 week
|
|
|
|
| |
Submitted by: bde
|
|
|
|
| |
Discussed with: kib
|
|
|
|
|
|
|
|
| |
process address.
Add "tdaddr" keyword to ps(1) to display this thread address.
Distilled from Sandvine's patch set by Mark Johnston.
|
|
|
|
|
|
|
|
|
| |
use '-' in probe names, matching the probe names in Solaris.[1]
Add userland SDT probes definitions to sys/sdt.h.
Sponsored by: The FreeBSD Foundation
Discussed with: rwaston [1]
|
|
|
|
|
|
| |
of p_traceflag that is stored in the kinfo_proc structure. It is still
racey even with the lock and the code will read a consistent snapshot of
the flag without the lock.
|
|
|
|
|
|
|
|
| |
sysctl_kern_proc_vmmap().
Sponsored by: Sandvine Incorporated
Reviewed by: kib, emaste
MFC after: 1 week
|
|
|
|
|
|
| |
Reported and tested by: nwhitehorn
Pointy hat to: kib
MFC after: 6 days
|
|
|
|
|
| |
Submitted by: bde
MFC after: 1 week
|
|
|
|
|
| |
Requested by: bde
MFC after: 10 days
|
|
|
|
|
|
|
|
|
|
| |
machine-specific header files. Add KINFO_PROC32_SIZE for struct
kinfo_proc32 for architectures providing COMPAT_FREEBSD32. Add
CTASSERT for the size of struct kinfo_proc32.
Submitted by: pluknet
Reviewed by: imp, jhb, nwhitehorn
MFC after: 2 weeks
|
|
|
|
|
|
| |
Submitted by: emaste
Pointy hat to: kib (who needs much bigger wardrobe)
MFC after: 1 week
|
|
|
|
|
|
|
|
|
|
| |
mostly work on 64bit host.
The work is based on an original patch submitted by emaste, obtained
from Sandvine's source tree.
Reviewed by: jhb
MFC after: 1 week
|
|
|
|
|
|
|
|
|
|
| |
in the process queue when gathering information for the process, and set
of signals pending for the thread, when gathering information for the
thread. Previously, the sysctl returned a union of the process and some
arbitrary thread pending set for the process, and union of the process
and the thread pending set for the thread.
MFC after: 1 week
|