python: limit tooltip string length to 16384
Pydot limits the maximum line length to this value
JIRA:https://gem5.atlassian.net/browse/GEM5-1200
Change-Id: I0e6423b79f014695496dad279322304ae10a3978
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/61009
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
diff --git a/src/python/m5/util/dot_writer.py b/src/python/m5/util/dot_writer.py
index 1591816..fb7fb77 100644
--- a/src/python/m5/util/dot_writer.py
+++ b/src/python/m5/util/dot_writer.py
@@ -149,7 +149,13 @@
ini_strings.append(str(param) + "=" +
simNode._values[param].ini_str())
# join all the parameters with an HTML newline
+ # Pydot limit line length to 16384.
+ # Account for the quotes added later around the tooltip string
tooltip = " \\".join(ini_strings)
+ max_tooltip_length = 16384 - 2
+ if len(tooltip) > max_tooltip_length:
+ truncated = '... (truncated)'
+ tooltip = tooltip[:max_tooltip_length-len(truncated)] + truncated
return pydot.Cluster( \
full_path, \