RFR: JDK-8324950: IGV: save the state to a file [v20]

Roberto Castañeda Lozano rcastanedalo at openjdk.org
Wed Apr 10 13:26:21 UTC 2024


On Wed, 10 Apr 2024 11:41:37 GMT, Tobias Holenstein <tholenstein at openjdk.org> wrote:

>> The current workflow in IGV is the following:
>> 1) import an XML file with graphs or send via network
>> 2) open or more graphs in a tab
>> 3) extract a set of nodes to be displayed in the tab
>> 4) close IGV and start from 1) again
>> 
>> The idea of this RFE is to save the opened graph tabs and extracted nodes of a graph in the `graph.xml` file.
>> ### The new workflow
>>  
>> When opening IGV the user gets an empty workspace without any opened files. 
>> - Graphs can be sent via the network to IGV
>> - Graph can be opened from an XML file
>> <img width="260" alt="empty" src="https://github.com/openjdk/jdk/assets/71546117/ed4b572a-f6dc-4ea0-bc45-45d21cfe3ecc">
>> 
>> Unzipping this [example.zip](https://github.com/openjdk/jdk/files/14905764/example.zip) and opening `graphs.xml`
>> shows the following graph. New with this RFE is that opened graph tabs and extracted nodes are saved to the  `graph.xml` file and restored when re-opening the `graphs.xml`:
>> 
>> <img width="739" alt="graph" src="https://github.com/openjdk/jdk/assets/71546117/ad65c000-0fb3-440f-94f7-5777dc87ac8e">
>> 
>> A new `<graphStates>` is introduced in `graphs.xml` that stores the opened graphs and their hidden (visible) nodes: 
>> 
>> <graphDocument> 
>>     <group> 
>>         <graph> 
>>             <properties>...</properties>
>>             <nodes>...</nodes>
>>             <edges>...</edges>
>>             <controlFlow>...</controlFlow>
>>             <graphStates> 
>>                 <state> 
>>                     <difference value="0"/> 
>>                     <hiddenNodes>
>>                         <node id="0"/>
>>                         <node id="1"/>
>>                         <node id="3"/>
>>                     </hiddenNodes>
>>                 </state>
>>             </graphStates>
>>         </graph>
>>     </group>
>> </graphDocument>
>> 
>> 
>> The workspace menu is restructured:
>> 
>> <img width="47" alt="open" src="https://github.com/openjdk/jdk/assets/71546117/d92fffdb-6431-4ac6-b21c-7d7b89d36ef5">
>> 
>> - `Open` allows the user to open an XML file. In IGV there is either no XML opened indicated as `untitled` or exactly one xml file opened. It's not possible to have two XML files opened at the same time: 
>> 
>> <img width="101" alt="save" src="https://github.com/openjdk/jdk/assets/71546117/46a9e945-7f5c-4777-a66d-2fc8a95705c3">
>> 
>> - `Save..` saves the current opened xml file. Create a new file if no file is opened. 
>> - `Save as...` save the current graphs as a copy to an xml file. 
>> Note: there is no...
>
> Tobias Holenstein has updated the pull request incrementally with one additional commit since the last revision:
> 
>   make methods in Printer static

Looks better, thanks! A couple of suggestions, for consistency between the File menu and the Outline icons.

src/utils/IdealGraphVisualizer/Coordinator/src/main/java/com/sun/hotspot/igv/coordinator/actions/RemoveAllAction.java line 46:

> 44: 
> 45:     public RemoveAllAction() {
> 46:         putValue(Action.SHORT_DESCRIPTION, "clear workspace");

Suggestion:

        putValue(Action.SHORT_DESCRIPTION, "Clear workspace");

src/utils/IdealGraphVisualizer/Coordinator/src/main/resources/com/sun/hotspot/igv/coordinator/actions/Bundle.properties line 5:

> 3: CTL_DiffGraphAction=Difference to current graph
> 4: CTL_RemoveAction=Remove selected graphs and groups
> 5: CTL_RemoveAllAction=Remove all graphs and groups

Suggestion:

CTL_RemoveAllAction=Clear workspace

-------------

PR Review: https://git.openjdk.org/jdk/pull/17630#pullrequestreview-1991667525
PR Review Comment: https://git.openjdk.org/jdk/pull/17630#discussion_r1559421218
PR Review Comment: https://git.openjdk.org/jdk/pull/17630#discussion_r1559426709


More information about the hotspot-compiler-dev mailing list