commit 0016550c3046bd1bf5057ad3c1070ae2210fecb1
parent f3c00c7e79f22c47f27aa063cb91cab5a55113eb
Author: Brendan Gregg <brendan.d.gregg@gmail.com>
Date: Tue, 9 Apr 2013 09:37:18 -0700
Merge pull request #19 from timbunce/factor3
Fix percentages when using --factor
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/flamegraph.pl b/flamegraph.pl
@@ -327,7 +327,7 @@ while (my ($id, $node) = each %Node) {
if ($func eq "" and $depth == 0) {
$info = "all ($samples_txt $countname, 100%)";
} else {
- my $pct = sprintf "%.2f", ((100 * $samples) / $timemax);
+ my $pct = sprintf "%.2f", ((100 * $samples) / ($timemax * $factor));
my $escaped_func = $func;
$escaped_func =~ s/&/&/g;
$escaped_func =~ s/</</g;