RFR: 8324950: IGV: save the state to a file [v25]
Roberto Castañeda Lozano
rcastanedalo at openjdk.org
Mon Apr 15 09:03:43 UTC 2024
On Mon, 15 Apr 2024 07:58:02 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="218" alt="empty" src="https://github.com/openjdk/jdk/assets/71546117/627a2dca-db65-4860-8377-de03696f1678">
>>
>> Unzipping this [example_graph.zip](https://github.com/openjdk/jdk/files/14946834/example_graph.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="728" alt="graph" src="https://github.com/openjdk/jdk/assets/71546117/e1801537-c3b2-4adf-aa18-d247ae54a228">
>>
>> A new `<graphStates>` is introduced in `graphs.xml` that stores the opened graphs and their visible nodes:
>>
>> <graphDocument>
>> <group>
>> <graph>
>> <properties>...</properties>
>> <nodes>...</nodes>
>> <edges>...</edges>
>> <controlFlow>...</controlFlow>
>> <graphStates>
>> <state>
>> <difference value="0"/>
>> <visibleNodes all="false">
>> <node id="0"/>
>> <node id="1"/>
>> <node id="3"/>
>> </visibleNodes >
>> </state>
>> </graphStates>
>> </graph>
>> </group>
>> </graphDocument>
>>
>>
>> The workspace menu is restructured:
>>
>> <img width="118" alt="open" src="https://github.com/openjdk/jdk/assets/71546117/baa871b7-6b73-42c9-8982-7a1601714e69">
>>
>> - `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:
>> - `Import`: Allows the user to import graphs from another XML file to the current opened XML file.
>>
>> <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 ...
>
> Tobias Holenstein has updated the pull request incrementally with one additional commit since the last revision:
>
> Fix2: highlight nodes from imported tabs
There is an issue with saved difference graph states. If I open [diff.zip](https://github.com/openjdk/jdk/files/14976481/diff.zip) (which I just created by importing some graphs, opening one of them, and diffing it against another one), I get the following assertion error:
[INFO] java.lang.AssertionError
[INFO] at com.sun.hotspot.igv.util.RangeSliderModel.setPositions(RangeSliderModel.java:101)
[INFO] at com.sun.hotspot.igv.coordinator.OutlineTopComponent.lambda$loadContext$2(OutlineTopComponent.java:481)
[INFO] at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:318)
[INFO] at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:773)
[INFO] at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:720)
[INFO] at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:714)
[INFO] at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
[INFO] at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
[INFO] at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:742)
[INFO] at org.netbeans.core.TimableEventQueue.dispatchEvent(TimableEventQueue.java:136)
[INFO] [catch] at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
[INFO] at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
[INFO] at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
[INFO] at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
[INFO] at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
[INFO] at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)
I imagine fully supporting saving and restoring the diff state would require quite a lot of additional complexity, both in IGV and in the XML files. Maybe this is not a very important use case, and we could just not support it?
-------------
Changes requested by rcastanedalo (Reviewer).
PR Review: https://git.openjdk.org/jdk/pull/17630#pullrequestreview-2000405455
More information about the hotspot-compiler-dev
mailing list