/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* 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.
*
*/
#include "precompiled.hpp"
#include "classfile/vmSymbols.hpp"
#include "memory/allocation.inline.hpp"
#include "memory/resourceArea.hpp"
#include "oops/oop.inline.hpp"
#include "runtime/interfaceSupport.hpp"
#include "runtime/perfData.hpp"
#include "runtime/perfMemory.hpp"
/*
* Implementation of class sun.misc.Perf
*/
//throw_new(env,"NullPointerException");
}
return utfstr;
}
PerfWrapper("Perf_Attach");
char* address = 0;
{
}
}
// attach to the PerfData memory region for the specified VM
{
}
PerfWrapper("Perf_Detach");
void* address = 0;
// get buffer address and capacity
{
}
PerfWrapper("Perf_CreateLong");
}
{
}
// check that the PerfData name doesn't already exist
}
switch(variability) {
case 1: /* V_Constant */
break;
case 2: /* V_Variable */
break;
case 3: /* V_Monotonic Counter */
break;
default: /* Illegal Argument */
break;
}
{
}
PerfWrapper("Perf_CreateByteArray");
// check for valid byte array objects
}
// check for valid variability classification
}
// check for valid units
// only String based ByteArray objects are currently supported
}
int value_length;
{
}
// check that the counter name doesn't already exist
}
// create the string constant
(char*)value_local,
}
else {
// create the string variable
(char*)value_local,
}
}
{
}
PerfWrapper("Perf_HighResCounter");
// this should be a method in java.lang.System. This value could
// be acquired through access to a PerfData performance counter, but
// doing so would require that the PerfData monitoring overhead be
// incurred by all Java applications, which is unacceptable.
return os::elapsed_counter();
PerfWrapper("Perf_HighResFrequency");
// this should be a method in java.lang.System. This value could
// be acquired through access to a PerfData performance counter, but
// doing so would require that the PerfData monitoring overhead be
// incurred by all Java applications, which is unacceptable.
return os::elapsed_frequency();
/// JVM_RegisterPerfMethods
};
// This one function is exported, used by NativeLookup.
PerfWrapper("JVM_RegisterPerfMethods");
{
}