On 22/12/2017 8:49 AM, Ted Neward wrote:
What I mean is, I do a "make hotspot", and the resulting change doesn't seem to be recognized when I run the 
code--doing a "java -XX:+PrintTedMessage -version" yields the "Unrecognized flag" error. (I added a 
simple fprintf() to part of the JVM startup code to print out the message, just to prove the flag was recognized and 
parsed.) Does that make more sense? I'm not trying to use the new VM as part of the build process--just add a flag to a 
VM that I can trigger when I run "java -version".

I would've thought that "make hotspot" would compile the flag into the libjvm.so, and 
then drop the newly-built libjvm into the image directory, so that I wouldn't have to do a full 
build. Presumably, then, "make images" checks dependencies and doesn't build stuff that 
isn't affected by the change? (Otherwise, that would seem like a TON of build time for a fairly 
minimal change.)

"make hotspot" won't update the image, you need to "make images" for that.

Assuming you're building 9+ then when you change libjvm.so the module needs to be rebuilt etc.

Or you can work from the exploded build the contents of e.g.

 build/linux-x64-debug/jdk/

though you still need a full build to prime that. But after that "make hotspot" should suffice. (Erik correct me if I'm wrong here please.)

BTW there are three preexisting diagnostic flags that can be used to avoid adding your own: UseNewCode, UseNewCode2, UseNewCode3

HTH,
David

Ted Neward
Author, Speaker, Mentor
http://www.newardassociates.com
t: @tedneward | m: (425) 647-4526

On 12/21/17, 4:20 AM, "David Holmes" <david.hol...@oracle.com> wrote:

     On 21/12/2017 8:15 PM, Erik Joelsson wrote:
     > Adding hotspot-dev.
     >
     > /Erik
     >
     >
     > On 2017-12-21 10:43, Ted Neward wrote:
     >> What’s the steps necessary to add a new -XX flag? I’d assumed
     >> (naively) that all that was required was to add it to the list of
     >> macro’ed flags in hotspot/share/runtime/globals.hpp, but my new flag
Yes that should suffice. >> (“PrintTedMessage”) isn’t recognized when I “make hotspot”; it gets
     >> kicked back out with the “Unrecognized flag; did you mean…?” error.
Why would "make hotspot" be using your new flag? Are you trying to apply
     your flag to the newly built VM during the build process? I'm not even
     sure if "make hotspot" would use the new VM. I always do a full build:
     make images
David >>
     >>
     >> Is there something I’m missing? Does the flag need to be registered
     >> someplace else as well?
     >>
     >>
     >> Ted Neward
     >>
     >> Author, Speaker, Mentor
     >>
     >> http://www.newardassociates.com
     >>
     >> t: @tedneward | m: (425) 647-4526
     >>
     >

Reply via email to