< prev index next >

src/hotspot/os/linux/os_perf_linux.cpp

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


  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 #include "precompiled.hpp"
  26 #include "jvm.h"
  27 #include "memory/allocation.inline.hpp"
  28 #include "os_linux.inline.hpp"
  29 #include "runtime/os.hpp"
  30 #include "runtime/os_perf.hpp"

  31 
  32 #include CPU_HEADER(vm_version_ext)
  33 
  34 #include <stdio.h>
  35 #include <stdarg.h>
  36 #include <unistd.h>
  37 #include <errno.h>
  38 #include <string.h>
  39 #include <sys/resource.h>
  40 #include <sys/types.h>
  41 #include <sys/stat.h>
  42 #include <dirent.h>
  43 #include <stdlib.h>
  44 #include <dlfcn.h>
  45 #include <pthread.h>
  46 #include <limits.h>
  47 #include <ifaddrs.h>
  48 #include <fcntl.h>
  49 
  50 /**


 931        FREE_C_HEAP_ARRAY(char, cpu_desc);
 932       _cpu_info->set_cpu_description(NULL);
 933     }
 934     delete _cpu_info;
 935   }
 936 }
 937 
 938 int CPUInformationInterface::cpu_information(CPUInformation& cpu_info) {
 939   if (_cpu_info == NULL) {
 940     return OS_ERR;
 941   }
 942 
 943   cpu_info = *_cpu_info; // shallow copy assignment
 944   return OS_OK;
 945 }
 946 
 947 class NetworkPerformanceInterface::NetworkPerformance : public CHeapObj<mtInternal> {
 948   friend class NetworkPerformanceInterface;
 949  private:
 950   NetworkPerformance();
 951   NetworkPerformance(const NetworkPerformance& rhs); // no impl
 952   NetworkPerformance& operator=(const NetworkPerformance& rhs); // no impl
 953   bool initialize();
 954   ~NetworkPerformance();
 955   int64_t read_counter(const char* iface, const char* counter) const;
 956   int network_utilization(NetworkInterface** network_interfaces) const;
 957 };
 958 
 959 NetworkPerformanceInterface::NetworkPerformance::NetworkPerformance() {
 960 
 961 }
 962 
 963 bool NetworkPerformanceInterface::NetworkPerformance::initialize() {
 964   return true;
 965 }
 966 
 967 NetworkPerformanceInterface::NetworkPerformance::~NetworkPerformance() {
 968 }
 969 
 970 int64_t NetworkPerformanceInterface::NetworkPerformance::read_counter(const char* iface, const char* counter) const {
 971   char buf[128];
 972 




  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 #include "precompiled.hpp"
  26 #include "jvm.h"
  27 #include "memory/allocation.inline.hpp"
  28 #include "os_linux.inline.hpp"
  29 #include "runtime/os.hpp"
  30 #include "runtime/os_perf.hpp"
  31 #include "utilities/macros.hpp"
  32 
  33 #include CPU_HEADER(vm_version_ext)
  34 
  35 #include <stdio.h>
  36 #include <stdarg.h>
  37 #include <unistd.h>
  38 #include <errno.h>
  39 #include <string.h>
  40 #include <sys/resource.h>
  41 #include <sys/types.h>
  42 #include <sys/stat.h>
  43 #include <dirent.h>
  44 #include <stdlib.h>
  45 #include <dlfcn.h>
  46 #include <pthread.h>
  47 #include <limits.h>
  48 #include <ifaddrs.h>
  49 #include <fcntl.h>
  50 
  51 /**


 932        FREE_C_HEAP_ARRAY(char, cpu_desc);
 933       _cpu_info->set_cpu_description(NULL);
 934     }
 935     delete _cpu_info;
 936   }
 937 }
 938 
 939 int CPUInformationInterface::cpu_information(CPUInformation& cpu_info) {
 940   if (_cpu_info == NULL) {
 941     return OS_ERR;
 942   }
 943 
 944   cpu_info = *_cpu_info; // shallow copy assignment
 945   return OS_OK;
 946 }
 947 
 948 class NetworkPerformanceInterface::NetworkPerformance : public CHeapObj<mtInternal> {
 949   friend class NetworkPerformanceInterface;
 950  private:
 951   NetworkPerformance();
 952   NONCOPYABLE(NetworkPerformance);

 953   bool initialize();
 954   ~NetworkPerformance();
 955   int64_t read_counter(const char* iface, const char* counter) const;
 956   int network_utilization(NetworkInterface** network_interfaces) const;
 957 };
 958 
 959 NetworkPerformanceInterface::NetworkPerformance::NetworkPerformance() {
 960 
 961 }
 962 
 963 bool NetworkPerformanceInterface::NetworkPerformance::initialize() {
 964   return true;
 965 }
 966 
 967 NetworkPerformanceInterface::NetworkPerformance::~NetworkPerformance() {
 968 }
 969 
 970 int64_t NetworkPerformanceInterface::NetworkPerformance::read_counter(const char* iface, const char* counter) const {
 971   char buf[128];
 972 


< prev index next >