1 /* |
1 /* |
2 * Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2012, 2019, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
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 |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. |
7 * published by the Free Software Foundation. |
68 CPUInformationInterface* _cpu_info_interface; |
68 CPUInformationInterface* _cpu_info_interface; |
69 CPUPerformanceInterface* _cpu_perf_interface; |
69 CPUPerformanceInterface* _cpu_perf_interface; |
70 SystemProcessInterface* _system_process_interface; |
70 SystemProcessInterface* _system_process_interface; |
71 NetworkPerformanceInterface* _network_performance_interface; |
71 NetworkPerformanceInterface* _network_performance_interface; |
72 |
72 |
73 // stub helper |
|
74 void functionality_not_implemented(char** str) const; |
|
75 |
|
76 JfrOSInterfaceImpl(); |
73 JfrOSInterfaceImpl(); |
77 bool initialize(); |
74 bool initialize(); |
78 ~JfrOSInterfaceImpl(); |
75 ~JfrOSInterfaceImpl(); |
79 |
76 |
80 // cpu info |
77 // cpu info |
174 assert(os_version != NULL, "os_version pointer is NULL!"); |
171 assert(os_version != NULL, "os_version pointer is NULL!"); |
175 stringStream os_ver_info; |
172 stringStream os_ver_info; |
176 os::print_os_info_brief(&os_ver_info); |
173 os::print_os_info_brief(&os_ver_info); |
177 *os_version = os_ver_info.as_string(); |
174 *os_version = os_ver_info.as_string(); |
178 return OS_OK; |
175 return OS_OK; |
179 } |
|
180 |
|
181 void JfrOSInterface::JfrOSInterfaceImpl::functionality_not_implemented(char** str) const { |
|
182 assert(str != NULL, "address to string is NULL!"); |
|
183 const char* not_impl = "Functionality_not_implemented"; |
|
184 const size_t not_impl_len = strlen(not_impl); |
|
185 *str = NEW_C_HEAP_ARRAY(char, not_impl_len+1, mtTracing); |
|
186 strncpy(*str, not_impl, not_impl_len); |
|
187 (*str)[not_impl_len] = '\0'; |
|
188 } |
176 } |
189 |
177 |
190 JfrOSInterface::JfrOSInterface() { |
178 JfrOSInterface::JfrOSInterface() { |
191 _impl = NULL; |
179 _impl = NULL; |
192 } |
180 } |