comparison src/os/posix/vm/os_posix.cpp @ 6197:d2a62e0f25eb

6995781: Native Memory Tracking (Phase 1) 7151532: DCmd for hotspot native memory tracking Summary: Implementation of native memory tracking phase 1, which tracks VM native memory usage, and related DCmd Reviewed-by: acorn, coleenp, fparain
author zgu
date Thu, 28 Jun 2012 17:03:16 -0400
parents 7432b9db36ff
children 65906dc96aa1
comparison
equal deleted inserted replaced
6174:74533f63b116 6197:d2a62e0f25eb
21 * questions. 21 * questions.
22 * 22 *
23 */ 23 */
24 24
25 #include "prims/jvm.h" 25 #include "prims/jvm.h"
26 #include "runtime/frame.inline.hpp"
26 #include "runtime/os.hpp" 27 #include "runtime/os.hpp"
27 #include "utilities/vmError.hpp" 28 #include "utilities/vmError.hpp"
28 29
29 #include <unistd.h> 30 #include <unistd.h>
30 #include <sys/resource.h> 31 #include <sys/resource.h>
57 success = true; 58 success = true;
58 break; 59 break;
59 } 60 }
60 } 61 }
61 VMError::report_coredump_status(buffer, success); 62 VMError::report_coredump_status(buffer, success);
63 }
64
65 address os::get_caller_pc(int n) {
66 #ifdef _NMT_NOINLINE_
67 n ++;
68 #endif
69 frame fr = os::current_frame();
70 while (n > 0 && fr.pc() &&
71 !os::is_first_C_frame(&fr) && fr.sender_pc()) {
72 fr = os::get_sender_for_C_frame(&fr);
73 n --;
74 }
75 if (n == 0) {
76 return fr.pc();
77 } else {
78 return NULL;
79 }
62 } 80 }
63 81
64 int os::get_last_error() { 82 int os::get_last_error() {
65 return errno; 83 return errno;
66 } 84 }