src/os/aix/vm/libperfstat_aix.hpp

Wed, 31 Jan 2018 19:24:57 -0500

author
dbuck
date
Wed, 31 Jan 2018 19:24:57 -0500
changeset 9289
427b2fb1944f
parent 0
f90c822e73f8
permissions
-rw-r--r--

8189170: Add option to disable stack overflow checking in primordial thread for use with JNI_CreateJavaJVM
Reviewed-by: dcubed

aoqi@0 1 /*
aoqi@0 2 * Copyright 2012, 2013 SAP AG. All rights reserved.
aoqi@0 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
aoqi@0 4 *
aoqi@0 5 * This code is free software; you can redistribute it and/or modify it
aoqi@0 6 * under the terms of the GNU General Public License version 2 only, as
aoqi@0 7 * published by the Free Software Foundation.
aoqi@0 8 *
aoqi@0 9 * This code is distributed in the hope that it will be useful, but WITHOUT
aoqi@0 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
aoqi@0 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
aoqi@0 12 * version 2 for more details (a copy is included in the LICENSE file that
aoqi@0 13 * accompanied this code).
aoqi@0 14 *
aoqi@0 15 * You should have received a copy of the GNU General Public License version
aoqi@0 16 * 2 along with this work; if not, write to the Free Software Foundation,
aoqi@0 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
aoqi@0 18 *
aoqi@0 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
aoqi@0 20 * or visit www.oracle.com if you need additional information or have any
aoqi@0 21 * questions.
aoqi@0 22 *
aoqi@0 23 */
aoqi@0 24
aoqi@0 25 // encapsulates the libperfstat library.
aoqi@0 26 //
aoqi@0 27 // The purpose of this code is to dynamically load the libperfstat library
aoqi@0 28 // instead of statically linking against it. The libperfstat library is an
aoqi@0 29 // AIX-specific library which only exists on AIX, not on PASE. If I want to
aoqi@0 30 // share binaries between AIX and PASE, I cannot directly link against libperfstat.so.
aoqi@0 31
aoqi@0 32 #ifndef OS_AIX_VM_LIBPERFSTAT_AIX_HPP
aoqi@0 33 #define OS_AIX_VM_LIBPERFSTAT_AIX_HPP
aoqi@0 34
aoqi@0 35 #include <libperfstat.h>
aoqi@0 36
aoqi@0 37 class libperfstat {
aoqi@0 38
aoqi@0 39 public:
aoqi@0 40
aoqi@0 41 // Load the libperfstat library (must be in LIBPATH).
aoqi@0 42 // Returns true if succeeded, false if error.
aoqi@0 43 static bool init();
aoqi@0 44
aoqi@0 45 // cleanup of the libo4 porting library.
aoqi@0 46 static void cleanup();
aoqi@0 47
aoqi@0 48 // direct wrappers for the libperfstat functionality. All they do is
aoqi@0 49 // to call the functions with the same name via function pointers.
aoqi@0 50 static int perfstat_cpu_total(perfstat_id_t *name, perfstat_cpu_total_t* userbuff,
aoqi@0 51 int sizeof_userbuff, int desired_number);
aoqi@0 52
aoqi@0 53 static int perfstat_memory_total(perfstat_id_t *name, perfstat_memory_total_t* userbuff,
aoqi@0 54 int sizeof_userbuff, int desired_number);
aoqi@0 55
aoqi@0 56 static void perfstat_reset();
aoqi@0 57 };
aoqi@0 58
aoqi@0 59 #endif // OS_AIX_VM_LIBPERFSTAT_AIX_HPP

mercurial