< prev index next >

src/hotspot/share/runtime/os_perf.hpp

Print this page
rev 57095 : [mq]: use
rev 57096 : [mq]: trailing_semi


 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");
 203     const size_t length = strlen(name);
 204     assert(allocated_on_res_area(), "invariant");
 205     _name = NEW_RESOURCE_ARRAY(char, length + 1);
 206     strncpy(_name, name, length + 1);
 207     assert(strncmp(_name, name, length) == 0, "invariant");
 208   }
 209 
 210   NetworkInterface* next() const {
 211     return _next;
 212   }
 213 
 214   const char* get_name() const {
 215     return _name;


 251                         double* const psystemTotalLoad) const;
 252 };
 253 
 254 class SystemProcessInterface : public CHeapObj<mtInternal> {
 255  private:
 256    class SystemProcesses;
 257    SystemProcesses* _impl;
 258  public:
 259    SystemProcessInterface();
 260    ~SystemProcessInterface();
 261    bool initialize();
 262 
 263   // information about system processes
 264   int system_processes(SystemProcess** system_procs, int* const no_of_sys_processes) const;
 265 };
 266 
 267 class NetworkPerformanceInterface : public CHeapObj<mtInternal> {
 268  private:
 269   class NetworkPerformance;
 270   NetworkPerformance* _impl;
 271   NetworkPerformanceInterface(const NetworkPerformanceInterface& rhs); // no impl
 272   NetworkPerformanceInterface& operator=(const NetworkPerformanceInterface& rhs); // no impl
 273  public:
 274   NetworkPerformanceInterface();
 275   bool initialize();
 276   ~NetworkPerformanceInterface();
 277   int network_utilization(NetworkInterface** network_interfaces) const;
 278 };
 279 
 280 #endif // SHARE_RUNTIME_OS_PERF_HPP


 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   NONCOPYABLE(NetworkInterface);
 194 

 195  public:
 196   NetworkInterface(const char* name, uint64_t bytes_in, uint64_t bytes_out, NetworkInterface* next) :
 197   _name(NULL),
 198   _bytes_in(bytes_in),
 199   _bytes_out(bytes_out),
 200   _next(next) {
 201     assert(name != NULL, "invariant");
 202     const size_t length = strlen(name);
 203     assert(allocated_on_res_area(), "invariant");
 204     _name = NEW_RESOURCE_ARRAY(char, length + 1);
 205     strncpy(_name, name, length + 1);
 206     assert(strncmp(_name, name, length) == 0, "invariant");
 207   }
 208 
 209   NetworkInterface* next() const {
 210     return _next;
 211   }
 212 
 213   const char* get_name() const {
 214     return _name;


 250                         double* const psystemTotalLoad) const;
 251 };
 252 
 253 class SystemProcessInterface : public CHeapObj<mtInternal> {
 254  private:
 255    class SystemProcesses;
 256    SystemProcesses* _impl;
 257  public:
 258    SystemProcessInterface();
 259    ~SystemProcessInterface();
 260    bool initialize();
 261 
 262   // information about system processes
 263   int system_processes(SystemProcess** system_procs, int* const no_of_sys_processes) const;
 264 };
 265 
 266 class NetworkPerformanceInterface : public CHeapObj<mtInternal> {
 267  private:
 268   class NetworkPerformance;
 269   NetworkPerformance* _impl;
 270   NONCOPYABLE(NetworkPerformanceInterface);
 271 
 272  public:
 273   NetworkPerformanceInterface();
 274   bool initialize();
 275   ~NetworkPerformanceInterface();
 276   int network_utilization(NetworkInterface** network_interfaces) const;
 277 };
 278 
 279 #endif // SHARE_RUNTIME_OS_PERF_HPP
< prev index next >