Another question, if I may?

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

Another question, if I may?

Ted Neward
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 (“PrintTedMessage”) isn’t recognized when I “make hotspot”; it gets kicked back out with the “Unrecognized flag; did you mean…?” error.

 

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 | Threaded
Open this post in threaded view
|

Re: Another question, if I may?

Erik Joelsson
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 (“PrintTedMessage”) isn’t recognized when I “make hotspot”; it gets kicked back out with the “Unrecognized flag; did you mean…?” error.
>
>  
>
> 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 | Threaded
Open this post in threaded view
|

Re: Another question, if I may?

David Holmes
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 | Threaded
Open this post in threaded view
|

Re: Another question, if I may?

Ted Neward
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.)

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

On 12/21/17, 4:20 AM, "David Holmes" <[hidden email]> 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 | Threaded
Open this post in threaded view
|

Re: Another question, if I may?

David Holmes
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" <[hidden email]> 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 | Threaded
Open this post in threaded view
|

Re: Another question, if I may?

Erik Joelsson


On 2017-12-22 01:06, David Holmes wrote:

>
> "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.)
This is correct. Using the exploded image as described is the shortcut
we have. The actual images are always built using jmod/jlink and yes,
that requires quite a bit of extra build time.

If you are in JDK 8, you need to run "make jdk" to get the exploded
image updated with the new libjvm.so.

/Erik
Reply | Threaded
Open this post in threaded view
|

Re: Another question, if I may?

Ted Neward
So if I do a "make hotspot" it replaces the compiled Hotspot binary in the exploded build image?

The reason I ask is that this is what I tried, and it didn’t appear to show up in the list of "PrintFlagsFinal" output.

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

On 12/22/17, 12:32 AM, "Erik Joelsson" <[hidden email]> wrote:

   
   
    On 2017-12-22 01:06, David Holmes wrote:
    >
    > "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.)
    This is correct. Using the exploded image as described is the shortcut
    we have. The actual images are always built using jmod/jlink and yes,
    that requires quite a bit of extra build time.
   
    If you are in JDK 8, you need to run "make jdk" to get the exploded
    image updated with the new libjvm.so.
   
    /Erik
   


Reply | Threaded
Open this post in threaded view
|

Re: Another question, if I may?

David Holmes
On 24/12/2017 9:01 PM, Ted Neward wrote:
> So if I do a "make hotspot" it replaces the compiled Hotspot binary in the exploded build image?

I believe so, but simplest thing is to do a find for libjvm.so before
and after the "make hotspot" and see which one(s) changed.

David

> The reason I ask is that this is what I tried, and it didn’t appear to show up in the list of "PrintFlagsFinal" output.
>
> Ted Neward
> Author, Speaker, Mentor
> http://www.newardassociates.com
> t: @tedneward | m: (425) 647-4526
>
> On 12/22/17, 12:32 AM, "Erik Joelsson" <[hidden email]> wrote:
>
>      
>      
>      On 2017-12-22 01:06, David Holmes wrote:
>      >
>      > "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.)
>      This is correct. Using the exploded image as described is the shortcut
>      we have. The actual images are always built using jmod/jlink and yes,
>      that requires quite a bit of extra build time.
>      
>      If you are in JDK 8, you need to run "make jdk" to get the exploded
>      image updated with the new libjvm.so.
>      
>      /Erik
>      
>
>