summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/native_heapdump_viewer.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/scripts/native_heapdump_viewer.py b/scripts/native_heapdump_viewer.py
index d896ca6c1..0689a1d1d 100755
--- a/scripts/native_heapdump_viewer.py
+++ b/scripts/native_heapdump_viewer.py
@@ -244,7 +244,10 @@ def display_html(total, node, extra):
lib = fd.library
else:
lib = os.path.basename(fd.library)
- label = "%d %6.2f%% %6d %s%s %s %s" % (node.size, 100*node.size/float(total), node.number, extra, lib, fd.function, fd.location)
+ total_percent = 0
+ if total != 0:
+ total_percent = 100 * node.size / float(total)
+ label = "%d %6.2f%% %6d %s%s %s %s" % (node.size, total_percent, node.number, extra, lib, fd.function, fd.location)
label = label.replace("&", "&")
label = label.replace("'", "'")
label = label.replace('"', """)