AdoptOpenJDK / jitwatch

Log analyser / visualiser for Java HotSpot JIT compiler. Inspect inlining decisions, hot methods, bytecode, and assembly. View results in the JavaFX user interface.
Other
3.06k stars 437 forks source link

maven source and classes loading enhancement #328

Closed leonchen83 closed 2 years ago

leonchen83 commented 3 years ago

Hi

  1. most project written in java now using maven to manage source code and classes and its dependency. could jitwatch provide an esay way to load maven source code and its target classes, like parse a pom file to load it and its sub-module source, dependency jar.

  2. could jitwatch provide a bash command to parse jit log and output to stdout or a file(html format). than we can execute it with daily building.

chriswhocodes commented 3 years ago

Hi @leonchen83 I like the maven idea :)

Do you have any idea of what mechanism might be possible to fetch the dependencies and especially their sources from maven central?

for 2) There is already a way to launch JITWatch from the command line and get the results as CSV format:https://github.com/AdoptOpenJDK/jitwatch/wiki/Headless-Mode Does this meet your needs?

Kind regards,

Chris

leonchen83 commented 3 years ago

source location and classes location can parse pom, for example

    <name>Demo Parent</name>
    <packaging>pom</packaging>
    <version>1.0-SNAPSHOT</version>
    <modelVersion>4.0.0</modelVersion>
    <groupId>com.demo</groupId>
    <artifactId>demo-parent</artifactId>

    <modules>
        <module>demo-api</module>
        <module>demo-rcp</module>
        <module>demo-web</module>
        <module>demo-core</module>
    </modules>
    ...

step1: if this pom‘s path in /path/to/demo/pom.xml and packagingis pom then we load all sub-modules's path

/path/to/demo/demo-api/pom.xml
/path/to/demo/demo-rcp/pom.xml
/path/to/demo/demo-web/pom.xml
/path/to/demo/demo-core/pom.xml

step2: if sub-module's packagingis jar or not set. then we can locate the source and classes path or we do recusive step:1

//source
/path/to/demo/demo-api/src/main/java
/path/to/demo/demo-rcp/src/main/java
/path/to/demo/demo-web/src/main/java
/path/to/demo/demo-core/src/main/java
//classes 
/path/to/demo/demo-api/target/classes
/path/to/demo/demo-api/target/generated-classes
/path/to/demo/demo-rcp/target/classes
/path/to/demo/demo-rcp/target/generated-classes
/path/to/demo/demo-web/target/classes
/path/to/demo/demo-web/target/generated-classes
/path/to/demo/demo-core/target/classes
/path/to/demo/demo-core/target/generated-classes

to get all dependencies we can use mvn command mvn dependency:copy-dependencies -DincludeScope=runtime -DoutputDirectory=/path/to/libs

chriswhocodes commented 2 years ago

Hi, I'm closing all the issues except for the ones I'm actively working on.