summaryrefslogtreecommitdiffstats
path: root/runtime/stat.h
diff options
context:
space:
mode:
authorhunt <hunt>2007-09-12 18:37:47 +0000
committerhunt <hunt>2007-09-12 18:37:47 +0000
commit3a18979dd18ba8cdd96367d2ad18c456f26c6f20 (patch)
tree9b345453171b5a796ecf65c59f052f9e9373c87a /runtime/stat.h
parent674f70a0371c1f97a83c66268d03332ebbf9e62f (diff)
downloadsystemtap-steved-3a18979dd18ba8cdd96367d2ad18c456f26c6f20.tar.gz
systemtap-steved-3a18979dd18ba8cdd96367d2ad18c456f26c6f20.tar.xz
systemtap-steved-3a18979dd18ba8cdd96367d2ad18c456f26c6f20.zip
2007-09-12 Martin Hunt <hunt@redhat.com>
* 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.
Diffstat (limited to 'runtime/stat.h')
-rw-r--r--runtime/stat.h9
1 files changed, 9 insertions, 0 deletions
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 };