summaryrefslogtreecommitdiffstats
path: root/usr.sbin/procmap/procmap.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* procmap fumbles with uvm_map_addr structures, which are now in RBTsdlg2016-09-161-16/+31
| | | | | | | | | | | | | | | | | | it also does proper traversal of the tree (ie, it does FOREACH) which in turn uses MIN and NEXT operations to iterate over the whole tree. theyre complicated and need code. so for now this pulls in subr_tree.c from the kernel and builds it as part of procmap. that allows for traversal of the RBT using the same code that the kernel uses. it is a bit ugly though because procmap updates the pointers between items in the tree so they point at local copies instead of kernel addresses. its made worse because RBT code has pointers between rb_entry structs, not between the nodes. im putting this in now to unbreak the tree. it can be polished after coffee/naps.
* Re-introduce vnode-to-filename mappingstefan2016-05-261-4/+70
| | | | | | | | The name cache walking code got adapted to the new name cache layout. Along with the previous commit, procmap is now able to map a vnode to a filename as long as it is in the name cache. "nice stuff" deraadt@
* Must extract uvm_vnode from uvm_object first before reading the vnodestefan2016-05-251-3/+11
| | | | | | | | | Otherwise procmap interprets the uvm_vnode contents as a vnode, yielding bogus values. This should cure the "procmap: invalid address (ffffffffffffffff) == -1 vs. 656 @ ffffffffffffffff" error messages that appear sporadically. ok deraadt@
* Remove am_maxslot from amap.stefan2016-04-161-7/+2
| | | | | | | | | | am_maxslot represents the total number of slots an amap can be extended to. Since we do not extend amaps, this field as well as rounding the number of slots to the next malloc bucket is not useful. This also removes the corresponding output from procmap(1). ok kettenis@
* Also print the fspace member of map entries when PRINT_VM_MAP_ENTRY iskettenis2015-01-191-2/+4
| | | | | | requested. ok deraadt@
* Replace <sys/param.h> with <limits.h> and other less dirty headers wherederaadt2015-01-161-2/+2
| | | | | | | | | possible. Annotate <sys/param.h> lines with their current reasons. Switch to PATH_MAX, NGROUPS_MAX, HOST_NAME_MAX+1, LOGIN_NAME_MAX, etc. Change MIN() and MAX() to local definitions of MINIMUM() and MAXIMUM() where sensible to avoid pulling in the pollution. These are the files confirmed through binary verification. ok guenther, millert, doug (helped with the verification protocol)
* Replace a plethora of historical protection options with justderaadt2014-11-161-20/+20
| | | | | | | PROT_NONE, PROT_READ, PROT_WRITE, and PROT_EXEC from mman.h. PROT_MASK is introduced as the one true way of extracting those bits. Remove UVM_ADV_* wrapper, using the standard names. ok doug guenther kettenis
* Delete procfs; it's always had races and is now unused: no one noticed forguenther2014-09-081-2/+1
| | | | | | months that I broke it before the 5.5 release. confirmed as not being required by ports by sthen@, ajacoutot@, dcoppa@
* decouple struct uvmexp into a new file, so that uvm_extern.h and sysctl.hderaadt2014-07-081-1/+4
| | | | | don't need to be married. ok guenther miod beck jsing kettenis
* There really isn't a strict "heap" anymore, so just call everything likederaadt2014-07-081-4/+1
| | | | | that an anon. Useful change since BRKSIZ will soon leave the namespace. ok kettenis
* Use errc/warnc to simplify code.guenther2014-05-201-3/+2
| | | | | | Also, in 'ftp', always put the error message last, after the hostname/ipaddr. ok jsing@ krw@ millert@
* remove tendrils of namei dumping codetedu2014-02-131-4/+1
|
* use strtonumtedu2014-02-131-2/+5
|
* get ready for big ino_t; ok gunther@otto2013-08-121-3/+4
|
* Don't bother printing vm_swrss of a process, the current uvm accountingmiod2013-05-141-1/+3
| | | | logic never sets this value.
* pretty-print bigger ino_t variablesderaadt2013-04-241-7/+9
|
* revert 1.45. it depended on a kernel change we will not be making, andtedu2013-04-211-47/+21
| | | | the old code was cleaner
* for the sake of argument, let's pretend this #if 0 code isn't wantedtedu2013-03-261-79/+1
|
* rework the main loop so we can drop kmem privs a little later,tedu2013-03-231-21/+47
| | | | | | prepping for a coming kernel change. we need to call sysctl for all the procs to get their vmspace pointer, then we drop, then we go grovelling. ok deraadt
* revert, that restriction is already enforced the right waytedu2013-03-201-4/+1
|
* Only root can look at the kernel address space.deraadt2013-03-201-1/+4
|
* document a safe cast, which should be (unsigned int) instead of simplyderaadt2013-01-161-2/+3
| | | | (unsigned)
* Userspace counterpart of new vmmap.ariane2012-03-091-70/+107
| | | | Allows memory walks to function.
* Userland counterpart of the vmmap backout; cranks major version of libkvm.ariane2011-06-061-107/+70
|
* Reimplement uvm/uvm_map.ariane2011-05-241-70/+107
| | | | | | | | | | | | | 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.
* BRKSIZ is the right constant now, so I don't get lots of teeny tiny heapstedu2011-04-231-2/+2
| | | | mixed up in my address space.
* Switch back from KERN_PROC2/kinfo_proc2 to KERN_PROC/kinfo_proc nowguenther2011-04-101-6/+6
| | | | | | that we've got name we want for the API we want "ZAP!" deraadt@
* Avoid using NULL in non-pointer contexts: use 0 for integer values and '\0'miod2011-04-061-7/+3
| | | | for chars.
* Remove portalfs.thib2011-04-051-4/+1
| | | | | | | | | While it is a terribly cool idea, it's just awful and since noone has stepped up to the plate to keep it up with the current vop state, retire it to the attic. ok krw@, deraadt@, guenther@, miod@. comments from jmc@
* Update nlist array and uncomment a few things to pave the way for upcomingmiod2009-08-121-14/+7
| | | | new name cache information gathering code.
* Namecache revamp.beck2009-08-121-1/+9
| | | | | | | | | | | | | | | This eliminates the large single namecache hash table, and implements the name cache as a global lru of entires, and a redblack tree in each vnode. It makes cache_purge actually purge the namecache entries associated with a vnode when a vnode is recycled (very important for later on actually being able to resize the vnode pool) This commit does #if 0 out a bunch of procmap code that was already broken before this change, but needs to be redone completely. Tested by many, including in thib's nfs test setup. ok oga@,art@,thib@,miod@
* No longer consider kernel pointers invalid if pointing under the kernelmiod2009-06-041-28/+2
| | | | | | load address (hello, PMAP_DIRECT architectures). Makes procmap walk the kernel name cache correctly. ok art@
* document -A and include in usageotto2008-09-181-2/+2
|
* Add a flag to print amap usage.art2008-09-181-11/+72
| | | | otto@ ok
* First pass at removing clauses 3 and 4 from NetBSD licenses.ray2008-06-261-8/+1
| | | | | | | | | Not sure what's more surprising: how long it took for NetBSD to catch up to the rest of the BSDs (including UCB), or the amount of code that NetBSD has claimed for itself without attributing to the actual authors. OK deraadt@
* Define a new flag, UVM_FLAG_HOLE, for uvm_map to create a vm_map_entry ofmiod2008-06-091-4/+7
| | | | | | | | | | | | | a new etype, UVM_ET_HOLE, meaning it has no backend. UVM_ET_HOLE entries (which should be created as UVM_PROT_NONE and with UVM_FLAG_NOMERGE and UVM_FLAG_HOLE) are skipped in uvm_unmap_remove(), so that pmap_{k,}remove() is not called on the entry. This is intended to save time, and behave better, on pmaps with MMU holes at process exit time. ok art@, kettenis@ provided feedback as well.
* Use kinfo_proc2 instead of kinfo_proc.kettenis2007-10-021-7/+8
| | | | ok art@
* use calloc() to avoid malloc(n * m) overflows; checked by djm canacar jsgderaadt2007-09-021-2/+2
|
* Zap a bunch of unused VT_* tags.thib2007-05-311-3/+1
| | | | ok tedu@,pedro@
* kill some commented "struct proc *", and knf while there; ok rayderaadt2007-04-261-58/+30
|
* Don't warn for kernel_text being zero on (some) m68k systems.miod2006-07-011-1/+4
|
* Remove fdescfspedro2005-12-061-2/+1
|
* Remove kernfs, okay deraadt@.pedro2005-11-241-2/+1
|
* kill stackable filesystems ghostspedro2005-05-261-4/+1
|
* setresgid; ok deraadt@djm2005-05-031-7/+9
|
* Use the return value from getopt() instead of optopt in non-errorjaredy2005-03-251-2/+2
| | | | | | | cases since optopt is not set in these cases, and it is not required by POSIX that it should be. ok millert otto
* [From: Joris Vink]tdeval2004-07-091-7/+4
| | | | Use strtonum(3) instead of strtol(3). ok deraadt@ & me
* Off by 1 ! OK millert@, tedu@tdeval2004-04-011-2/+2
|
* more accurate msg, pr3713 from Andre Lucastedu2004-03-151-4/+2
|
* make sure we don't backwards before buffertedu2004-02-231-1/+5
|