summaryrefslogtreecommitdiffstats
path: root/runtime/pmap-gen.c
Commit message (Collapse)AuthorAgeFilesLines
* PR4105: support up to 9 (up from 5) array index dimensionsFrank Ch. Eigler2009-04-011-0/+343
| | | | | | | | * runtime/map-gen.c, pmap-gen.c: Hand-expand arity 6..9 cases throughout. * testsuite/buildok/thirty.stp: New test. * testsuite/buildko/two.stp: New test. An Alan Smithee patch.
* Use 'static' as much as possibleJosh Stone2009-01-281-9/+9
| | | | | | | | | | 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.
* Fix the conflicted for_each_cpu macro with 2.6.28.Wenji Huang2008-11-171-3/+3
|
* 2008-02-27 Martin Hunt <hunt@redhat.com>hunt2008-02-271-5/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | * sym.h (_stp_module): Add text_size, lock, and unwind data pointer. * sym.c (_stp_find_module_by_addr): New function. (_stp_kallsyms_lookup): Call _stp_find_module_by_addr(). (_stp_get_unwind_info): New. * runtime.h: Move debug macros to debug.h. Include it. * debug.h: New file. * map.c: Update debug calls. * map-gen.c: Update debug calls. * pmap-gen.c: Update debug calls. * mempool.c: New file. * symbols.c: Use rwlocks. Use new dbug macros. Handle unwind info if present. * transport.c: Include mempool.c. Update dbug and kbug calls to new macros. * transport_msgs.h (_stp_command_name): Add struct containing message names for debugging. * control.c, procfs.c: Use new dbug macros. Use new mempool functions.
* 2008-01-28 Martin Hunt <hunt@redhat.com>hunt2008-01-281-3/+3
| | | | | | | | * alloc.c: Use DEFINE_SPINLOCK. * counter.c: Ditto. * pmap-gen.c: Ditto. * print_new.c: Ditto. * stat.c: Ditto.
* 2007-09-12 Martin Hunt <hunt@redhat.com>hunt2007-09-121-15/+9
| | | | | | | | | | | | | | | | | | | | | | | * map-stat.c (_stp_map_new_hstat_log): Set buckets to HIST_LOG_BUCKETS. (_stp_pmap_new_hstat_log): Ditto. (_stp_map_new_hstat_linear): Call _stp_stat_calc_buckets(). (_stp_pmap_new_hstat_linear): Ditto. * stat.h (STP_MAX_BUCKETS): Define.. (HIST_LOG_BUCKETS): Define. * stat.c (_stp_stat_init): Call _stp_stat_calc_buckets(). * stat-common.c (_stp_stat_calc_buckets): New function. Common bucket calculation and error reporting code. (_stp_bucket_to_val): New function. (_stp_val_to_bucket): Renamed and now handles negative numbers. (_stp_stat_print_histogram): Handle negative values in log histograms. (__stp_stat_add): Cleanup.. * map-gen.c (_stp_map_new): Remove buckets param for HIST_LOG. * pmap-gen.c (_stp_pmap_new): Ditto.
* 2007-05-29 Frank Ch. Eigler <fche@redhat.com>fche2007-05-291-11/+36
| | | | | | | | PR 2224 * map.h (NEED_MAP_LOCKS): New config macro, defaults to 0. (MAP_GET_CPU, MAP_PUT_CPU): Wrappers, default to ~no-op. * map.c (_stp_pmap_clear,agg): Use them. * pmap-gen.c (_stp_pmap_new,set,add,get_cpu,get,del): Ditto.
* Remove some debug statements.hunt2007-03-251-3/+1
|
* 2007-01-10 Martin Hunt <hunt@redhat.com>hunt2007-01-101-13/+54
| | | | | | | | | | | | | | | PR 3708 * map.c (str_copy): Check for NULL pointers. (_new_map_set_int64): Don't check val for 0. (_new_map_set_str): Don't check val for NULL. * map-gen.c (VAL_IS_ZERO): Removed. (_stp_map_del): New. (__stp_map_set): Don't check for zero. * pmap-gen.c (VAL_IS_ZERO): Removed. (_stp_pmap_del): New. (__stp_pmap_set): Don't check for zero.
* 2006-01-19 Martin Hunt <hunt@redhat.com>hunt2006-01-191-4/+9
| | | | | * pmap-gen.c (_stp_pmap_get): Fix bug where old data from agg map could be returned after element was deleted.
* 2005-12-14 Martin Hunt <hunt@redhat.com>hunt2005-12-141-15/+33
| | | | | | | | | | | | | * pmap-gen.c (_stp_pmap_new_*): Initialize lock. (_stp_pmap_set_*): Lock map while in use. (_stp_pmap_add_*): Lock map while in use. (_stp_pmap_get_cpu): Ditto. (_stp_pmap_get): Lock each per-cpu map. * map-gen.c: Define and use NULLRET for a NULL return value. * map.c (_stp_pmap_clear): New function. (_stp_pmap_agg): Lock each per-cpu map as it gets aggregated.
* 2005-12-07 Martin Hunt <hunt@redhat.com>hunt2005-12-071-25/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-6/+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-111-16/+17
| | | | | | | | | * pmap-gen.c (_stp_pmap_get()): New function. Aggregates the per-cpu map nodes into an aggregation map node. * map.c (_stp_new_agg): Return a struct map_node *. (_stp_add_agg): If count is 0 when adding, just set the stats.
* 2005-11-10 Martin Hunt <hunt@redhat.com>hunt2005-11-101-44/+43
| | | | | | * 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-09 Martin Hunt <hunt@redhat.com>hunt2005-11-091-2/+2
| | | | | | * map.h: Remove HSTAT_LOG and HSTAT_LINEAR. * map-gen.c: Fix comment. * pmap-gen.c: Ditto.
* 2005-11-08 Martin Hunt <hunt@redhat.com>hunt2005-11-081-0/+729
* 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().