Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8264838: IGV: enhance graph export functionality #4394

Closed
wants to merge 3 commits into from

Conversation

@neliasso
Copy link
Contributor

@neliasso neliasso commented Jun 7, 2021

This PR that is contributed by @robcasloz adds SVG export functionality to IGV.

Please review,
Best regards,
Nils Eliasson


Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed

Issue

Reviewers

Contributors

  • Roberto Castañeda Lozano <rcastanedalo@openjdk.org>

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk pull/4394/head:pull/4394
$ git checkout pull/4394

Update a local copy of the PR:
$ git checkout pull/4394
$ git pull https://git.openjdk.java.net/jdk pull/4394/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 4394

View PR using the GUI difftool:
$ git pr show -t 4394

Using diff file

Download this PR as a diff file:
https://git.openjdk.java.net/jdk/pull/4394.diff

@bridgekeeper
Copy link

@bridgekeeper bridgekeeper bot commented Jun 7, 2021

👋 Welcome back neliasso! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk
Copy link

@openjdk openjdk bot commented Jun 7, 2021

@neliasso The following labels will be automatically applied to this pull request:

  • build
  • hotspot-compiler

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing lists. If you would like to change these labels, use the /label pull request command.

@neliasso
Copy link
Contributor Author

@neliasso neliasso commented Jun 7, 2021

/label add hotspot-compiler
/label remove build

@neliasso
Copy link
Contributor Author

@neliasso neliasso commented Jun 7, 2021

/contributor add robcasloz

@openjdk
Copy link

@openjdk openjdk bot commented Jun 7, 2021

@neliasso The hotspot-compiler label was already applied.

@openjdk openjdk bot removed the build label Jun 7, 2021
@openjdk
Copy link

@openjdk openjdk bot commented Jun 7, 2021

@neliasso
The build label was successfully removed.

@openjdk
Copy link

@openjdk openjdk bot commented Jun 7, 2021

@neliasso Could not parse robcasloz as a valid contributor.
Syntax: /contributor (add|remove) [@user | openjdk-user | Full Name <email@address>]. For example:

  • /contributor add @openjdk-bot
  • /contributor add duke
  • /contributor add J. Duke <duke@openjdk.org>

@neliasso
Copy link
Contributor Author

@neliasso neliasso commented Jun 7, 2021

/contributor add @robcasloz

@openjdk
Copy link

@openjdk openjdk bot commented Jun 7, 2021

@neliasso
Contributor Roberto Castañeda Lozano <rcastanedalo@openjdk.org> successfully added.

@neliasso neliasso marked this pull request as ready for review Jun 7, 2021
@openjdk openjdk bot added the rfr label Jun 7, 2021
@mlbridge
Copy link

@mlbridge mlbridge bot commented Jun 7, 2021

Webrevs

@openjdk
Copy link

@openjdk openjdk bot commented Jun 7, 2021

@neliasso This change now passes all automated pre-integration checks.

ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details.

After integration, the commit message for the final commit will be:

8264838: IGV: enhance graph export functionality

Co-authored-by: Roberto Castañeda Lozano <rcastanedalo@openjdk.org>
Reviewed-by: kvn

You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed.

At the time when this comment was updated there had been 66 new commits pushed to the master branch:

  • 3396b69: 8254129: IR Test Framework to support regex-based matching on the IR in JTreg compiler tests
  • 270ec97: 8268331: Fix crash in humongous object eager reclaim logging
  • ea8274f: 8267875: Shenandoah: Duplicated code in ShenandoahBarrierSetC2::ideal_node()
  • a91f971: 8268267: Remove -Djavatest.security.noSecurityManager=true from jtreg runs
  • 4f9d6b7: 8267465: remove superfluous preview related annotations and test options
  • 728a411: 8268018: remove dead code in commitLimitter
  • 15715a8: 8267924: Misleading G1 eager reclaim detail logging
  • e4d0454: 8267832: SimpleVisitors and Scanners in jdk.compiler should use @implSpec
  • 8130be5: 8268318: Missing comma in copyright header
  • b09d8b9: 8267926: AsyncLogGtest.java fails on assert with: decorator was not part of the decorator set specified at creation.
  • ... and 56 more: https://git.openjdk.java.net/jdk/compare/a52a08d20be13721fcde65cad3567bbfa04f45cd...master

As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details.

➡️ To integrate this PR with the above commit message to the master branch, type /integrate in a new comment.

@openjdk openjdk bot added the ready label Jun 7, 2021
@navyxliu
Copy link
Contributor

@navyxliu navyxliu commented Jun 8, 2021

LGTM.

one thing: the JBS issue says "and extend it to also export graphs as text-searchable PDF files. "
I don't think this patch adds PDF support. Am I right?

@neliasso
Copy link
Contributor Author

@neliasso neliasso commented Jun 8, 2021

PDF was part of the original patch, but it will be contributed separately. There is a linked RFE for that.

@@ -52,6 +51,10 @@
import java.util.*;
import javax.swing.*;
import javax.swing.border.Border;
import org.apache.batik.dom.GenericDOMImplementation;
import org.apache.batik.svggen.SVGGeneratorContext;
import org.apache.batik.svggen.SVGGraphics2D;
Copy link
Member

@chhagedorn chhagedorn Jun 8, 2021

When trying to build IGV with this patch I get

Compilation failure
[ERROR] /home/christian/jdk/open/src/utils/IdealGraphVisualizer/View/src/main/java/com/sun/hotspot/igv/view/EditorTopComponent.java:[648,18] cannot find symbol
[ERROR]   symbol:   class SVGGraphics2DIOException
[ERROR]   location: class com.sun.hotspot.igv.view.EditorTopComponent

I think there is a missing import org.apache.batik.svggen.SVGGraphics2DIOException; here.

FileOutputStream os = null;
try {
os = new FileOutputStream(f);
Writer out = new OutputStreamWriter(os, "UTF-8");
printToStream(svgGenerator, out, true);
} catch (IOException e) {
e.printStackTrace();
} finally {
if (os != null) {
try {
os.close();
} catch (IOException e) {
}
}

}
Copy link
Member

@chhagedorn chhagedorn Jun 8, 2021

Can be simplified to

try (FileOutputStream os = new FileOutputStream(f)) {
    Writer out = new OutputStreamWriter(os, StandardCharsets.UTF_8);
    printToStream(svgGenerator, out, true);
} catch (IOException e) {
    e.printStackTrace();
}

You could also use StandardCharsets.UTF_8 instead of "UTF-8".

@neliasso
Copy link
Contributor Author

@neliasso neliasso commented Jun 8, 2021

Thanks for the reviews Christian and Vladimir.

Unfortunately I realize that I messed up the split into separate patches for SVG and PDF. I will withdraw this for now, and come back and address your comments when I have a new patch.

@neliasso neliasso closed this Jun 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
5 participants