From 3a18979dd18ba8cdd96367d2ad18c456f26c6f20 Mon Sep 17 00:00:00 2001 From: hunt Date: Wed, 12 Sep 2007 18:37:47 +0000 Subject: 2007-09-12 Martin Hunt * 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. --- runtime/map.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'runtime/map.h') diff --git a/runtime/map.h b/runtime/map.h index f89dc521..6cd6e119 100644 --- a/runtime/map.h +++ b/runtime/map.h @@ -187,7 +187,7 @@ unsigned int str_hash(const char *key1); static MAP _stp_map_new(unsigned max_entries, int type, int key_size, int data_size); static PMAP _stp_pmap_new(unsigned max_entries, int type, int key_size, int data_size); static int msb64(int64_t x); -static MAP _stp_map_new_hstat_log(unsigned max_entries, int key_size, int buckets); +static MAP _stp_map_new_hstat_log(unsigned max_entries, int key_size); static MAP _stp_map_new_hstat_linear(unsigned max_entries, int ksize, int start, int stop, int interval); static void _stp_map_print_histogram(MAP map, stat *s); struct map_node * _stp_map_start(MAP map); @@ -202,7 +202,7 @@ static int _new_map_set_str (MAP map, struct map_node *n, char *val, int add); static void _new_map_clear_node (struct map_node *); static void _new_map_del_node (MAP map, struct map_node *n); static PMAP _stp_pmap_new_hstat_linear (unsigned max_entries, int ksize, int start, int stop, int interval); -static PMAP _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); static void _stp_add_agg(struct map_node *aptr, struct map_node *ptr); static struct map_node *_stp_new_agg(MAP agg, struct hlist_head *ahead, struct map_node *ptr); static void __stp_map_del(MAP map); -- cgit