< prev index next >

src/hotspot/share/services/threadStackTracker.cpp

Print this page




   6  * published by the Free Software Foundation.
   7  *
   8  * This code is distributed in the hope that it will be useful, but WITHOUT
   9  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  10  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  11  * version 2 for more details (a copy is included in the LICENSE file that
  12  * accompanied this code).
  13  *
  14  * You should have received a copy of the GNU General Public License version
  15  * 2 along with this work; if not, write to the Free Software Foundation,
  16  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  17  *
  18  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  19  * or visit www.oracle.com if you need additional information or have any
  20  * questions.
  21  *
  22  */
  23 
  24 #include "precompiled.hpp"
  25 
  26 #include "runtime/atomic.hpp"
  27 #include "runtime/threadCritical.hpp"
  28 #include "services/mallocTracker.hpp"
  29 #include "services/memTracker.hpp"
  30 #include "services/virtualMemoryTracker.hpp"
  31 #include "services/threadStackTracker.hpp"
  32 
  33 volatile size_t ThreadStackTracker::_thread_count = 0;
  34 SortedLinkedList<SimpleThreadStackSite, ThreadStackTracker::compare_thread_stack_base>* ThreadStackTracker::_simple_thread_stacks = NULL;
  35 
  36 bool ThreadStackTracker::late_initialize(NMT_TrackingLevel level) {
  37   if (level == NMT_detail && !track_as_vm()) {
  38     _simple_thread_stacks = new (std::nothrow, ResourceObj::C_HEAP, mtNMT)
  39       SortedLinkedList<SimpleThreadStackSite, ThreadStackTracker::compare_thread_stack_base>();
  40     return (_simple_thread_stacks != NULL);
  41   }
  42   return true;
  43 }
  44 
  45 bool ThreadStackTracker::transition(NMT_TrackingLevel from, NMT_TrackingLevel to) {
  46   assert (from != NMT_minimal, "cannot convert from the lowest tracking level to anything");




   6  * published by the Free Software Foundation.
   7  *
   8  * This code is distributed in the hope that it will be useful, but WITHOUT
   9  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  10  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  11  * version 2 for more details (a copy is included in the LICENSE file that
  12  * accompanied this code).
  13  *
  14  * You should have received a copy of the GNU General Public License version
  15  * 2 along with this work; if not, write to the Free Software Foundation,
  16  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  17  *
  18  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  19  * or visit www.oracle.com if you need additional information or have any
  20  * questions.
  21  *
  22  */
  23 
  24 #include "precompiled.hpp"
  25 

  26 #include "runtime/threadCritical.hpp"
  27 #include "services/mallocTracker.hpp"
  28 #include "services/memTracker.hpp"
  29 #include "services/virtualMemoryTracker.hpp"
  30 #include "services/threadStackTracker.hpp"
  31 
  32 volatile size_t ThreadStackTracker::_thread_count = 0;
  33 SortedLinkedList<SimpleThreadStackSite, ThreadStackTracker::compare_thread_stack_base>* ThreadStackTracker::_simple_thread_stacks = NULL;
  34 
  35 bool ThreadStackTracker::late_initialize(NMT_TrackingLevel level) {
  36   if (level == NMT_detail && !track_as_vm()) {
  37     _simple_thread_stacks = new (std::nothrow, ResourceObj::C_HEAP, mtNMT)
  38       SortedLinkedList<SimpleThreadStackSite, ThreadStackTracker::compare_thread_stack_base>();
  39     return (_simple_thread_stacks != NULL);
  40   }
  41   return true;
  42 }
  43 
  44 bool ThreadStackTracker::transition(NMT_TrackingLevel from, NMT_TrackingLevel to) {
  45   assert (from != NMT_minimal, "cannot convert from the lowest tracking level to anything");


< prev index next >