commit 8f2e64ec05324e3ba5e10082eaf134bc2188972a
parent 38145a79c5806dc3e64821e5543f4bbad69206d6
Author: Brendan Gregg <brendan.d.gregg@gmail.com>
Date: Thu, 17 Aug 2017 17:42:22 -0700
fix #140
Diffstat:
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/flamegraph.pl b/flamegraph.pl
@@ -978,10 +978,11 @@ my $inc = <<INC;
// Step through frames saving only the biggest bottom-up frames
// thanks to the sort order. This relies on the tree property
// where children are always smaller than their parents.
+ var fudge = 0.0001; // JavaScript floating point
for (var k in keys) {
var x = parseFloat(keys[k]);
var w = matches[keys[k]];
- if (x >= lastx + lastw) {
+ if (x >= lastx + lastw - fudge) {
count += w;
lastx = x;
lastw = w;