]> granicus.if.org Git - llvm/commitdiff
Display relative hotness with two decimal digits after the decimal point
authorAdam Nemet <anemet@apple.com>
Fri, 29 Sep 2017 16:56:54 +0000 (16:56 +0000)
committerAdam Nemet <anemet@apple.com>
Fri, 29 Sep 2017 16:56:54 +0000 (16:56 +0000)
I've seen cases where tiny inlined functions have such a high execution count
that most everything would show up with a relative of hotness of 0%.  Since
the inlined functions effectively disappear you need to tune in the lower
range, thus we need more precision.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@314537 91177308-0d34-0410-b5e6-96231b3b80d8

tools/opt-viewer/optrecord.py

index 95b908965eec376228b07fbc29dac4b10a0cfebf..e68bcb870c60a1f1ea6c1a4b33f4370037eb1c4a 100644 (file)
@@ -179,7 +179,7 @@ class Remark(yaml.YAMLObject):
     @property
     def RelativeHotness(self):
         if self.max_hotness:
-            return "{}%".format(int(round(self.Hotness * 100 / self.max_hotness)))
+            return "{0:.2f}%".format(self.Hotness * 100. / self.max_hotness)
         else:
             return ''