src/share/vm/runtime/fprofiler.hpp

Print this page


   1 /*
   2  * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 














  25 // a simple flat profiler for Java
  26 
  27 
  28 // Forward declaration of classes defined in this header file
  29 class ThreadProfiler;
  30 class ThreadProfilerMark;
  31 class FlatProfiler;
  32 class IntervalData;
  33 
  34 // Declarations of classes defined only in the implementation.
  35 class ProfilerNode;
  36 class FlatProfilerTask;
  37 
  38 enum TickPosition {
  39   tp_code,
  40   tp_native
  41 };
  42 
  43 // One of these guys is constructed as we enter interesting regions
  44 // and destructed as we exit the region.  While we are in the region


 292 
 293   static void allocate_table();
 294 
 295   // The task that periodically interrupts things.
 296   friend class FlatProfilerTask;
 297   static FlatProfilerTask* task;
 298   static void record_vm_operation();
 299   static void record_vm_tick();
 300   static void record_thread_ticks();
 301 
 302   // For interval analysis
 303  private:
 304   static int interval_ticks_previous;  // delivered_ticks from the last interval
 305   static void interval_record_thread(ThreadProfiler* tp); // extract ticks from ThreadProfiler.
 306   static void interval_print();       // print interval data.
 307   static void interval_reset();       // reset interval data.
 308   enum {interval_print_size = 10};
 309   static IntervalData* interval_data;
 310 #endif // FPROF_KERNEL
 311 };


   1 /*
   2  * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 
  25 #ifndef SHARE_VM_RUNTIME_FPROFILER_HPP
  26 #define SHARE_VM_RUNTIME_FPROFILER_HPP
  27 
  28 #include "runtime/timer.hpp"
  29 #ifdef TARGET_OS_FAMILY_linux
  30 # include "thread_linux.inline.hpp"
  31 #endif
  32 #ifdef TARGET_OS_FAMILY_solaris
  33 # include "thread_solaris.inline.hpp"
  34 #endif
  35 #ifdef TARGET_OS_FAMILY_windows
  36 # include "thread_windows.inline.hpp"
  37 #endif
  38 
  39 // a simple flat profiler for Java
  40 
  41 
  42 // Forward declaration of classes defined in this header file
  43 class ThreadProfiler;
  44 class ThreadProfilerMark;
  45 class FlatProfiler;
  46 class IntervalData;
  47 
  48 // Declarations of classes defined only in the implementation.
  49 class ProfilerNode;
  50 class FlatProfilerTask;
  51 
  52 enum TickPosition {
  53   tp_code,
  54   tp_native
  55 };
  56 
  57 // One of these guys is constructed as we enter interesting regions
  58 // and destructed as we exit the region.  While we are in the region


 306 
 307   static void allocate_table();
 308 
 309   // The task that periodically interrupts things.
 310   friend class FlatProfilerTask;
 311   static FlatProfilerTask* task;
 312   static void record_vm_operation();
 313   static void record_vm_tick();
 314   static void record_thread_ticks();
 315 
 316   // For interval analysis
 317  private:
 318   static int interval_ticks_previous;  // delivered_ticks from the last interval
 319   static void interval_record_thread(ThreadProfiler* tp); // extract ticks from ThreadProfiler.
 320   static void interval_print();       // print interval data.
 321   static void interval_reset();       // reset interval data.
 322   enum {interval_print_size = 10};
 323   static IntervalData* interval_data;
 324 #endif // FPROF_KERNEL
 325 };
 326 
 327 #endif // SHARE_VM_RUNTIME_FPROFILER_HPP