summaryrefslogtreecommitdiff
path: root/lib/libkvm
AgeCommit message (Collapse)Author
2013-03-28Avoid using PAGE_SHIFT, PAGE_SIZE, and PAGE_MASK defines, since we alreadyTheo de Raadt
know it from the machine. ok miod
2013-03-23do not need udf_extern.hTheo de Raadt
2013-03-20spacesTheo de Raadt
2013-03-20When non-root asks sysctl for kinfo proc or file requests, do not fill inTheo de Raadt
any kernel addresses information. ok guenther
2013-01-14No longer need the "miniproc" glue, as we only have kinfo_proc now.Philip Guenther
ok deraadt@ pirofti@ kettenis@
2012-12-05Remove excessive sys/cdefs.h inclusionTheo de Raadt
ok guenther millert kettenis
2012-11-12Fix pid matching on kernel crashdumps in kvm_getprocs(KERN_PROC_PID)Philip Guenthe
2012-08-23knowledge of nnpfs can be removedTheo de Raadt
2012-08-02remove leftover NOLINT, WANTLINT, LINTFLAGS, LOBJ vars and lint targets.Okan Demirmen
ok guenther@
2012-07-09Use the PAGE_* forms (instead of the ancient BSD forms) in param.h,Theo de Raadt
because param.h will get a kick in the head sometime in the future. One day, maybe both can become invisible, but we boot one of them first. ok guenter
2012-06-02Committed the wrong version (an earlier try) of the KERN_FILE2 vsPhilip Guenthe
rthreads fix. Update to the correct one.
2012-05-01Eliminate the f_usecount ref count in struct file; instead of sleepingPhilip Guenthe
at the top of closef() until all in-progress calls finish, just do the advisory locking bits required of close() by POSIX and let whichever thread has the last reference do the call to the file's fo_close() method and the final cleanup. lots of discussion with deraadt@ and others; worked out with and ok krw@
2012-04-20Fix kvm_deadfile2_byid()'s handling of kernel vs user addresses forPhilip Guenthe
fd_ofiles and fd_ofileflags, reading in the separate allocation when necessary. Lets fstat -p and fstat -u work on kernel crash dumps again. ok millert@
2012-04-17Make it optional for kvm_getprocs() (and related sysctl) to returnPaul Irofti
thread information. Add a KERN_PROC_SHOW_THREADS flag that has to be set in order to get the thread info and make it off by default. This creates backwards compatibility for applications that relied on a given size/number of items to be returned. Modify ps(1) and top(1) accordingly. Okay guenther@.
2012-04-14Make kvm_getfile2() have a fighting change to work correctly on crashPhilip Guenthe
dumps
2012-04-14Update to match nprocs-->nprocess/nthreads changesPhilip Guenthe
2012-04-14Need to read in the vmspace to dig out the root of the rb-treePhilip Guenthe
2012-04-12Add per thread accounting, mainly for usage & friends.Paul Irofti
This expands the already bloated FILL_KPROC macro to take an extra parameter that indicates if the callee is a thread or a process. The userland bits are adjusted accordingly and ps(1) and top(1) now display per thread usage times when -H is used. Also pkill(1) had to be adjusted so that duplicates don't pop up. libkvm does basically the same thing as the kernel bits. Okay guenther@.
2012-04-11libkvm: minor bumpAriane van der Steldt
Due to the struct size of vm_map_entry having grown by sizeof(vsize_t).
2012-03-28The kinfo_file2 structure's f_wbytes member was being filled with thePhilip Guenthe
read byte count instead of the written byte count. pointed out by paulm at tetrardus.net, ok dcoppa@
2012-03-23Make rusage totals, itimers, and profile settings per-process insteadPhilip Guenthe
of per-rthread. Handling of per-thread tick and runtime counters inspired by how FreeBSD does it. ok kettenis@
2012-03-16pull in more .h (spotted since struct vnode was not in scope)Theo de Raadt
2012-03-130 is a valid uid for files sysctl, don't skip it. reminded by guentherTed Unangst
2012-03-09Major bump, since struct vm_map and vm_map_entry changed size and layout.Ariane van der Steldt
2012-03-09Userspace counterpart of new vmmap.Ariane van der Steldt
Allows memory walks to function.
2012-01-07Add rtable id and thread id to struct kinfo_proc (and fix process id)Philip Guenthe
and add an 'rtableid' keyword to ps. Add rtable id, thread id, and socket splice info to struct kinfo_file2 and make fstat display socket splice information. Remove old KVM_PROC2 and kinfo_proc2 interfaces; bump libkvm major Socket splice info and corrections from bluhm@ "Lovely" deraadt@
2011-12-14The ktrace vnode has moved to struct process and changed name.Philip Guenthe
Missed commit pointed out by mikeb@
2011-08-18where a man page has multiple links, only reference that pageJason McIntyre
once in SEE ALSO; also prefer Xr to Fn where relevant; diff started by Martin Pelikan
2011-07-09Copied from hppa; should work for hppa64 as well.Mark Kettenis
2011-07-05Recommit the reverted sigacts change now that the NFS use-after-freePhilip Guenthe
problem has been tracked down. This fixes the sharing of the signal handling state: shared bits go in sigacts, per-rthread bits goes in struct proc. ok deraadt@
2011-07-04move the specfs code to a place people can see it; ok guenther thib krwTheo de Raadt
2011-06-06Userland counterpart of the vmmap backout; cranks major version of libkvm.Ariane van der Steldt
2011-05-24Reimplement uvm/uvm_map.Ariane van der Steldt
vmmap is designed to perform address space randomized allocations, without letting fragmentation of the address space go through the roof. Some highlights: - kernel address space randomization - proper implementation of guardpages - roughly 10% system time reduction during kernel build Tested by alot of people on tech@ and developers. Theo's machines are still happy.
2011-04-18Revert the sigacts diff: NFS can apparently retain pointers to processesPhilip Guenthe
until they're zombies and then send them signals (for intr mounts). Until that is untangled, the sigacts change is unsafe. sthen@ was the victim for this one
2011-04-15p_sigacts is NULL for zombies, so FILL_KPROC() and kvm_proclist() havePhilip Guenthe
to handle that with the sigacts change. problem observed and diagnosed by claudio@ and kettenis@
2011-04-15Correct the sharing of the signal handling state: stuff that shouldPhilip Guenthe
be shared (p_sigignore, p_sigcatch, P_NOCLDSTOP, P_NOCLDWAIT) moves to struct sigacts, wihle stuff that should be per rthread (ps_oldmask, SAS_OLDMASK, ps_sigstk) moves to struct proc. Treat the coredumping state bits (ps_sig, ps_code, ps_type, ps_sigval) as per-rthread until our locking around coredumping is better. Oh, and remove the old SunOS-compat ps_usertramp member. "I like the sound of this" tedu@
2011-04-10Pull more headers to avoid warnings about structs being undefined.Miod Vallat
2011-04-10Pull more headers to avoid warnings about structs being undefined.Miod Vallat
2011-03-12missing word;Jason McIntyre
2011-03-12Replace the old, broken KERN_PROC ABI and its matching functionsPhilip Guenthe
in libkvm with the stable-ABI versions that are currently named KERN_PROC2, kvm_get{proc,argv,envv}2(). The latter names and symbols will continue to be supported for a few releases. Committing now that they ports people have had a couple releases to update pkgs that usd the old functions
2010-09-20according to ingo, it isn;t a problem to have empty [BDS]q macros, soJason McIntyre
revert that part of yesterday's diffs;
2010-09-19more wacky macro fixing;Jason McIntyre
2010-07-26Correct the links between threads, processes, pgrps, and sessions,Philip Guenthe
so that the process-level stuff is to/from struct process and not struct proc. This fixes a bunch of problem cases in rthreads. Based on earlier work by blambert and myself, but mostly written at c2k10. Tested by many: deraadt, sthen, krw, ray, and in snapshots
2010-07-17Move some macros in <msdosfs/denode.h> to outside the #ifdef _KERNELPhilip Guenthe
so that libkvm doesn't need to define that, thereby avoiding some warnings. ok miod@
2010-06-29Fail instead of lying if a process asks sysctl()'s KERN_PROC2 orPhilip Guenthe
KERN_FILE2 (or their libkvm wrappers) for more information than the running implementation knows how to provide. ok millert@ deraadt@
2010-02-03Use MACHINE_CPU instead of MACHINE_ARCH to pick the correct machine dependentMiod Vallat
files or directories when applicable. The inspiration and name of MACHINE_CPU come from NetBSD, although the way to provide it to Makefiles is completely different. ok kettenis@
2010-01-12the comment is right, this can indeed go away.Jasper Lievisse Adriaanse
it's unused inside libkvm, and nothing else is allowed to use it. ok guenther@ "sure" deraadt@
2010-01-10Reimplement kvm_getproc2()'s support for reading crash dumps andPhilip Guenthe
/dev/mem to be direct instead of going through kvm_getprocs(), as that function is going to get more an more broken as we move stuff from struct proc to struct process for rthreads. To minimize the code copying, put the common logic of filling in a kinfo_proc2 structure into a macro FILL_KPROC2() in <sys/sysctl.h> for use from both the kernel and user-space. This also hides the KERN_PROC #define behind "#if defined(_KERNEL)||defined(_LIBKVM)", as it's deprecated. Positive feedback from millert and blambert; so committing to unblock further rthreads work.
2009-12-07Get page size information by reading the kernel image' struct uvmexp, insteadMiod Vallat
of the value of PAGE_SIZE found in the standard headers when compiling.
2009-11-22Oops, KSEG -> CKSEG.Miod Vallat