src/utils/IdealGraphVisualizer/README.md
author stefank
Mon, 25 Nov 2019 12:32:40 +0100
changeset 59251 4cbfa5077d68
parent 47216 71c04702a3d5
permissions -rw-r--r--
8234739: Harmonize parameter order in Atomic - xchg Reviewed-by: rehn, dholmes
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
30591
b32fcc177417 8075492: adopt recent IGV
mhaupt
parents: 1497
diff changeset
     1
# Overview
b32fcc177417 8075492: adopt recent IGV
mhaupt
parents: 1497
diff changeset
     2
b32fcc177417 8075492: adopt recent IGV
mhaupt
parents: 1497
diff changeset
     3
The Ideal Graph Visualizer is a tool developed to help examine the intermediate
b32fcc177417 8075492: adopt recent IGV
mhaupt
parents: 1497
diff changeset
     4
representation of C2 which is commonly referred to as the "ideal graph". It was
b32fcc177417 8075492: adopt recent IGV
mhaupt
parents: 1497
diff changeset
     5
developed in collaboration with the University of Linz in Austria and has been
b32fcc177417 8075492: adopt recent IGV
mhaupt
parents: 1497
diff changeset
     6
included as part of hotspot since that was the primary target of the tool. The
b32fcc177417 8075492: adopt recent IGV
mhaupt
parents: 1497
diff changeset
     7
tool itself is fairly general with only a few modules that contain C2 specific
b32fcc177417 8075492: adopt recent IGV
mhaupt
parents: 1497
diff changeset
     8
elements.
b32fcc177417 8075492: adopt recent IGV
mhaupt
parents: 1497
diff changeset
     9
b32fcc177417 8075492: adopt recent IGV
mhaupt
parents: 1497
diff changeset
    10
The tool is built on top of the NetBeans 7 rich client infrastructure and so
b32fcc177417 8075492: adopt recent IGV
mhaupt
parents: 1497
diff changeset
    11
requires NetBeans to build. It currently requires at least Java 6 to run as it
b32fcc177417 8075492: adopt recent IGV
mhaupt
parents: 1497
diff changeset
    12
needs support for JavaScript for its filtering mechanism and assumes it's built
b32fcc177417 8075492: adopt recent IGV
mhaupt
parents: 1497
diff changeset
    13
into the platform.  It should build out of the box with NetBeans 7.0 and Java 6
b32fcc177417 8075492: adopt recent IGV
mhaupt
parents: 1497
diff changeset
    14
or later.
b32fcc177417 8075492: adopt recent IGV
mhaupt
parents: 1497
diff changeset
    15
b32fcc177417 8075492: adopt recent IGV
mhaupt
parents: 1497
diff changeset
    16
# Building and Running
768
d0bebc7eefc2 6718676: putback for 6604014 is incomplete
never
parents:
diff changeset
    17
30591
b32fcc177417 8075492: adopt recent IGV
mhaupt
parents: 1497
diff changeset
    18
The build system used for IGV is ant. To download all required libraries and
b32fcc177417 8075492: adopt recent IGV
mhaupt
parents: 1497
diff changeset
    19
build IGV, issue `ant build`. To run IGV, use the `igv.sh` command; it will put
b32fcc177417 8075492: adopt recent IGV
mhaupt
parents: 1497
diff changeset
    20
all log messages generated by the run to the file `.igv.log`. To see all log
b32fcc177417 8075492: adopt recent IGV
mhaupt
parents: 1497
diff changeset
    21
messages generated during an IGV run, use `ant run`.
b32fcc177417 8075492: adopt recent IGV
mhaupt
parents: 1497
diff changeset
    22
b32fcc177417 8075492: adopt recent IGV
mhaupt
parents: 1497
diff changeset
    23
# Usage
b32fcc177417 8075492: adopt recent IGV
mhaupt
parents: 1497
diff changeset
    24
b32fcc177417 8075492: adopt recent IGV
mhaupt
parents: 1497
diff changeset
    25
