-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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
1 parent
3f8819c
commit 16bd7d3
Showing
25 changed files
with
331 additions
and
83 deletions.
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
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
35 changes: 21 additions & 14 deletions
35
...raphVisualizer/ServerCompiler/src/com/sun/hotspot/igv/servercompiler/filters/color.filter
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,25 @@ | ||
colorize("name", ".*", yellow); | ||
colorize("name", "Catch.*", blue); | ||
colorize("name", "Region|Loop|CountedLoop|Root", red); | ||
colorize("name", "CProj|IfFalse|IfTrue|JProj|CatchProj", magenta); | ||
colorize("name", "Con.*", orange); | ||
colorize("name", "Parm|Proj", lightGray); | ||
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"); | ||
|
||
// Nodes with bci | ||
colorize("bci", "..*", magenta); | ||
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); | ||
|
||
// Line style | ||
var f = new ColorFilter("Line Style filter"); | ||
f.addRule(new ColorFilter.ColorRule(new MatcherSelector(new Properties.StringPropertyMatcher("type", "int:")), null, Color.BLUE, null)); | ||
f.addRule(new ColorFilter.ColorRule(new MatcherSelector(new Properties.StringPropertyMatcher("type", "control")), null, Color.RED, null)); | ||
f.addRule(new ColorFilter.ColorRule(new MatcherSelector(new Properties.StringPropertyMatcher("type", "memory")), null, Color.GREEN, null)); | ||
f.addRule(new ColorFilter.ColorRule(new MatcherSelector(new Properties.StringPropertyMatcher("type", "tuple:")), null, Color.MAGENTA, null)); | ||
f.addRule(new ColorFilter.ColorRule(new MatcherSelector(new Properties.StringPropertyMatcher("type", "bottom")), null, Color.LIGHT_GRAY, null)); | ||
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); |
23 changes: 23 additions & 0 deletions
23
...lizer/ServerCompiler/src/com/sun/hotspot/igv/servercompiler/filters/colorFrequency.filter
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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); |
41 changes: 41 additions & 0 deletions
41
...isualizer/ServerCompiler/src/com/sun/hotspot/igv/servercompiler/filters/extract-colors.py
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 + "\");") |
3 changes: 3 additions & 0 deletions
3
...sualizer/ServerCompiler/src/com/sun/hotspot/igv/servercompiler/filters/hideControl.filter
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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); |
5 changes: 5 additions & 0 deletions
5
...zer/ServerCompiler/src/com/sun/hotspot/igv/servercompiler/filters/hideControlEdges.filter
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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); |
3 changes: 3 additions & 0 deletions
3
...hVisualizer/ServerCompiler/src/com/sun/hotspot/igv/servercompiler/filters/hideData.filter
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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); |
5 changes: 5 additions & 0 deletions
5
...alizer/ServerCompiler/src/com/sun/hotspot/igv/servercompiler/filters/hideDataEdges.filter
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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); |
3 changes: 3 additions & 0 deletions
3
...isualizer/ServerCompiler/src/com/sun/hotspot/igv/servercompiler/filters/hideMemory.filter
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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