summaryrefslogtreecommitdiffstats
path: root/runtime/alloc.c
Commit message (Collapse)AuthorAgeFilesLines
* Partial PR 10848 fix. Added testcase for STP_MAXMEMORY.David Smith2010-01-071-20/+21
| | | | | | | | | * runtime/alloc.c (_stp_kmalloc): Renamed 'MAXMEMORY' to 'STP_MAXMEMORY'. (_stp_kzalloc): Ditto. (_stp_vmalloc): Ditto. (_stp_alloc_percpu): Ditto. (_stp_kmalloc_node): Ditto. * testsuite/systemtap.base/maxmemory.exp: New test for STP_MAXMEMORY.
* Partial PR 10848 fix. Added '-DMAXMEMORY=NUM' processing.David Smith2010-01-051-8/+124
| | | | | | | | | | * runtime/alloc.c (_stp_mem_debug_validate): New debug function. (_stp_kmalloc): Added MAXMEMORY code to check size of memory used by module. (_stp_kzalloc): Ditto. (_stp_vmalloc): Ditto. (_stp_alloc_percpu): Ditto. (_stp_kmalloc_node): Ditto.
* Fixed DEBUG_MEM debug memory tracking.David Smith2009-12-151-18/+35
| | | | | | | | | * runtime/alloc.c (_stp_kmalloc): Fixed compilation when DEBUG_MEM is defined. Improved allocated memory tracking. (_stp_kzalloc): Ditto. (_stp_vmalloc): Ditto. (_stp_alloc_percpu): Ditto. (_stp_kmalloc_node): Ditto.
* runtime build: fix alloc.c buildability on old gcc 3.4Frank Ch. Eigler2009-12-111-2/+2
| | | | * runtime/alloc.c (_stp_kmalloc): Move var decl back to top.
* runtime: undefine DEBUG_MEM, retain alloc countingFrank Ch. Eigler2009-12-101-9/+10
| | | | | | | DEBUG_MEM can & does evoke locking timeouts. * runtime/alloc.c (*): Track __stp_allocated_memory regardless of DEBUG_MEM.
* runtime: print stp_alloc statistics in startup printkFrank Ch. Eigler2009-12-101-1/+1
| | | | | * runtime/alloc.c: Define DEBUG_MEM. * runtime/print.c (_stp_print_kernel_info): Reformat/rescale mem values.
* Don't let _stp_alloc_percpu allocate too much memory.David Smith2009-11-301-2/+15
| | | | | * runtime/alloc.c (_stp_alloc_percpu): Refuses to allocate too much percpu memory.
* Adapt to linux-next commit changing __alloc_percpu API.Frank Ch. Eigler2009-03-081-22/+3
| | | | | After linux-next commit f2a8205c, it takes two parameters again, so we autoconf for it rather than use KERNEL_VERSION ifdefs.
* Use 'static' as much as possibleJosh Stone2009-01-281-8/+8
| | | | | | | | | | This change just inserts 'static' on runtime, tapset, and generated C functions and globals, so the compiler can do a better job of optimizing. My tests with small scripts show ~10% reduction in compile time and ~20% reduction in module size. Larger scripts may show less benefit, but I expect purely positive results.
* 2008-01-29 Martin Hunt <hunt@redhat.com>hunt2008-01-301-4/+3
| | | | | * alloc.c (struct _stp_malloc_type): Remove redundant field.
* 2008-01-28 Martin Hunt <hunt@redhat.com>hunt2008-01-281-1/+1
| | | | | | | | * alloc.c: Use DEFINE_SPINLOCK. * counter.c: Ditto. * pmap-gen.c: Ditto. * print_new.c: Ditto. * stat.c: Ditto.
* Turn DEBUG_MEM off by default.hunt2008-01-151-1/+1
|
* Add support for memory allocation tracking.hunt2008-01-151-17/+318
|
* 2007-01-30 Martin Hunt <hunt@redhat.com>hunt2007-01-301-67/+5
| | | | | | | | | | | * alloc.c (_stp_alloc_percpu): Don't implement our own; just call __alloc_percpu with appropriate args for the OS version. (_stp_free_percpu): Delete. * map.c (_stp_map_init): When calling kmalloc_node, first call cpu_to_node() to get the proper node number. * stat.c (_stp_stat_del): Call free_percpu() instead of _stp_free_percpu().
* 2007-01-29 Martin Hunt <hunt@redhat.com>hunt2007-01-291-2/+41
| | | | | | | | | | * alloc.c (_stp_kmalloc): New function. Call kmalloc with the coirrect flags and track usage. (_stp_kzalloc): Ditto. * map.c: Use new alloc calls. * print.c: Ditto. * stat.c: Ditto. * time.c: Ditto.
* 2006-11-15 Martin Hunt <hunt@redhat.com>hunt2006-11-151-13/+16
| | | | | | | * alloc.c (STP_ALLOC_FLAGS): Define. Cleanup ifdefs. * map.c: Use STP_ALLOC_FLAGS. * stat.c: ditto.
* Cleanuphunt2006-01-251-2/+6
|
* 2006-01-25 Martin Hunt <hunt@redhat.com>hunt2006-01-251-2/+62
| | | | | | | | * stat.c (_stp_stat_init): Use _stp_alloc_percpu(). (_stp_stat_del): New function. * alloc.c (_stp_alloc_percpu): New function. (_stp_free_percpu): New function.
* 2005-12-07 Martin Hunt <hunt@redhat.com>hunt2005-12-071-186/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | PR1923 * map.h (struct map_root): Remove membuf. (struct pmap): Define. (PMAP): Declare. * map.c (_stp_map_init): Use kmalloc() to allocate individual nodes instead of using vmalloc() to allocate one big chunk. (_stp_map_new): Use kmalloc. (_stp_pmap_new): Use kmalloc. Return a PMAP. (__stp_map_del): New function. Free all the nodes in a map. (_stp_map_del): Call __stp_map_del() then free map struct. (_stp_pmap_del): Takes a PMAP. Calls __stp_map_del() for each cpu. (_stp_pmap_printn_cpu): Change arg to PMAP. (_stp_pmap_agg): Change arg to PMAP. (_stp_pmap_get_agg): Change arg to PMAP. * map-stat.c (_stp_pmap_new_hstat_linear): Use PMAP instead of MAP. Fix allocations. (_stp_pmap_new_hstat_log): Ditto. * pmap-gen.c Fix all functions to take or return PMAPS instead of MAPS. * alloc.c: Remove everything except kmalloc_node(). All runtime code now uses kmalloc() directly.
* 2005-11-28 Martin Hunt <hunt@redhat.com>hunt2005-11-281-14/+6
| | | | | | | | | | | * alloc.c (__stp_valloc_percpu): Use same code for up and smp. (_stp_per_cpu_ptr): New macro. * user/alloc.c: Ditto. * map.c: Use _stp_map_cpu_ptr(). * map-stat.c: Ditto. * pmap-gen.c: Ditto. * runtime.h: Include alloc.c * user/runtime.h: Ditto.
* 2005-11-10 Martin Hunt <hunt@redhat.com>hunt2005-11-101-2/+2
| | | | | | * map.c: Doc updates. * pmap-gen.c: Change a bunch of generated function names to avoid conflicts with maps with the same key and value types.
* 2005-11-08 Martin Hunt <hunt@redhat.com>hunt2005-11-081-21/+2
| | | | | * alloc.c (__stp_valloc_percpu): Fix call to vmalloc_node. (vmalloc_node): Remove nonworking code.
* *** empty log message ***hunt2005-11-081-4/+4
|
* 2005-11-08 Martin Hunt <hunt@redhat.com>hunt2005-11-081-2/+1
| | | | * alloc.c (__stp_valloc_percpu): Fix call to vmalloc_node.
* 2005-11-08 Martin Hunt <hunt@redhat.com>hunt2005-11-081-0/+138
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * map.c (_stp_map_init): New function. Extracted from _stp_map_new() so it can be used in _stp_pmap_new(). (_stp_map_new): Call _stp_map_init(). (_stp_pmap_new): New function. (_stp_pmap_new_hstat_linear): New function. (_stp_pmap_new_hstat_log): New function. (_stp_pmap_del): New function. (_stp_pmap_printn_cpu): New function. (_stp_pmap_printn): New function. (_stp_new_agg): New function. (_stp_add_agg): New function. (_stp_pmap_agg): New function. (_new_map_clear_node): New function. * map.h (struct map_root): Add Hist struct. Add copy and cmp function pointers for pmaps. * stat.h: Remove Stat struct. Replace with Hist struct that is limited to only histogram params. * map-stat.c: Fix up references to histogram params in map_root. * stat-common.c: Ditto. * stat.c: Ditto. * pmap-gen.c: New file. Implements per-cpu maps. * map-gen.c: Minor bug fixes. Use new VAL_IS_ZERO() macro. * alloc.c (vmalloc_node): For NUMA, provide a vmalloc that does node-local allocations. (_stp_alloc_cpu): A version of _stp_alloc() that does node-local allocations. (_stp_valloc): A version of _stp_valloc() that does node-local allocations. (__stp_valloc_percpu): New function. Like alloc_percpu() except uses _stp_valloc(). (_stp_vfree_percpu): New function. Like free_percpu().
* 2005-10-31 Martin Hunt <hunt@redhat.com>hunt2005-10-311-1/+2
| | | | * ALL: Cleanup copyrights.
* 2005-07-01 Martin Hunt <hunt@redhat.com>hunt2005-07-011-7/+12
| | | | | | | | | | | | * alloc.c (_stp_alloc): Call _stp_error(). (_stp_valloc): Ditto. * io.c (_stp_warn): New function. (_stp_exit): New function. (_stp_error): New function. (_stp_dbug): New function. * runtime.h (dbug): Call _stp_dbug() if DEBUG is defined.
* 2005-05-26 Martin Hunt <hunt@redhat.com>hunt2005-05-261-7/+4
| | | | | | | | * current.c (_stp_sprint_regs): Implement for i386. * sym.c (_stp_symbol_sprint): Check name before trying to print it. (_stp_symbol_print): Change to macro that calls _stp_symbol_sprint().
* *** empty log message ***hunt2005-03-291-0/+93