diff options
author | hunt <hunt> | 2005-11-08 19:48:23 +0000 |
---|---|---|
committer | hunt <hunt> | 2005-11-08 19:48:23 +0000 |
commit | 7ba70af105ed918b5b07e5bba8b5d27a8d911249 (patch) | |
tree | b33bcea26aa98488bfa987a62764837ae0c39bad /runtime/map-stat.c | |
parent | 4893e4b2858af12d916c3915a97336cdb0c8236b (diff) | |
download | systemtap-steved-7ba70af105ed918b5b07e5bba8b5d27a8d911249.tar.gz systemtap-steved-7ba70af105ed918b5b07e5bba8b5d27a8d911249.tar.xz systemtap-steved-7ba70af105ed918b5b07e5bba8b5d27a8d911249.zip |
2005-11-08 Martin Hunt <hunt@redhat.com>
* 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().
Diffstat (limited to 'runtime/map-stat.c')
-rw-r--r-- | runtime/map-stat.c | 27 |
1 files changed, 12 insertions, 15 deletions
diff --git a/runtime/map-stat.c b/runtime/map-stat.c index 85a50ee8..fece087c 100644 --- a/runtime/map-stat.c +++ b/runtime/map-stat.c @@ -18,7 +18,6 @@ static int _stp_map_add_stat (MAP map, int64_t val) { stat *d; - Stat st; if (map == NULL) return -2; @@ -36,16 +35,14 @@ static int _stp_map_add_stat (MAP map, int64_t val) return -2; d = (stat *)((long)map->key + map->data_offset); } - st = (Stat)((long)map + offsetof(struct map_root, hist_type)); - __stp_stat_add (st, d, val); + __stp_stat_add (&map->hist, d, val); return 0; } static void _stp_map_print_histogram (MAP map, stat *sd) { - Stat st = (Stat)((long)map + offsetof(struct map_root, hist_type)); - _stp_stat_print_histogram (st, sd); + _stp_stat_print_histogram (&map->hist, sd); } static MAP _stp_map_new_hstat_log (unsigned max_entries, int key_size, int buckets) @@ -54,11 +51,11 @@ static MAP _stp_map_new_hstat_log (unsigned max_entries, int key_size, int bucke int size = buckets * sizeof(int64_t) + sizeof(stat); MAP m = _stp_map_new (max_entries, STAT, key_size, size); if (m) { - m->hist_type = HIST_LOG; - m->hist_buckets = buckets; + m->hist.type = HIST_LOG; + m->hist.buckets = buckets; if (buckets < 1 || buckets > 64) { _stp_warn("histogram: Bad number of buckets. Must be between 1 and 64\n"); - m->hist_type = HIST_NONE; + m->hist.type = HIST_NONE; return m; } } @@ -77,14 +74,14 @@ static MAP _stp_map_new_hstat_linear (unsigned max_entries, int ksize, int start m = _stp_map_new (max_entries, STAT, ksize, size); if (m) { - m->hist_type = HIST_LINEAR; - m->hist_start = start; - m->hist_stop = stop; - m->hist_int = interval; - m->hist_buckets = buckets; - if (m->hist_buckets <= 0) { + m->hist.type = HIST_LINEAR; + m->hist.start = start; + m->hist.stop = stop; + m->hist.interval = interval; + m->hist.buckets = buckets; + if (m->hist.buckets <= 0) { _stp_warn("histogram: bad stop, start and/or interval\n"); - m->hist_type = HIST_NONE; + m->hist.type = HIST_NONE; return m; } |