< prev index next >

src/share/vm/runtime/perfData.hpp

Print this page


   1 /*
   2  * Copyright (c) 2001, 2015, 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  *


 271     // Miscellaneous flags
 272     enum Flags {
 273       F_None = 0x0,
 274       F_Supported = 0x1    // interface is supported - java.* and com.sun.*
 275     };
 276 
 277   private:
 278     char* _name;
 279     Variability _v;
 280     Units _u;
 281     bool _on_c_heap;
 282     Flags _flags;
 283 
 284     PerfDataEntry* _pdep;
 285 
 286   protected:
 287 
 288     void *_valuep;
 289 
 290     PerfData(CounterNS ns, const char* name, Units u, Variability v);
 291     ~PerfData();
 292 
 293     // create the entry for the PerfData item in the PerfData memory region.
 294     // this region is maintained separately from the PerfData objects to
 295     // facilitate its use by external processes.
 296     void create_entry(BasicType dtype, size_t dsize, size_t dlen = 0);
 297 
 298     // sample the data item given at creation time and write its value
 299     // into the its corresponding PerfMemory location.
 300     virtual void sample() = 0;
 301 
 302   public:
 303 
 304     // returns a boolean indicating the validity of this object.
 305     // the object is valid if and only if memory in PerfMemory
 306     // region was successfully allocated.
 307     inline bool is_valid() { return _valuep != NULL; }
 308 
 309     // returns a boolean indicating whether the underlying object
 310     // was allocated in the PerfMemory region or on the C heap.
 311     inline bool is_on_c_heap() { return _on_c_heap; }


   1 /*
   2  * Copyright (c) 2001, 2017, 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  *


 271     // Miscellaneous flags
 272     enum Flags {
 273       F_None = 0x0,
 274       F_Supported = 0x1    // interface is supported - java.* and com.sun.*
 275     };
 276 
 277   private:
 278     char* _name;
 279     Variability _v;
 280     Units _u;
 281     bool _on_c_heap;
 282     Flags _flags;
 283 
 284     PerfDataEntry* _pdep;
 285 
 286   protected:
 287 
 288     void *_valuep;
 289 
 290     PerfData(CounterNS ns, const char* name, Units u, Variability v);
 291     virtual ~PerfData();
 292 
 293     // create the entry for the PerfData item in the PerfData memory region.
 294     // this region is maintained separately from the PerfData objects to
 295     // facilitate its use by external processes.
 296     void create_entry(BasicType dtype, size_t dsize, size_t dlen = 0);
 297 
 298     // sample the data item given at creation time and write its value
 299     // into the its corresponding PerfMemory location.
 300     virtual void sample() = 0;
 301 
 302   public:
 303 
 304     // returns a boolean indicating the validity of this object.
 305     // the object is valid if and only if memory in PerfMemory
 306     // region was successfully allocated.
 307     inline bool is_valid() { return _valuep != NULL; }
 308 
 309     // returns a boolean indicating whether the underlying object
 310     // was allocated in the PerfMemory region or on the C heap.
 311     inline bool is_on_c_heap() { return _on_c_heap; }


< prev index next >