aboutsummaryrefslogtreecommitdiff
path: root/lib/libmemstat
Commit message (Collapse)AuthorAgeFilesLines
* Merge Makefile:1.4 from HEAD to RELENG_6:Robert Watson2006-02-241-0/+2
| | | | | | | | | Add missing shared library interdependencies. Approved by: re (mux) Notes: svn path=/stable/6/; revision=155985
* Merge memstat_uma.c:1.17 from HEAD to RELENG_6:Robert Watson2006-02-141-1/+1
| | | | | | | | | Update copyright for 2006. Approved by: re (scottl) Notes: svn path=/stable/6/; revision=155650
* Merge memstat_uma.c:1.16 from HEAD to RELENG_6:Robert Watson2006-02-141-2/+24
| | | | | | | | | | | | | | | | The uma_zone data structure defines the size of its uz_cpu[] array as 1, but then sizes the containing data structure at run-time to make room for per-cpu cache data. Modify libmemstat to separately allocate a buffer to hold per-cpu cache data, sized based on the run-time mp_maxid variable when using libkvm to access UMA data. This avoids reading invalid cache data from beyond the end of the uma_zone data structure on the stack, which can result in invalid statistics and/or reads from invalid kernel addresses. Approved by: re (scottl) Notes: svn path=/stable/6/; revision=155648
* Merge memstat_uma.c:1.15 from HEAD to RELENG_6:Robert Watson2006-02-141-4/+2
| | | | | | | | | | | | When reporting an error reading from UMA per-cpu cache pointers using KVM, return a KVM error rather than an out of memory error, so that the caller reports the KVM error state. This replaces a misleading error message with a more accurate although equally confusing one. Approved by: re (scottl) Notes: svn path=/stable/6/; revision=155647
* Merge memstat_uma.c:1.14 from HEAD to RELENG_6:Robert Watson2006-02-141-0/+10
| | | | | | | | | | | | Read all_cpus variable out of kmem, and validate CPUs against the all_cpus cpu mask before looking at the cache entries for the CPU. For systems with sparse CPU id arrays, this skips otherwise uninitialized cache structures. Approved by: re (scottl) Notes: svn path=/stable/6/; revision=155646
* Merge memstat_uma.c:1.13 from HEAD to RELENG_6:Robert Watson2006-02-141-1/+1
| | | | | | | | | | Correct a typo in the extraction of zone information from UMA using kmem: bytes = allocated - freed, not bytes = allocated = freed. Approved by: re (scottl) Notes: svn path=/stable/6/; revision=155644
* Merge memstat_uma.c:1.12 from HEAD to RELENG_6:Robert Watson2006-02-141-1/+1
| | | | | | | | | | | | Remove unnecessary and undesirable 'static' from function-local keg list, which could cause problems for multi-threaded applications using libmemstat to monitor UMA in more than one thread simultaneously. Approved by: re (scottl) Notes: svn path=/stable/6/; revision=155632
* MFC: Markup and misc. fixes.Ruslan Ermilov2005-11-211-77/+93
| | | | Notes: svn path=/stable/6/; revision=152659
* Merge Makefile:1.5 from HEAD to RELENG_6:Robert Watson2005-11-161-0/+3
| | | | | | | Add symlinks for kvm access methods for memstat(3). Notes: svn path=/stable/6/; revision=152494
* Merge libmemstat.3:1.9 from HEAD to RELENG_6:Robert Watson2005-11-091-2/+20
| | | | | | | | Document kvm(3)-related error constants, and correct minor formatting nits. Notes: svn path=/stable/6/; revision=152232
* Merge libmemstat.3:1.8, memstat.h:1.9, memstat_all.c:1.3,Robert Watson2005-11-094-7/+190
| | | | | | | | | | | | | | | memstat_malloc:1.6 from HEAD to RELENG_6: Teach libmemstat(3) how to extract malloc(9) statistics using kvm(3), so that libmemstat can be used to view full memory statistics from kernel core dumps and /dev/mem. This is provided via a new query function, memstat_kvm_malloc(), which is also automatically invoked by memstat_kvm_all(). A kvm handle must be passed in. This will allow malloc(9)-specific code to be removed from vmstat(8). Notes: svn path=/stable/6/; revision=152231
* Merge libmemstat.3:1.7, memstat.c:1.7, memstat.h:1.8, memstat_all.c:1.2,Robert Watson2005-11-095-2/+240
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | memstat_uma.c:1.10 from HEAD to RELENG_6: Add memstat_kvm_uma(), an implementation of a libmemstat(3) query routine that knows how to extract UMA(9) allocator statistics from a core dump or live memory image using kvm(3). The caller is expected to provide the necessary kvm_t handle, which is then used by libmemstat(3). With these changes, it is trivially straight forward to re-introduce vmstat -z support on core dumps, which was lost when UMA was introduced. In the short term, this requires including vm/ include files that are not intended for extra-kernel use, requiring in turn some ugliness. Merge memstat_uma.c:1.11 from HEAD to RELENG_6: Define LIBMEMSTAT so that vm_page.h won't perform a nested include of opt_vmpage.h. Remove definition of _KERNEL, it is no longer required in order to include uma_int.h, as the sensitive parts of uma_int.h (a number of inlines depending on kernel-only constants) are now protected by _KERNEL. The use of LIBMEMSTAT here will be cleaned up in the future. Notes: svn path=/stable/6/; revision=152230
* Merge libmemstat.3:1.10 from HEAD to RELENG_6:Robert Watson2005-08-201-4/+4
| | | | | | | | | | | | | | The "Mbuf" zone was renamed "mbuf" to improve consistency, but the code example in libmemstat.3 was not updated to take this rename into account. Update the example. PR: 84946 Submitted by: Wojciech A. Koszek <dunstan at freebsd dot czest dot pl> Approved by: re (scottl) Notes: svn path=/stable/6/; revision=149342
* Merge memstat.c:1.6, memstat_internal.h:1.6, memstat_malloc.c:1.5,Robert Watson2005-08-014-4/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | memstat_uma.c:1.9 from HEAD to RELENG_6: Correct two libmemstat(3) bugs: - Move memory_type_list flushing logic from memstat_mtl_free() to _memstat_mtl_empty(), a libmemstat-internal function that can be called from other parts of the library. Invoke _memstat_mtl_empty() from memstat_mtl_free(), which also frees the containing list structure. Invoke _memstat_mtl_empty() instead of memstat_mtl_free() in various error cases in memstat_malloc.c and memstat_uma.c, which previously resulted in the list being freed prematurely. - Reverse the order of updating the mt_kegfree and mt_free fields of the memory_type in memstat_uma.c, otherwise keg free items won't be counted properly for non-secondary zones. Merged to RELENG_6 earlier than the proposed MFC after date so that it can make BETA2. Approved by: re (kensmith) Notes: svn path=/stable/6/; revision=148622
* Merge memstat_uma.c:1.8 from HEAD to RELENG_6:Robert Watson2005-07-281-1/+10
| | | | | | | | | | | If a retrieved UMA zone is a secondary zone, don't report keg free items, as they actually belong to the primary zone, and maye otherwise be reported more than once. Approved by: re (kensmith) Notes: svn path=/stable/6/; revision=148477
* This commit was manufactured by cvs2svn to create branch 'RELENG_6'.cvs2svn2005-07-247-0/+1622
| | | | Notes: svn path=/stable/6/; revision=148360
* This commit was manufactured by cvs2svn to create branch 'RELENG_6'.cvs2svn2005-07-201-0/+47
Notes: svn path=/stable/6/; revision=148212