aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools/codegen
diff options
context:
space:
mode:
authorGravatar Craig Tiller <ctiller@google.com>2017-09-05 14:55:43 -0700
committerGravatar Craig Tiller <ctiller@google.com>2017-09-05 14:55:43 -0700
commit07530dbbeb25b89b9fbaaea2c9823d5ea157a038 (patch)
treefed4a7602f164501531a90489e20ba4aa4752034 /tools/codegen
parentb6ab5f599ec691b33dce1ca6eb3892f7830d61da (diff)
Fixup bounds
Diffstat (limited to 'tools/codegen')
-rwxr-xr-xtools/codegen/core/gen_stats_data.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/tools/codegen/core/gen_stats_data.py b/tools/codegen/core/gen_stats_data.py
index 104ac83f17..60cbd6436f 100755
--- a/tools/codegen/core/gen_stats_data.py
+++ b/tools/codegen/core/gen_stats_data.py
@@ -110,12 +110,12 @@ def gen_bucket_code(histogram):
done_unmapped = False
first_nontrivial = None
first_unmapped = None
- while len(bounds) < histogram.buckets:
- if len(bounds) == histogram.buckets - 1:
+ while len(bounds) < histogram.buckets + 1:
+ if len(bounds) == histogram.buckets:
nextb = int(histogram.max)
else:
mul = math.pow(float(histogram.max) / bounds[-1],
- 1.0 / (histogram.buckets - len(bounds)))
+ 1.0 / (histogram.buckets + 1 - len(bounds)))
nextb = int(math.ceil(bounds[-1] * mul))
if nextb <= bounds[-1] + 1:
nextb = bounds[-1] + 1