Permalink
1 comment
on commit
sign in to comment.
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
8261336: IGV: enhance default filters
Add filters to color and hide parts of the graph based on node categories or estimated execution frequency, and simplify remaining filters. Co-authored-by: Christian Hagedorn <chagedorn@openjdk.org> Reviewed-by: vlivanov, chagedorn, thartmann
- Loading branch information
Showing
with
331 additions
and 83 deletions.
- +42 −1 src/hotspot/share/opto/idealGraphPrinter.cpp
- +2 −1 src/hotspot/share/opto/idealGraphPrinter.hpp
- +68 −1 src/hotspot/share/opto/type.cpp
- +12 −1 src/hotspot/share/opto/type.hpp
- +3 −5 src/utils/IdealGraphVisualizer/Filter/src/com/sun/hotspot/igv/filter/ConnectionFilter.java
- +0 −28 src/utils/IdealGraphVisualizer/Graal/src/com/sun/hotspot/igv/graal/layer.xml
- +3 −2 src/utils/IdealGraphVisualizer/Graph/src/com/sun/hotspot/igv/graph/Connection.java
- +21 −14 ...s/IdealGraphVisualizer/ServerCompiler/src/com/sun/hotspot/igv/servercompiler/filters/color.filter
- +23 −0 ...aphVisualizer/ServerCompiler/src/com/sun/hotspot/igv/servercompiler/filters/colorFrequency.filter
- +41 −0 ...alGraphVisualizer/ServerCompiler/src/com/sun/hotspot/igv/servercompiler/filters/extract-colors.py
- +3 −0 ...lGraphVisualizer/ServerCompiler/src/com/sun/hotspot/igv/servercompiler/filters/hideControl.filter
- +5 −0 ...hVisualizer/ServerCompiler/src/com/sun/hotspot/igv/servercompiler/filters/hideControlEdges.filter
- +3 −0 ...dealGraphVisualizer/ServerCompiler/src/com/sun/hotspot/igv/servercompiler/filters/hideData.filter
- +5 −0 ...raphVisualizer/ServerCompiler/src/com/sun/hotspot/igv/servercompiler/filters/hideDataEdges.filter
- +3 −0 ...alGraphVisualizer/ServerCompiler/src/com/sun/hotspot/igv/servercompiler/filters/hideMemory.filter
- +5 −0 ...phVisualizer/ServerCompiler/src/com/sun/hotspot/igv/servercompiler/filters/hideMemoryEdges.filter
- +3 −0 ...ealGraphVisualizer/ServerCompiler/src/com/sun/hotspot/igv/servercompiler/filters/hideMixed.filter
- +5 −0 ...aphVisualizer/ServerCompiler/src/com/sun/hotspot/igv/servercompiler/filters/hideMixedEdges.filter
- +3 −0 ...ealGraphVisualizer/ServerCompiler/src/com/sun/hotspot/igv/servercompiler/filters/hideOther.filter
- +5 −0 ...aphVisualizer/ServerCompiler/src/com/sun/hotspot/igv/servercompiler/filters/hideOtherEdges.filter
- +12 −9 ...phVisualizer/ServerCompiler/src/com/sun/hotspot/igv/servercompiler/filters/onlyControlFlow.filter
- +0 −8 .../IdealGraphVisualizer/ServerCompiler/src/com/sun/hotspot/igv/servercompiler/filters/remove.filter
- +13 −0 ...alGraphVisualizer/ServerCompiler/src/com/sun/hotspot/igv/servercompiler/filters/structural.filter
- +44 −12 src/utils/IdealGraphVisualizer/ServerCompiler/src/com/sun/hotspot/igv/servercompiler/layer.xml
- +7 −1 src/utils/IdealGraphVisualizer/View/src/com/sun/hotspot/igv/view/DiagramScene.java
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -2,33 +2,5 @@ | ||
<!DOCTYPE filesystem PUBLIC "-//NetBeans//DTD Filesystem 1.1//EN" "http://www.netbeans.org/dtds/filesystem-1_1.dtd"> | ||
<filesystem> | ||
<folder name="Filters"> | ||
</folder> | ||
</filesystem> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -1,18 +1,25 @@ | ||
var mixedNodeColor = java.awt.Color.decode("#ffaabb"); | ||
var controlNodeColor = java.awt.Color.decode("#ee8866"); | ||
var otherNodeColor = java.awt.Color.decode("#eedd88"); | ||
var dataNodeColor = java.awt.Color.decode("#adcbea"); | ||
var memoryNodeColor = java.awt.Color.decode("#babb00"); | ||
|
||
var mixedEdgeColor = java.awt.Color.decode("#ff7f99"); | ||
var controlEdgeColor = java.awt.Color.decode("#e75828"); | ||
var otherEdgeColor = java.awt.Color.decode("#dfc025"); | ||
var dataEdgeColor = java.awt.Color.decode("#3178c2"); | ||
var memoryEdgeColor = java.awt.Color.decode("#828200"); | ||
|
||
colorize("category", "data", dataNodeColor); | ||
colorize("category", "memory", memoryNodeColor); | ||
colorize("category", "mixed", mixedNodeColor); | ||
colorize("category", "control", controlNodeColor); | ||
colorize("category", "other", otherNodeColor); | ||
|
||
var f = new ColorFilter("Line Style filter"); | ||
f.addRule(new ColorFilter.ColorRule(new MatcherSelector(new Properties.StringPropertyMatcher("category", "data")), null, dataEdgeColor, null)); | ||
f.addRule(new ColorFilter.ColorRule(new MatcherSelector(new Properties.StringPropertyMatcher("category", "memory")), null, memoryEdgeColor, null)); | ||
f.addRule(new ColorFilter.ColorRule(new MatcherSelector(new Properties.StringPropertyMatcher("category", "mixed")), null, mixedEdgeColor, null)); | ||
f.addRule(new ColorFilter.ColorRule(new MatcherSelector(new Properties.StringPropertyMatcher("category", "control")), null, controlEdgeColor, null)); | ||
f.addRule(new ColorFilter.ColorRule(new MatcherSelector(new Properties.StringPropertyMatcher("category", "other")), null, otherEdgeColor, null)); | ||
f.apply(graph); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -0,0 +1,23 @@ | ||
// Color nodes by estimated execution frequency. Applies only when control-flow | ||
// graph information is available (from "Global Code Motion" on). | ||
|
||
// These colors are generated by running: | ||
// $ python3 extract-colors.py --steps 10 --colormap coolwarm | ||
var step0Color = java.awt.Color.decode("#3b4cc0"); | ||
var step1Color = java.awt.Color.decode("#5977e3"); | ||
var step2Color = java.awt.Color.decode("#7b9ff9"); | ||
var step3Color = java.awt.Color.decode("#9ebeff"); | ||
var step4Color = java.awt.Color.decode("#c0d4f5"); | ||
var step5Color = java.awt.Color.decode("#dddcdc"); | ||
var step6Color = java.awt.Color.decode("#f2cbb7"); | ||
var step7Color = java.awt.Color.decode("#f7ac8e"); | ||
var step8Color = java.awt.Color.decode("#ee8468"); | ||
var step9Color = java.awt.Color.decode("#d65244"); | ||
var step10Color = java.awt.Color.decode("#b40426"); | ||
|
||
var colors = [step0Color, step1Color, step2Color, step3Color, step4Color, step5Color, step6Color, step7Color, step8Color, step9Color, step10Color] | ||
var fractions = [0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0] | ||
|
||
// The max value is set to 1.01 instead of 1.0 to workaround a (numerical?) | ||
// issue where nodes with frequencies close (but not equal to) 1.0 are not colored. | ||
colorizeGradientCustom("frequency", 0.0, 1.01, "logarithmic", colors, fractions, 1024); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -0,0 +1,41 @@ | ||
#!/usr/bin/python3 | ||
# | ||
# Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved. | ||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. | ||
# | ||
# This code is free software; you can redistribute it and/or modify it | ||
# under the terms of the GNU General Public License version 2 only, as | ||
# published by the Free Software Foundation. | ||
# | ||
# This code is distributed in the hope that it will be useful, but WITHOUT | ||
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | ||
# version 2 for more details (a copy is included in the LICENSE file that | ||
# accompanied this code). | ||
# | ||
# You should have received a copy of the GNU General Public License version | ||
# 2 along with this work; if not, write to the Free Software Foundation, | ||
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. | ||
# | ||
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA | ||
# or visit www.oracle.com if you need additional information or have any | ||
# questions. | ||
|
||
import matplotlib.cm | ||
import argparse | ||
import sys | ||
|
||
parser = argparse.ArgumentParser() | ||
parser.add_argument('--steps', type=int, default=10) | ||
parser.add_argument('--colormap', default='coolwarm') | ||
args = parser.parse_args() | ||
|
||
cmap = matplotlib.cm.get_cmap(args.colormap) | ||
n = args.steps | ||
|
||
for step in range(n + 1): | ||
point = step / float(n) | ||
rgb = tuple([int(round(c * 255)) for c in cmap(point)[0:3]]) | ||
hex = '#%02x%02x%02x' % rgb | ||
print("var step" + str(step) + "Color" + " = java.awt.Color.decode(\"" + \ | ||
hex + "\");") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -0,0 +1,3 @@ | ||
var f = new RemoveFilter("Hide control subgraph"); | ||
f.addRule(new RemoveFilter.RemoveRule(new MatcherSelector(new Properties.StringPropertyMatcher("category", "control")))); | ||
f.apply(graph); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -0,0 +1,5 @@ | ||
var f = new ConnectionFilter("Hide control edges"); | ||
f.addRule(new ConnectionFilter.ConnectionStyleRule(new MatcherSelector(new Properties.StringPropertyMatcher("category", "control")), | ||
white, | ||
Connection.ConnectionStyle.INVISIBLE)); | ||
f.apply(graph); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -0,0 +1,3 @@ | ||
var f = new RemoveFilter("Hide data subgraph"); | ||
f.addRule(new RemoveFilter.RemoveRule(new MatcherSelector(new Properties.StringPropertyMatcher("category", "data")))); | ||
f.apply(graph); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -0,0 +1,5 @@ | ||
var f = new ConnectionFilter("Hide data edges"); | ||
f.addRule(new ConnectionFilter.ConnectionStyleRule(new MatcherSelector(new Properties.StringPropertyMatcher("category", "data")), | ||
white, | ||
Connection.ConnectionStyle.INVISIBLE)); | ||
f.apply(graph); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -0,0 +1,3 @@ | ||
var f = new RemoveFilter("Hide memory subgraph"); | ||
f.addRule(new RemoveFilter.RemoveRule(new MatcherSelector(new Properties.StringPropertyMatcher("category", "memory")))); | ||
f.apply(graph); |
Oops, something went wrong.
16bd7d3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review
Issues