summaryrefslogtreecommitdiffstats
path: root/runtime/map-stat.c
diff options
context:
space:
mode:
authorhunt <hunt>2005-12-07 20:02:04 +0000
committerhunt <hunt>2005-12-07 20:02:04 +0000
commit953c5ad1c72d55e3c017e7975becfa175ccdf7f5 (patch)
tree27b47f177cdf09bf266a60f1bff9113953270ee4 /runtime/map-stat.c
parent872d26246196a87da8551661635cce52c8e5ed3a (diff)
downloadsystemtap-steved-953c5ad1c72d55e3c017e7975becfa175ccdf7f5.tar.gz
systemtap-steved-953c5ad1c72d55e3c017e7975becfa175ccdf7f5.tar.xz
systemtap-steved-953c5ad1c72d55e3c017e7975becfa175ccdf7f5.zip
2005-12-07 Martin Hunt <hunt@redhat.com>
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.
Diffstat (limited to 'runtime/map-stat.c')
-rw-r--r--runtime/map-stat.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/runtime/map-stat.c b/runtime/map-stat.c
index c9ba4b02..6634a2b7 100644
--- a/runtime/map-stat.c
+++ b/runtime/map-stat.c
@@ -64,9 +64,9 @@ static MAP _stp_map_new_hstat_linear (unsigned max_entries, int ksize, int start
return m;
}
-static MAP _stp_pmap_new_hstat_linear (unsigned max_entries, int ksize, int start, int stop, int interval)
+static PMAP _stp_pmap_new_hstat_linear (unsigned max_entries, int ksize, int start, int stop, int interval)
{
- MAP map;
+ PMAP pmap;
int size;
int buckets = (stop - start) / interval;
if ((stop - start) % interval) buckets++;
@@ -74,12 +74,12 @@ static MAP _stp_pmap_new_hstat_linear (unsigned max_entries, int ksize, int star
/* add size for buckets */
size = buckets * sizeof(int64_t) + sizeof(stat);
- map = _stp_pmap_new (max_entries, STAT, ksize, size);
- if (map) {
+ pmap = _stp_pmap_new (max_entries, STAT, ksize, size);
+ if (pmap) {
int i;
MAP m;
for_each_cpu(i) {
- m = _stp_per_cpu_ptr (map, i);
+ m = (MAP)per_cpu_ptr (pmap->map, i);
m->hist.type = HIST_LINEAR;
m->hist.start = start;
m->hist.stop = stop;
@@ -87,33 +87,33 @@ static MAP _stp_pmap_new_hstat_linear (unsigned max_entries, int ksize, int star
m->hist.buckets = buckets;
}
/* now set agg map params */
- m = _stp_percpu_dptr(map);
+ m = &pmap->agg;
m->hist.type = HIST_LINEAR;
m->hist.start = start;
m->hist.stop = stop;
m->hist.interval = interval;
m->hist.buckets = buckets;
}
- return map;
+ return pmap;
}
-static MAP _stp_pmap_new_hstat_log (unsigned max_entries, int key_size, int buckets)
+static PMAP _stp_pmap_new_hstat_log (unsigned max_entries, int key_size, int buckets)
{
/* add size for buckets */
int size = buckets * sizeof(int64_t) + sizeof(stat);
- MAP map = _stp_pmap_new (max_entries, STAT, key_size, size);
- if (map) {
+ PMAP pmap = _stp_pmap_new (max_entries, STAT, key_size, size);
+ if (pmap) {
int i;
MAP m;
for_each_cpu(i) {
- m = _stp_per_cpu_ptr (map, i);
+ m = (MAP)per_cpu_ptr (pmap->map, i);
m->hist.type = HIST_LOG;
m->hist.buckets = buckets;
}
/* now set agg map params */
- m = _stp_percpu_dptr(map);
+ m = &pmap->agg;
m->hist.type = HIST_LOG;
m->hist.buckets = buckets;
}
- return map;
+ return pmap;
}