comparison src/os/linux/vm/os_linux.cpp @ 10372:e72f7eecc96d

8013895: G1: G1SummarizeRSetStats output on Linux needs improvemen Summary: Fixed the output of G1SummarizeRSetStats: too small datatype for the number of concurrently processed cards, added concurrent remembered set thread time retrieval for Linux and Windows (BSD uses os::elapsedTime() now), and other cleanup. The information presented during VM operation is now relative to the previous output, not always cumulative if G1SummarizeRSetStatsPeriod > 0. At VM exit, the code prints a cumulative summary. Reviewed-by: johnc, jwilhelm
author tschatzl
date Tue, 28 May 2013 09:32:06 +0200
parents 9ce110b1d14a
children f2110083203d
comparison
equal deleted inserted replaced
10371:c20186fa611b 10372:e72f7eecc96d
98 # include <sys/shm.h> 98 # include <sys/shm.h>
99 # include <link.h> 99 # include <link.h>
100 # include <stdint.h> 100 # include <stdint.h>
101 # include <inttypes.h> 101 # include <inttypes.h>
102 # include <sys/ioctl.h> 102 # include <sys/ioctl.h>
103
104 // if RUSAGE_THREAD for getrusage() has not been defined, do it here. The code calling
105 // getrusage() is prepared to handle the associated failure.
106 #ifndef RUSAGE_THREAD
107 #define RUSAGE_THREAD (1) /* only the calling thread */
108 #endif
103 109
104 #define MAX_PATH (2 * K) 110 #define MAX_PATH (2 * K)
105 111
106 // for timer info max values which include all bits 112 // for timer info max values which include all bits
107 #define ALL_64_BITS CONST64(0xFFFFFFFFFFFFFFFF) 113 #define ALL_64_BITS CONST64(0xFFFFFFFFFFFFFFFF)
1334 1340
1335 jlong os::elapsed_frequency() { 1341 jlong os::elapsed_frequency() {
1336 return (1000 * 1000); 1342 return (1000 * 1000);
1337 } 1343 }
1338 1344
1339 // For now, we say that linux does not support vtime. I have no idea 1345 bool os::supports_vtime() { return true; }
1340 // whether it can actually be made to (DLD, 9/13/05).
1341
1342 bool os::supports_vtime() { return false; }
1343 bool os::enable_vtime() { return false; } 1346 bool os::enable_vtime() { return false; }
1344 bool os::vtime_enabled() { return false; } 1347 bool os::vtime_enabled() { return false; }
1348
1345 double os::elapsedVTime() { 1349 double os::elapsedVTime() {
1346 // better than nothing, but not much 1350 struct rusage usage;
1347 return elapsedTime(); 1351 int retval = getrusage(RUSAGE_THREAD, &usage);
1352 if (retval == 0) {
1353 return (double) (usage.ru_utime.tv_sec + usage.ru_stime.tv_sec) + (double) (usage.ru_utime.tv_usec + usage.ru_stime.tv_usec) / (1000 * 1000);
1354 } else {
1355 // better than nothing, but not much
1356 return elapsedTime();
1357 }
1348 } 1358 }
1349 1359
1350 jlong os::javaTimeMillis() { 1360 jlong os::javaTimeMillis() {
1351 timeval time; 1361 timeval time;
1352 int status = gettimeofday(&time, NULL); 1362 int status = gettimeofday(&time, NULL);