/* * Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2012, 2018 SAP SE. All rights reserved. * Copyright (c) 2022, IBM Corp. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * * You should have received a copy of the GNU General Public License version * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions. *
*/
// Handle to the libperfstat. staticvoid* g_libhandle = NULL;
typedefint (*fun_perfstat_cpu_t) (perfstat_id_t *name, PERFSTAT_CPU_T_LATEST* userbuff, int sizeof_userbuff, int desired_number);
typedefint (*fun_perfstat_cpu_total_t) (perfstat_id_t *name, PERFSTAT_CPU_TOTAL_T_LATEST* userbuff, int sizeof_userbuff, int desired_number);
typedefint (*fun_perfstat_memory_total_t) (perfstat_id_t *name, perfstat_memory_total_t* userbuff, int sizeof_userbuff, int desired_number);
typedefint (*fun_perfstat_netinterface_t) (perfstat_id_t *name, perfstat_netinterface_t* userbuff, int sizeof_userbuff, int desired_number);
typedefint (*fun_perfstat_process_t) (perfstat_id_t *name,
PERFSTAT_PROCESS_T_LATEST* userbuff, int sizeof_userbuff, int desired_number);
typedefint (*fun_perfstat_partition_total_t) (perfstat_id_t *name,
PERFSTAT_PARTITON_TOTAL_T_LATEST* userbuff, int sizeof_userbuff, int desired_number);
typedefint (*fun_perfstat_wpar_total_t) (perfstat_id_wpar_t *name,
PERFSTAT_WPAR_TOTAL_T_LATEST* userbuff, int sizeof_userbuff, int desired_number);
// These functions may or may not be there depending on the OS release.
RESOLVE_FUN_NO_ERROR(perfstat_partition_total);
RESOLVE_FUN_NO_ERROR(perfstat_wpar_total);
RESOLVE_FUN_NO_ERROR(wpar_getcid);
// These functions are required for every release.
RESOLVE_FUN(perfstat_cpu_total);
RESOLVE_FUN(perfstat_cpu);
RESOLVE_FUN(perfstat_memory_total);
RESOLVE_FUN(perfstat_netinterface);
RESOLVE_FUN(perfstat_process);
RESOLVE_FUN(perfstat_reset);
trcVerbose("libperfstat loaded.");
returntrue;
}
void libperfstat::cleanup() {
if (g_libhandle) {
dlclose(g_libhandle);
g_libhandle = NULL;
}
// Added values to ppi that we need for later computation of cpu utilization // ( pool authorization needed for pool_idle_time ??? )
ppi->timebase_last = pspt.timebase_last;
ppi->pool_idle_time = pspt.pool_idle_time;
ppi->pcpu_tics_user = pspt.puser;
ppi->pcpu_tics_sys = pspt.psys;
ppi->pcpu_tics_idle = pspt.pidle;
ppi->pcpu_tics_wait = pspt.pwait;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.