RFR(XS): [TEST] add test to verify EnableTrace works

Daniel D. Daugherty daniel.daugherty at oracle.com
Wed Sep 12 17:21:05 UTC 2018


On 9/12/18 12:42 PM, Liu, Xin wrote:
> David,
> Thank you to let us know that. Excellent.
> I still need another reviewer. Paul said he can't be reviewer because he sponsors this change.

Hmmm... Never heard that a sponsor cannot be a reviewer before...

Dan


>   
>
> Thanks,
> --lx
>
>
> On 9/11/18, 6:32 PM, "David Holmes" <david.holmes at oracle.com> wrote:
>
>      FYI I also hacked JPRT to run this test, so I can confirm it passes as
>      expected on Oracle JDK on Solaris, Windows and Linux.
>      
>      Cheers,
>      David
>      
>      On 11/09/2018 11:50 AM, David Holmes wrote:
>      > Looks fine now.
>      >
>      > FWIW didn't need a new webrev just to remove othervm.
>      >
>      > Thanks,
>      > David
>      >
>      > On 11/09/2018 4:57 AM, Hohensee, Paul wrote:
>      >> Copied, http://cr.openjdk.java.net/~phh/8209863/webrev.03/
>      >>
>      >> On 9/10/18, 10:51 AM, "hotspot-runtime-dev on behalf of Hohensee,
>      >> Paul" <hotspot-runtime-dev-bounces at openjdk.java.net on behalf of
>      >> hohensee at amazon.com> wrote:
>      >>
>      >>      Because I copied it to the wrong directory! :(
>      >>      Paul
>      >>      On 9/10/18, 9:55 AM, "hotspot-runtime-dev on behalf of Daniel D.
>      >> Daugherty" <hotspot-runtime-dev-bounces at openjdk.java.net on behalf of
>      >> daniel.daugherty at oracle.com> wrote:
>      >>          Why is this webrev using '8206075' when previous webrev used
>      >> '8209863'?
>      >>          Dan
>      >>          On 9/10/18 12:47 PM, Liu, Xin wrote:
>      >>          > You are right. I updated it. othervm doesn't help much. I
>      >> remove it.
>      >>          >   Here is CR.
>      >>          > http://cr.openjdk.java.net/~phh/8206075/webrev.03/
>      >>          >
>      >>          > thanks,
>      >>          > --lx
>      >>          >
>      >>          >
>      >>          > On 9/7/18, 4:08 PM, "David Holmes"
>      >> <david.holmes at oracle.com> wrote:
>      >>          >
>      >>          >      On 8/09/2018 2:40 AM, Liu, Xin wrote:
>      >>          >      > Hi, David,
>      >>          >      > Thanks you for the commend.
>      >>          >      >
>      >>          >      > I added 'othervm' in last minute. The test grabs
>      >> Classload or Compilation events when JVM initializes. Without
>      >> `othervm`, the test might not capture them because the JVM has already
>      >> did that.
>      >>          >      > 'othervm' can make the test more consistent.
>      >>          >
>      >>          >      No it won't because you are capturing events from JVMs
>      >> that you
>      >>          >      explicitly launch with ProcessTools. The VM launched
>      >> by "othervm" does
>      >>          >      not have EnableTracing applied to it and nobody looks
>      >> at its output anyway.
>      >>          >
>      >>          >      David
>      >>          >
>      >>          >      > Thanks you for reviewing it.
>      >>          >      >
>      >>          >      > Thanks,
>      >>          >      > --lx
>      >>          >      >
>      >>          >      >
>      >>          >      > On 9/6/18, 5:17 PM, "David Holmes"
>      >> <david.holmes at oracle.com> wrote:
>      >>          >      >
>      >>          >      >      Hi,
>      >>          >      >
>      >>          >      >      On 7/09/2018 6:51 AM, Liu, Xin wrote:
>      >>          >      >      > Hi, David,
>      >>          >      >      > Could you review this new revision?
>      >>          >      >      > Webrev:
>      >> http://cr.openjdk.java.net/~phh/8209863/webrev.02/
>      >>          >      >      > bug:
>      >> https://bugs.openjdk.java.net/browse/JDK-8209863
>      >>          >      >
>      >>          >      >      This looks fine to me.
>      >>          >      >
>      >>          >      >      One nit:
>      >>          >      >
>      >>          >      >      29  * @run main/othervm
>      >>          >      >
>      >>          >      >      You don't need othervm for this test as it just
>      >> launches seperate VMs
>      >>          >      >      anyway. No need for updated webrev.
>      >>          >      >
>      >>          >      >      Thanks,
>      >>          >      >      David
>      >>          >      >
>      >>          >      >      > I should verify new tests using both
>      >> Openjdk/Oraclejdk. Thank you for heading up.
>      >>          >      >      >
>      >>          >      >      > Thanks,
>      >>          >      >      > --lx
>      >>          >      >      >
>      >>          >      >      > On 9/4/18, 11:05 PM, "Liu Xin"
>      >> <navy.xliu at gmail.com> wrote:
>      >>          >      >      >
>      >>          >      >      >      Hi, David,
>      >>          >      >      >
>      >>          >      >      >      Thanks to investigate the closed
>      >> implementation.
>      >>          >      >      >
>      >>          >      >      >      Indeed, OracleJDK shows “JAVA(TM)”
>      >> instead of OpenJDK.
>      >>          >      >      >
>      >>          >      >      >      $java -XX:+EnableTracing -version
>      >>          >      >      >      java version "1.8.0_171"
>      >>          >      >      >      Java(TM) SE Runtime Environment (build
>      >> 1.8.0_171-b11)
>      >>          >      >      >      Java HotSpot(TM) 64-Bit Server VM (build
>      >> 25.171-b11, mixed mode)
>      >>          >      >      >
>      >>          >      >      >      I will add a guard for the Test.
>      >> Furthermore, I think I need to check if it exits with 0 for OracleJDK.
>      >>          >      >      >      The right behavior of OracleJDK8 is to
>      >> accept this flag yet suppress all events.
>      >>          >      >      >
>      >>          >      >      >      Thanks,
>      >>          >      >      >      —lx
>      >>          >      >      >
>      >>          >      >      >
>      >>          >      >      >      > On Sep 4, 2018, at 9:51 PM, David
>      >> Holmes <david.holmes at oracle.com> wrote:
>      >>          >      >      >      >
>      >>          >      >      >      > Hi Liu Xin,
>      >>          >      >      >      >
>      >>          >      >      >      > On 4/09/2018 7:45 PM, David Holmes wrote:
>      >>          >      >      >      >> On 4/09/2018 10:12 AM, Liu, Xin wrote:
>      >>          >      >      >      >>> Hi, David,
>      >>          >      >      >      >>> Thank you for reviewing it.
>      >>          >      >      >      >>>
>      >>          >      >      >      >>> If you are using OracleJDK, it won't
>      >> have any output. OracleJDK doesn't suffer from crash. I guess It
>      >> suppress events unconditionally.
>      >>          >      >      >      >>> For JDK8u, "-XX:+EnableTracing
>      >> -version" will dump some events.  It won't crash if it has this patch
>      >> http://hg.openjdk.java.net/jdk8u/jdk8u-dev/hotspot/rev/80ee2541504e
>      >>          >      >      >      >>> The attachment is the output.
>      >>          >      >      >      >> If the Oracle JDK doesn't produce any
>      >> output then this test will fail on the Oracle JDK so can't be accepted
>      >> in current form.
>      >>          >      >      >      >> There's something going on with
>      >> EnableTracing that I'm not understanding. I'll try to take a closer
>      >> look tomorrow ( was on a day off today).
>      >>          >      >      >      >
>      >>          >      >      >      > Okay ... the Oracle JDK replaces the
>      >> OpenJDK tracing facility with JFR which completely ignores the
>      >> EnableTracing flag.
>      >>          >      >      >      >
>      >>          >      >      >      > If the test is simply verifying that
>      >> -XX:+EnableTracing doesn't crash then it can reduce to just:
>      >>          >      >      >      >
>      >>          >      >      >      > /*
>      >>          >      >      >      > * @test
>      >>          >      >      >      > * @summary Ensure -XX:+EnableTracing
>      >> doesn't crash
>      >>          >      >      >      > * @run main/othervm -XX:+EnableTracing
>      >> TestEnableTracing
>      >>          >      >      >      > */
>      >>          >      >      >      > public class TestEnableTracing {
>      >>          >      >      >      >    public static void main(String[]
>      >> args) {
>      >>          >      >      >      >    }
>      >>          >      >      >      > }
>      >>          >      >      >      >
>      >>          >      >      >      > If you want to actually verify some of
>      >> the trace output then you will need to guard the shouldMatch/Contain
>      >> statements with something like:
>      >>          >      >      >      >
>      >>          >      >      >      > if
>      >> (output.getOutput().contains("OpenJDK")) {
>      >>          >      >      >      > ...
>      >>          >      >      >      > }
>      >>          >      >      >      >
>      >>          >      >      >      > I don't think there is a direct way to
>      >> ensure the test is only executed on an OpenJDK binary.
>      >>          >      >      >      >
>      >>          >      >      >      > Thanks,
>      >>          >      >      >      > David
>      >>          >      >      >      >
>      >>          >      >      >      >> Thanks,
>      >>          >      >      >      >> David
>      >>          >      >      >      >>>
>      >>          >      >      >      >>> Output of jtreg
>      >>          >      >      >      >>> ###
>      >>          >      >      >      >>> # Running suite single for openJDK
>      >>          >      >      >      >>> # Results are available in
>      >> build/brazil-open-single-tests
>      >>          >      >      >      >>> ###
>      >>          >      >      >      >>> Directory "build/JTwork" not found:
>      >> creating
>      >>          >      >      >      >>> Passed:
>      >> runtime/EnableTracing/TestEnableTracing.java
>      >>          >      >      >      >>> Test results: passed: 1
>      >>          >      >      >      >>> Report written to
>      >> /local/home/xxinliu/ws-openjdk8/build/OpenJDK8CompatibilityTests/OpenJDK8CompatibilityTests-1.0/RHEL5_64/DEV.STD.PTHREAD/build/brazil-open-single-tests/html/report.html
>      >>
>      >>          >      >      >      >>> Results written to
>      >> /local/home/xxinliu/ws-openjdk8/build/OpenJDK8CompatibilityTests/OpenJDK8CompatibilityTests-1.0/RHEL5_64/DEV.STD.PTHREAD/build/JTwork
>      >>
>      >>          >      >      >      >>>
>      >>          >      >      >      >>> Thanks,
>      >>          >      >      >      >>> --lx
>      >>          >      >      >      >>>
>      >>          >      >      >      >>>
>      >>          >      >      >      >>> On 9/2/18, 10:01 PM, "David Holmes"
>      >> <david.holmes at oracle.com> wrote:
>      >>          >      >      >      >>>
>      >>          >      >      >      >>>      Hi,
>      >>          >      >      >      >>>      On 25/08/2018 2:35 AM, Liu, Xin
>      >> wrote:
>      >>          >      >      >      >>>      > Hi, hotspot-Runtime Developers,
>      >>          >      >      >      >>>      >
>      >>          >      >      >      >>>      > Could you review this small
>      >> tests?
>      >>          >      >      >      >>>      > It adds a new test to verify
>      >> +EnableTracing works for jdk8u.
>      >>          >      >      >      >>>      I don't see any output produced
>      >> with just "-XX:+EnableTracing -version". ??
>      >>          >      >      >      >>>        >
>      >>          >      >      >      >>>
>      >> /java/re/jdk/8u172/promoted/latest/binaries/linux-amd64/fastdebug/bin/java
>      >>
>      >>          >      >      >      >>>      -XX:+EnableTracing -version
>      >>          >      >      >      >>>      java version "1.8.0_172-fastdebug"
>      >>          >      >      >      >>>      Java(TM) SE Runtime Environment
>      >> (build 1.8.0_172-fastdebug-b35)
>      >>          >      >      >      >>>      Java HotSpot(TM) 64-Bit Server
>      >> VM (build 25.172-b35-fastdebug, mixed mode)
>      >>          >      >      >      >>>      Thanks,
>      >>          >      >      >      >>>      David
>      >>          >      >      >      >>>      > BUG:
>      >> https://bugs.openjdk.java.net/browse/JDK-8209863
>      >>          >      >      >      >>>      > WEBREV:
>      >> http://cr.openjdk.java.net/~phh/8209863/webrev.00/
>      >>          >      >      >      >>>      >
>      >>          >      >      >      >>>      > Thanks,
>      >>          >      >      >      >>>      > -lx
>      >>          >      >      >      >>>      >
>      >>          >      >      >      >>>
>      >>          >      >      >
>      >>          >      >      >
>      >>          >      >      >
>      >>          >      >
>      >>          >      >
>      >>          >
>      >>          >
>      >>
>      
>



More information about the hotspot-runtime-dev mailing list