< prev index next >

src/hotspot/share/runtime/os_perf.hpp

Print this page

 24 
 25 #ifndef SHARE_RUNTIME_OS_PERF_HPP
 26 #define SHARE_RUNTIME_OS_PERF_HPP
 27 
 28 #include "memory/allocation.hpp"
 29 #include "utilities/macros.hpp"
 30 
 31 #define FUNCTIONALITY_NOT_IMPLEMENTED -8
 32 
 33 class EnvironmentVariable : public CHeapObj<mtInternal> {
 34  public:
 35   char* _key;
 36   char* _value;
 37 
 38   EnvironmentVariable() {
 39     _key = NULL;
 40     _value = NULL;
 41   }
 42 
 43   ~EnvironmentVariable() {
 44     if (_key != NULL) {
 45       FREE_C_HEAP_ARRAY(char, _key);
 46     }
 47     if (_value != NULL) {
 48       FREE_C_HEAP_ARRAY(char, _value);
 49     }
 50   }
 51 
 52   EnvironmentVariable(char* key, char* value) {
 53     _key = key;
 54     _value = value;
 55   }
 56 
 57 };
 58 
 59 
 60 class CPUInformation : public CHeapObj<mtInternal> {
 61  private:
 62   int   _no_of_sockets;
 63   int   _no_of_cores;
 64   int   _no_of_hw_threads;
 65   const char* _description;
 66   const char* _name;
 67 
 68  public:
 69   CPUInformation() {

164     _name = name;
165   }
166 
167   const char* path(void) const {
168     return _path;
169   }
170 
171   void set_path(char* path) {
172     _path = path;
173   }
174 
175   const char* command_line(void) const {
176     return _command_line;
177   }
178 
179   void set_command_line(char* command_line) {
180     _command_line = command_line;
181   }
182 
183   virtual ~SystemProcess(void) {
184     if (_name != NULL) {
185       FREE_C_HEAP_ARRAY(char, _name);
186     }
187     if (_path != NULL) {
188       FREE_C_HEAP_ARRAY(char, _path);
189     }
190     if (_command_line != NULL) {
191       FREE_C_HEAP_ARRAY(char, _command_line);
192     }
193   }
194 };
195 
196 class NetworkInterface : public ResourceObj {
197  private:
198   char* _name;
199   uint64_t _bytes_in;
200   uint64_t _bytes_out;
201   NetworkInterface* _next;
202 
203   NetworkInterface(); // no impl
204   NetworkInterface(const NetworkInterface& rhs); // no impl
205   NetworkInterface& operator=(const NetworkInterface& rhs); // no impl
206  public:
207   NetworkInterface(const char* name, uint64_t bytes_in, uint64_t bytes_out, NetworkInterface* next) :
208   _name(NULL),
209   _bytes_in(bytes_in),
210   _bytes_out(bytes_out),
211   _next(next) {
212     assert(name != NULL, "invariant");

 24 
 25 #ifndef SHARE_RUNTIME_OS_PERF_HPP
 26 #define SHARE_RUNTIME_OS_PERF_HPP
 27 
 28 #include "memory/allocation.hpp"
 29 #include "utilities/macros.hpp"
 30 
 31 #define FUNCTIONALITY_NOT_IMPLEMENTED -8
 32 
 33 class EnvironmentVariable : public CHeapObj<mtInternal> {
 34  public:
 35   char* _key;
 36   char* _value;
 37 
 38   EnvironmentVariable() {
 39     _key = NULL;
 40     _value = NULL;
 41   }
 42 
 43   ~EnvironmentVariable() {
 44     FREE_C_HEAP_ARRAY(char, _key);
 45     FREE_C_HEAP_ARRAY(char, _value);




 46   }
 47 
 48   EnvironmentVariable(char* key, char* value) {
 49     _key = key;
 50     _value = value;
 51   }
 52 
 53 };
 54 
 55 
 56 class CPUInformation : public CHeapObj<mtInternal> {
 57  private:
 58   int   _no_of_sockets;
 59   int   _no_of_cores;
 60   int   _no_of_hw_threads;
 61   const char* _description;
 62   const char* _name;
 63 
 64  public:
 65   CPUInformation() {

160     _name = name;
161   }
162 
163   const char* path(void) const {
164     return _path;
165   }
166 
167   void set_path(char* path) {
168     _path = path;
169   }
170 
171   const char* command_line(void) const {
172     return _command_line;
173   }
174 
175   void set_command_line(char* command_line) {
176     _command_line = command_line;
177   }
178 
179   virtual ~SystemProcess(void) {
180     FREE_C_HEAP_ARRAY(char, _name);
181     FREE_C_HEAP_ARRAY(char, _path);
182     FREE_C_HEAP_ARRAY(char, _command_line);






183   }
184 };
185 
186 class NetworkInterface : public ResourceObj {
187  private:
188   char* _name;
189   uint64_t _bytes_in;
190   uint64_t _bytes_out;
191   NetworkInterface* _next;
192 
193   NetworkInterface(); // no impl
194   NetworkInterface(const NetworkInterface& rhs); // no impl
195   NetworkInterface& operator=(const NetworkInterface& rhs); // no impl
196  public:
197   NetworkInterface(const char* name, uint64_t bytes_in, uint64_t bytes_out, NetworkInterface* next) :
198   _name(NULL),
199   _bytes_in(bytes_in),
200   _bytes_out(bytes_out),
201   _next(next) {
202     assert(name != NULL, "invariant");
< prev index next >