Giter Club home page Giter Club logo

simpletool's Introduction

Simple Tool

A simple demonstration code coverage tool built using Truffle for GraalVM.

The source code is documented to explain the how and why of writing a Truffle tool. A good way to find out more is to read the source with comments. We also like to encourage people to clone the repository and start hacking.

This repository is licensed under the permissive UPL licence. Fork it to begin your own Truffle tool.

For instructions on how to get started please refer to our website

simpletool's People

Contributors

boris-spas avatar chumer avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

simpletool's Issues

Documentation on using SimpleTool for other languages

It looks like the current documentation is outdated when compared with the code in simpletool.

It would be great if the README contained updated instructions on using SimpleTool that includes instructions on using it for other languages as well.

If this documentation exists somewhere, I'd really appreciate if you could point me towards it.

Thank you.

Issue when compiled with JDK-17

I am new to GraalVM. While building simpletool with GraalVM-JDK-17, following error seems to prevent successful compilation ($mvn clean package):
simpletool/src/main/java/module-info.java:[41,1] module org.graalvm.st reads package org.graalvm.home from both org.graalvm.polyglot and org.graalvm.sdk

The issue is seen on windows too.
On linux, the software tools have following versions:

Apache Maven 3.8.4 (9b656c72d54e5bacbed989b64718c159fe39b537)
Maven home: /usr/lib/maven
Java version: 17.0.9, vendor: GraalVM Community, runtime: .../_installs/graalvm-ce-17
Default locale: en, platform encoding: UTF-8
OS name: "linux", version: "5.4.0-48-generic", arch: "amd64", family: "unix"

Do we need to add any specific exports for simpletool when compiled with GraalVM-JDK-17?
Below is the tail log of the compilation error seen:

[INFO] --- maven-compiler-plugin:3.11.0:compile (default-compile) @ simpletool ---
[INFO] Changes detected - recompiling the module! :source
[INFO] Compiling 6 source files with javac [debug target 17 module-path] to target/classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /home/prj/myitems/javaUnitTest/integrationPrj/simpletool/src/main/java/module-info.java:[41,1] module org.graalvm.st reads package org.graalvm.home from both org.graalvm.polyglot and org.graalvm.sdk
[INFO] 1 error
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  0.962 s
[INFO] Finished at: 2024-02-15T22:58:02+05:30
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.11.0:compile (default-compile) on project simpletool: Compilation failure
[ERROR] /home/prj/myitems/javaUnitTest/integrationPrj/simpletool/src/main/java/module-info.java:[41,1] module org.graalvm.st reads package org.graalvm.home from both org.graalvm.polyglot and org.graalvm.sdk
[ERROR]
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.

Getting an error

Hello, First of all, thank you for the project.
I'm trying to create a simple helloworld program of instrumenting js through Graal VM.
Eventually to create a monitoring tool for Graal.

But having a hard time. Since there isn't any instructions on how to execute(with what options) in the instrumenting guide in graal homepage

I've found this repository and try to execute one. So far I've understood or assumed... that I need to compile the instrumenting program which uses truffle API(in this case SimpleCoverageInstrument.java and all) and gives the jar as an option when running js program (Please let me know if I am getting this wrong)

I've maven installed and got simpletool-19.2.0.jar
and then I've executed runJSWithCoverage.sh and is giving me an argument error.

image

Am I doing something wrong? Can you point out a few things if I'm on the wrong path?

image

How to use this to instrument a java application?

I am following this using the tutorial. It works fine for the given .js example.

I tried to use the same approach to instrument some java application, but it fails as follows.


class GFG {
  
    // Main driver method
    public static void main(String[] args)
    {
  
        // Print statement
        int a = 1+2;
    }
}
graalvm-ce-java11-21.2.0/bin/java --vm.Dtruffle.class.path.append=target/simpletool.jar --vm.Dtruffle.class.path.append=target/simpletool.jar --simple-code-coverage ../GFG

Output:

Unrecognized option: --jvm
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.

I removed -jvm flag, and the corresponding output is:

Unrecognized option: --vm.Dtruffle.class.path.append=target/simpletool.jar
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.

Can you give a java example?

Thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.