1 /*
2 * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
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 *
155 // before VM ergonomics processing.
156 static jint init_2(void); // Called after command line parsing
157 // and VM ergonomics processing
158 static void init_globals(void) { // Called from init_globals() in init.cpp
159 init_globals_ext();
160 }
161
162 // File names are case-insensitive on windows only
163 // Override me as needed
164 static int file_name_strcmp(const char* s1, const char* s2);
165
166 // get/unset environment variable
167 static bool getenv(const char* name, char* buffer, int len);
168 static bool unsetenv(const char* name);
169
170 static bool have_special_privileges();
171
172 static jlong javaTimeMillis();
173 static jlong javaTimeNanos();
174 static void javaTimeNanos_info(jvmtiTimerInfo *info_ptr);
175 static void run_periodic_checks();
176 static bool supports_monotonic_clock();
177
178
179 // Returns the elapsed time in seconds since the vm started.
180 static double elapsedTime();
181
182 // Returns real time in seconds since an arbitrary point
183 // in the past.
184 static bool getTimesSecs(double* process_real_time,
185 double* process_user_time,
186 double* process_system_time);
187
188 // Interface to the performance counter
189 static jlong elapsed_counter();
190 static jlong elapsed_frequency();
191
192 // The "virtual time" of a thread is the amount of time a thread has
193 // actually run. The first function indicates whether the OS supports
194 // this functionality for the current thread, and if so:
195 // * the second enables vtime tracking (if that is required).
196 // * the third tells whether vtime is enabled.
197 // * the fourth returns the elapsed virtual time for the current
198 // thread.
|
1 /*
2 * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
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 *
155 // before VM ergonomics processing.
156 static jint init_2(void); // Called after command line parsing
157 // and VM ergonomics processing
158 static void init_globals(void) { // Called from init_globals() in init.cpp
159 init_globals_ext();
160 }
161
162 // File names are case-insensitive on windows only
163 // Override me as needed
164 static int file_name_strcmp(const char* s1, const char* s2);
165
166 // get/unset environment variable
167 static bool getenv(const char* name, char* buffer, int len);
168 static bool unsetenv(const char* name);
169
170 static bool have_special_privileges();
171
172 static jlong javaTimeMillis();
173 static jlong javaTimeNanos();
174 static void javaTimeNanos_info(jvmtiTimerInfo *info_ptr);
175 static void javaTimeSystemUTC(jlong &seconds, jlong &nanos);
176 static void run_periodic_checks();
177 static bool supports_monotonic_clock();
178
179 // Returns the elapsed time in seconds since the vm started.
180 static double elapsedTime();
181
182 // Returns real time in seconds since an arbitrary point
183 // in the past.
184 static bool getTimesSecs(double* process_real_time,
185 double* process_user_time,
186 double* process_system_time);
187
188 // Interface to the performance counter
189 static jlong elapsed_counter();
190 static jlong elapsed_frequency();
191
192 // The "virtual time" of a thread is the amount of time a thread has
193 // actually run. The first function indicates whether the OS supports
194 // this functionality for the current thread, and if so:
195 // * the second enables vtime tracking (if that is required).
196 // * the third tells whether vtime is enabled.
197 // * the fourth returns the elapsed virtual time for the current
198 // thread.
|