8041626: Shutdown tracing event

Tue, 13 Feb 2018 15:48:23 +0100

author
rwestberg
date
Tue, 13 Feb 2018 15:48:23 +0100
changeset 9864
f066260954ae
parent 9863
161ab90e3cae
child 9865
5a83b7215107

8041626: Shutdown tracing event
Reviewed-by: dholmes, alanb, rriggs

make/aix/makefiles/mapfile-vers-debug file | annotate | diff | comparison | revisions
make/aix/makefiles/mapfile-vers-product file | annotate | diff | comparison | revisions
make/bsd/makefiles/mapfile-vers-debug file | annotate | diff | comparison | revisions
make/bsd/makefiles/mapfile-vers-product file | annotate | diff | comparison | revisions
make/linux/makefiles/mapfile-vers-debug file | annotate | diff | comparison | revisions
make/linux/makefiles/mapfile-vers-product file | annotate | diff | comparison | revisions
make/solaris/makefiles/mapfile-vers file | annotate | diff | comparison | revisions
src/share/vm/prims/jvm.cpp file | annotate | diff | comparison | revisions
src/share/vm/prims/jvm.h file | annotate | diff | comparison | revisions
src/share/vm/runtime/thread.cpp file | annotate | diff | comparison | revisions
     1.1 --- a/make/aix/makefiles/mapfile-vers-debug	Mon Aug 26 16:37:09 2019 -0300
     1.2 +++ b/make/aix/makefiles/mapfile-vers-debug	Tue Feb 13 15:48:23 2018 +0100
     1.3 @@ -39,6 +39,7 @@
     1.4                  JVM_ArrayCopy;
     1.5                  JVM_AssertionStatusDirectives;
     1.6                  JVM_Available;
     1.7 +                JVM_BeforeHalt;
     1.8                  JVM_Bind;
     1.9                  JVM_ClassDepth;
    1.10                  JVM_ClassLoaderDepth;
     2.1 --- a/make/aix/makefiles/mapfile-vers-product	Mon Aug 26 16:37:09 2019 -0300
     2.2 +++ b/make/aix/makefiles/mapfile-vers-product	Tue Feb 13 15:48:23 2018 +0100
     2.3 @@ -39,6 +39,7 @@
     2.4                  JVM_ArrayCopy;
     2.5                  JVM_AssertionStatusDirectives;
     2.6                  JVM_Available;
     2.7 +                JVM_BeforeHalt;
     2.8                  JVM_Bind;
     2.9                  JVM_ClassDepth;
    2.10                  JVM_ClassLoaderDepth;
     3.1 --- a/make/bsd/makefiles/mapfile-vers-debug	Mon Aug 26 16:37:09 2019 -0300
     3.2 +++ b/make/bsd/makefiles/mapfile-vers-debug	Tue Feb 13 15:48:23 2018 +0100
     3.3 @@ -37,6 +37,7 @@
     3.4                  _JVM_ArrayCopy
     3.5                  _JVM_AssertionStatusDirectives
     3.6                  _JVM_Available
     3.7 +                _JVM_BeforeHalt
     3.8                  _JVM_Bind
     3.9                  _JVM_ClassDepth
    3.10                  _JVM_ClassLoaderDepth
     4.1 --- a/make/bsd/makefiles/mapfile-vers-product	Mon Aug 26 16:37:09 2019 -0300
     4.2 +++ b/make/bsd/makefiles/mapfile-vers-product	Tue Feb 13 15:48:23 2018 +0100
     4.3 @@ -37,6 +37,7 @@
     4.4                  _JVM_ArrayCopy
     4.5                  _JVM_AssertionStatusDirectives
     4.6                  _JVM_Available
     4.7 +                _JVM_BeforeHalt
     4.8                  _JVM_Bind
     4.9                  _JVM_ClassDepth
    4.10                  _JVM_ClassLoaderDepth
     5.1 --- a/make/linux/makefiles/mapfile-vers-debug	Mon Aug 26 16:37:09 2019 -0300
     5.2 +++ b/make/linux/makefiles/mapfile-vers-debug	Tue Feb 13 15:48:23 2018 +0100
     5.3 @@ -39,6 +39,7 @@
     5.4                  JVM_ArrayCopy;
     5.5                  JVM_AssertionStatusDirectives;
     5.6                  JVM_Available;
     5.7 +                JVM_BeforeHalt;
     5.8                  JVM_Bind;
     5.9                  JVM_ClassDepth;
    5.10                  JVM_ClassLoaderDepth;
     6.1 --- a/make/linux/makefiles/mapfile-vers-product	Mon Aug 26 16:37:09 2019 -0300
     6.2 +++ b/make/linux/makefiles/mapfile-vers-product	Tue Feb 13 15:48:23 2018 +0100
     6.3 @@ -39,6 +39,7 @@
     6.4                  JVM_ArrayCopy;
     6.5                  JVM_AssertionStatusDirectives;
     6.6                  JVM_Available;
     6.7 +                JVM_BeforeHalt;
     6.8                  JVM_Bind;
     6.9                  JVM_ClassDepth;
    6.10                  JVM_ClassLoaderDepth;
     7.1 --- a/make/solaris/makefiles/mapfile-vers	Mon Aug 26 16:37:09 2019 -0300
     7.2 +++ b/make/solaris/makefiles/mapfile-vers	Tue Feb 13 15:48:23 2018 +0100
     7.3 @@ -39,6 +39,7 @@
     7.4                  JVM_ArrayCopy;
     7.5                  JVM_AssertionStatusDirectives;
     7.6                  JVM_Available;
     7.7 +                JVM_BeforeHalt;
     7.8                  JVM_Bind;
     7.9                  JVM_ClassDepth;
    7.10                  JVM_ClassLoaderDepth;
     8.1 --- a/src/share/vm/prims/jvm.cpp	Mon Aug 26 16:37:09 2019 -0300
     8.2 +++ b/src/share/vm/prims/jvm.cpp	Tue Feb 13 15:48:23 2018 +0100
     8.3 @@ -443,6 +443,16 @@
     8.4  JVM_END
     8.5  
     8.6  
     8.7 +JVM_ENTRY_NO_ENV(void, JVM_BeforeHalt())
     8.8 +  JVMWrapper("JVM_BeforeHalt");
     8.9 +  EventShutdown event;
    8.10 +  if (event.should_commit()) {
    8.11 +    event.set_reason("Shutdown requested from Java");
    8.12 +    event.commit();
    8.13 +  }
    8.14 +JVM_END
    8.15 +
    8.16 +
    8.17  JVM_ENTRY_NO_ENV(void, JVM_Halt(jint code))
    8.18    before_exit(thread);
    8.19    vm_exit(code);
     9.1 --- a/src/share/vm/prims/jvm.h	Mon Aug 26 16:37:09 2019 -0300
     9.2 +++ b/src/share/vm/prims/jvm.h	Tue Feb 13 15:48:23 2018 +0100
     9.3 @@ -159,6 +159,9 @@
     9.4  JVM_Exit(jint code);
     9.5  
     9.6  JNIEXPORT void JNICALL
     9.7 +JVM_BeforeHalt();
     9.8 +
     9.9 +JNIEXPORT void JNICALL
    9.10  JVM_Halt(jint code);
    9.11  
    9.12  JNIEXPORT void JNICALL
    10.1 --- a/src/share/vm/runtime/thread.cpp	Mon Aug 26 16:37:09 2019 -0300
    10.2 +++ b/src/share/vm/runtime/thread.cpp	Tue Feb 13 15:48:23 2018 +0100
    10.3 @@ -4012,6 +4012,12 @@
    10.4                           Mutex::_as_suspend_equivalent_flag);
    10.5    }
    10.6  
    10.7 +  EventShutdown e;
    10.8 +  if (e.should_commit()) {
    10.9 +    e.set_reason("No remaining non-daemon Java threads");
   10.10 +    e.commit();
   10.11 +  }
   10.12 +
   10.13    // Hang forever on exit if we are reporting an error.
   10.14    if (ShowMessageBoxOnError && is_error_reported()) {
   10.15      os::infinite_sleep();

mercurial