The JVM support is controlled by the flag `-XX:PrintIdealGraphLevel=#` where `#`
b32fcc177417 8075492: adopt recent IGV
mhaupt
parents: 1497
diff changeset
    26
is:
768
d0bebc7eefc2 6718676: putback for 6604014 is incomplete
never
parents:
diff changeset
    27
30591
b32fcc177417 8075492: adopt recent IGV
mhaupt
parents: 1497
diff changeset
    28
* 0: no output, the default
b32fcc177417 8075492: adopt recent IGV
mhaupt
parents: 1497
diff changeset
    29
* 1: dumps graph after parsing, before matching, and final code (also dumps
b32fcc177417 8075492: adopt recent IGV
mhaupt
parents: 1497
diff changeset
    30
     graphs for failed compilations, if available)
b32fcc177417 8075492: adopt recent IGV
mhaupt
parents: 1497
diff changeset
    31
* 2: more detail, including after loop opts
b32fcc177417 8075492: adopt recent IGV
mhaupt
parents: 1497
diff changeset
    32
* 3: even more detail
b32fcc177417 8075492: adopt recent IGV
mhaupt
parents: 1497
diff changeset
    33
* 4: prints graph after parsing every bytecode (very slow)
768
d0bebc7eefc2 6718676: putback for 6604014 is incomplete
never
parents:
diff changeset
    34
30591
b32fcc177417 8075492: adopt recent IGV
mhaupt
parents: 1497
diff changeset
    35
By default the JVM expects that it will connect to a visualizer on the local
b32fcc177417 8075492: adopt recent IGV
mhaupt
parents: 1497
diff changeset
    36
host on port 4444. This can be configured using the options
b32fcc177417 8075492: adopt recent IGV
mhaupt
parents: 1497
diff changeset
    37
`-XX:PrintIdealGraphAddress=` and `-XX:PrintIdealGraphPort=`.
b32fcc177417 8075492: adopt recent IGV
mhaupt
parents: 1497
diff changeset
    38
`PrintIdealGraphAddress` can actually be a hostname.
768
d0bebc7eefc2 6718676: putback for 6604014 is incomplete
never
parents:
diff changeset
    39
30591
b32fcc177417 8075492: adopt recent IGV
mhaupt
parents: 1497
diff changeset
    40
It is advisable to run the JVM with background compilation disabled (-Xbatch).
b32fcc177417 8075492: adopt recent IGV
mhaupt
parents: 1497
diff changeset
    41
Compilations going on in the background may be cancelled when the VM terminates,
b32fcc177417 8075492: adopt recent IGV
mhaupt
parents: 1497
diff changeset
    42
which can lead to incomplete dumps being sent to IGV.
768
d0bebc7eefc2 6718676: putback for 6604014 is incomplete
never
parents:
diff changeset
    43
d0bebc7eefc2 6718676: putback for 6604014 is incomplete
never
parents:
diff changeset
    44
Alternatively the output can be sent to a file using
30591
b32fcc177417 8075492: adopt recent IGV
mhaupt
parents: 1497
diff changeset
    45
`-XX:PrintIdealGraphFile=filename`. Each compiler thread will get it's own file
b32fcc177417 8075492: adopt recent IGV
mhaupt
parents: 1497
diff changeset
    46
with unique names being generated by adding a number onto the provided file
b32fcc177417 8075492: adopt recent IGV
mhaupt
parents: 1497
diff changeset
    47
name.
768
d0bebc7eefc2 6718676: putback for 6604014 is incomplete
never
parents:
diff changeset
    48
d0bebc7eefc2 6718676: putback for 6604014 is incomplete
never
parents:
diff changeset
    49
More information about the tool is available at
46763
1b0ff6953b5a 8185843: fix broken HotSpotInternals wiki links
kvn
parents: 30591
diff changeset
    50
https://wiki.openjdk.java.net/display/HotSpot/IdealGraphVisualizer.