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

Getting an error #4

Closed
RoySRose opened this issue Nov 18, 2019 · 7 comments
Closed

Getting an error #4

RoySRose opened this issue Nov 18, 2019 · 7 comments

Comments

@RoySRose
Copy link

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

@boris-spas
Copy link
Member

Hey @RoySRose,
Thanks for taking the time to look into GraalVM instrumentation!
Yeah, the documentation for instrumentation is currently a work in progress (as is this repo which is meant to be a starting point for development), hopefully we will have some better guides soon :)

So, I just double checked that the setup here works for me. What I did was point JAVA_HOME to GRAALVM_HOME and run
mvn clean package && ./runJsWithCoverage.sh
Seems like you are on a mac and I am running linux so maybe (though not likely) there is a subtle difference of some kind...

Maybe we can do a few sanity checks:

  • Is the simpletool-19.2.0.jar in the target folder?
  • could you provide the output of ./simpletool js --version:graalvm
  • check that ./simpletool js --help:tools contains a Simple Code Coverage entry

@RoySRose
Copy link
Author

@boris-spas
Hello, Thank you for your time taking look at this. As you've commented I also don't think it's the mac that causes this. Well, it's what Graalvm is for, 'running multiple languages on one vm'. (of course, there is also native part)
I've followed your instructions and checked as below

  1. I've changed $JAVA_HOME to $GRAALVM_HOME in simpletool script
    image

  2. my $GRAALVM_HOME points to graalvm-ce-19.2.1
    image

  3. Yes there is simpletool-19.2.0.jar in the target folder?
    image
    (just added few print in example.js)

  4. I can't run ./simpletool js --version:graalvm with below error.
    image

But I can run it if I remove --simple-code-coverage \ from simpletool script, and the result is as below
image

  1. I'm trying to check ./simpletool js --help:tools contains a Simple Code Coverage entry, I've run the command but I'm afraid I don't know how to check the entry. posting the results below. If you can guide me more on this. I will check right away.

image

Please let me know if there is anything for me to check additionally.

@boris-spas
Copy link
Member

Unusual... Seems that the tool is not picked up when being appended to the classpath.
Would you please run the following to make sure it's not a path issue.
$GRAALVM_HOME/bin/js --jvm --vm.Dtruffle.class.path.append=/absolute/path/to/simpletool-19.2.0.jar --simple-code-coverage -e '1+1'
for me the output is as follows:

==
Coverage of null is 100.00%
+ 1+1

@RoySRose
Copy link
Author

RoySRose commented Nov 20, 2019

Unfortunately... no luck

image

seems --simple-code-coverage option(?)/tool(?) is still not recognized.

So far I know, Graalvm CE 19.2 is the latest version. Do you think I should try with another version?


Have tried with graalvm-ce-19.1.1, still no luck..

image

any suggestions? that I can try?

boris-spas added a commit to boris-spas/simpletool that referenced this issue Nov 20, 2019
* commit 'c11bf3b8923e18dad7df200e68fcd707a3bdbe48':
  Do not install native-image.
  Run shellcheck only on Linux.
  Use correct jar.
  Use 19.2.0 everywhere.
  Run only on GraalVM and run shellcheck.
  Fix travis.
  Remove project file.
  Note that we are still work in progress.
  Travis update.
  Update.
@boris-spas
Copy link
Member

As a sanity check I re-ran the gate with 19.2.0 (https://travis-ci.org/boris-spas/simpletool/jobs/614411116?utm_medium=notification&utm_source=github_status) and with 19.2.1 (https://travis-ci.org/boris-spas/simpletool/jobs/614414957?utm_medium=notification&utm_source=github_status) and both pass.

I'm running low on ideas about whats special about your machine :/

@RoySRose
Copy link
Author

RoySRose commented Nov 22, 2019

@boris-spas

First of all, Once again thank you for your time.
I looked at your travis link.
Decided to start from scratch.

Fortunately, It worked.

Got back and searched for the reason.
I found out the option was not being registered.

@Option(name = "", help = "Enable Simple Coverage (default: fa......

Something wrong about auto generated SimpleCoverageInstrumentOptionDescriptors.class

But it was due to some kind of dependency error. I couldn't dig it deeper. But it was solved after re-updating the dependencies.

Anyway. Thank you again.
I'll start looking into truffle instrument api, hope to reach you with good new.

@boris-spas
Copy link
Member

Good stuff! I'll close the issue then!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants