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/stat.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'runtime/stat.h') diff --git a/runtime/stat.h b/runtime/stat.h index 95872758..4357abb4 100644 --- a/runtime/stat.h +++ b/runtime/stat.h @@ -15,6 +15,15 @@ #define NEED_STAT_LOCKS 0 #endif +/* maximum buckets for a linear histogram */ +#ifndef STP_MAX_BUCKETS +#define STP_MAX_BUCKETS 128 +#endif + +/* buckets for log histogram. */ +#define HIST_LOG_BUCKETS 128 +#define HIST_LOG_BUCKET0 64 + /** histogram type */ enum histtype { HIST_NONE, HIST_LOG, HIST_LINEAR }; -- cgit