Openj9: Can't add trace options on both -Xjit and -Xaot

Created on 9 Nov 2017  路  5Comments  路  Source: eclipse/openj9

If tracing is specified on both the -Xjit and the -Xaot specifiers, the VM fails to start up:

$ java -Xjit:{method1*}(traceFull,log=log) -Xaot:{method1*}(traceFull) -version
<JIT: unrecognized option --> '{method1*}(traceFull,log=log) -Xaot:{method1*}(traceFull)'>
<JIT: fatal error, invalid command line>
JVMJ9VM015W Initialization error for library j9jit29(11): cannot initialize JIT
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.

However, if it is specified only on the -Xjit string or the -Xaot string, then the VM starts up fine. Not being able to specify it on both strings makes debugging hard when trying to trace a method that could be either AOT compiled or JIT compiled (a decision made at runtime).

jit

Most helpful comment

I believe the issue with the 's is that the shell/OS will treat the -Xjit and -Xaot in the 's as a single option when passing it to the args of the process. You need them in two sets of quotes so they are passed as two different arguments.

All 5 comments

Is that only if it's the same method pattern, @dsouzai, or it never works? i would have thought independent option sets would have worked, but not with the options you specified (missing a log= option on the -Xaot option set.

java '-Xjit:{method1*}(traceFull,log=log) -Xaot:{method2*}(traceFull)' -version
<JIT: unrecognized option --> '{method1*}(traceFull,log=log) -Xaot:{method2*}(traceFull)'>
<JIT: fatal error, invalid command line>
JVMJ9VM015W Initialization error for library j9jit29(11): cannot initialize JIT
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
java '-Xjit:{method1*}(traceFull,log=method1Log) -Xaot:{method2*}(traceFull,log=method2Log)' -version
<JIT: unrecognized option --> '{method1*}(traceFull,log=method1Log) -Xaot:{method2*}(traceFull,log=method2Log)'>
<JIT: fatal error, invalid command line>
JVMJ9VM015W Initialization error for library j9jit29(11): cannot initialize JIT
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.

java '-Xjit:{method1*}(traceFull,log=method1Log),{method2*}(traceFull,log=method2Log)' -version works

You shouldn't be putting both options together with a single set of quotes... The options should be:
'-Xjit:{method1*}(traceFull,log=method1Log)' '-Xaot:{method2*}(traceFull,log=method2Log)'

They are separate command line options, after all. By any chance, were you doing that in the original one as well (you didn't include the quotes in the original command line, but I was wondering why it was showing both options in the "unrecognized option" output...

Hm I might have added both in a single block. I add the ' ' because bash doesn't like the { } brackets. It's interesting that having both -Xjit and -Xaot in the same ' ' block causes issues; I would've figured that JVM would have just ignored the single quotes. Putting them in separate blocks runs fine.

I'll close this issue since it's clearly a non-issue (...no pun intended).

@fjeremic fyi.

I believe the issue with the 's is that the shell/OS will treat the -Xjit and -Xaot in the 's as a single option when passing it to the args of the process. You need them in two sets of quotes so they are passed as two different arguments.

Was this page helpful?
0 / 5 - 0 ratings