summaryrefslogtreecommitdiffstats
path: root/runtime/map-gen.c
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/map-gen.c
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/map-gen.c')
-rw-r--r--runtime/map-gen.c24
1 files changed, 9 insertions, 15 deletions
diff --git a/runtime/map-gen.c b/runtime/map-gen.c
index e662e71e..a17f7e34 100644
--- a/runtime/map-gen.c
+++ b/runtime/map-gen.c
@@ -346,25 +346,20 @@ MAP KEYSYM(_stp_map_new) (unsigned max_entries)
}
#else
/* _stp_map_new_key1_key2...val (num, HIST_LINEAR, start, end, interval) */
-/* _stp_map_new_key1_key2...val (num, HIST_LOG, buckets) */
+/* _stp_map_new_key1_key2...val (num, HIST_LOG) */
MAP KEYSYM(_stp_map_new) (unsigned max_entries, int htype, ...)
{
- int buckets=0, start=0, stop=0, interval=0;
+ int start=0, stop=0, interval=0;
MAP m;
- va_list ap;
- if (htype != HIST_NONE) {
+ if (htype == HIST_LINEAR) {
+ va_list ap;
va_start (ap, htype);
- if (htype == HIST_LOG) {
- buckets = va_arg(ap, int);
- // dbug ("buckets=%d\n", buckets);
- } else {
- start = va_arg(ap, int);
- stop = va_arg(ap, int);
- interval = va_arg(ap, int);
- // dbug ("start=%d stop=%d interval=%d\n", start, stop, interval);
- }
+ start = va_arg(ap, int);
+ stop = va_arg(ap, int);
+ interval = va_arg(ap, int);
+ // dbug ("start=%d stop=%d interval=%d\n", start, stop, interval);
va_end (ap);
}
@@ -373,8 +368,7 @@ MAP KEYSYM(_stp_map_new) (unsigned max_entries, int htype, ...)
m = _stp_map_new (max_entries, STAT, sizeof(struct KEYSYM(map_node)), 0);
break;
case HIST_LOG:
- m = _stp_map_new_hstat_log (max_entries, sizeof(struct KEYSYM(map_node)),
- buckets);
+ m = _stp_map_new_hstat_log (max_entries, sizeof(struct KEYSYM(map_node)));
break;
case HIST_LINEAR:
m = _stp_map_new_hstat_linear (max_entries, sizeof(struct KEYSYM(map_node)),