3623 } /* end GetTimerInfo */
3624
3625
3626 // nanos_ptr - pre-checked for NULL
3627 jvmtiError
3628 JvmtiEnv::GetTime(jlong* nanos_ptr) {
3629 *nanos_ptr = os::javaTimeNanos();
3630 return JVMTI_ERROR_NONE;
3631 } /* end GetTime */
3632
3633
3634 // processor_count_ptr - pre-checked for NULL
3635 jvmtiError
3636 JvmtiEnv::GetAvailableProcessors(jint* processor_count_ptr) {
3637 *processor_count_ptr = os::active_processor_count();
3638 return JVMTI_ERROR_NONE;
3639 } /* end GetAvailableProcessors */
3640
3641 jvmtiError
3642 JvmtiEnv::SetHeapSamplingRate(jint sampling_rate) {
3643 ThreadHeapSampler::set_tlab_heap_sampling(sampling_rate);
3644 return JVMTI_ERROR_NONE;
3645 } /* end SetHeapSamplingRate */
3646
3647 //
3648 // System Properties functions
3649 //
3650
3651 // count_ptr - pre-checked for NULL
3652 // property_ptr - pre-checked for NULL
3653 jvmtiError
3654 JvmtiEnv::GetSystemProperties(jint* count_ptr, char*** property_ptr) {
3655 jvmtiError err = JVMTI_ERROR_NONE;
3656
3657 // Get the number of readable properties.
3658 *count_ptr = Arguments::PropertyList_readable_count(Arguments::system_properties());
3659
3660 // Allocate memory to hold the exact number of readable properties.
3661 err = allocate(*count_ptr * sizeof(char *), (unsigned char **)property_ptr);
3662 if (err != JVMTI_ERROR_NONE) {
|
3623 } /* end GetTimerInfo */
3624
3625
3626 // nanos_ptr - pre-checked for NULL
3627 jvmtiError
3628 JvmtiEnv::GetTime(jlong* nanos_ptr) {
3629 *nanos_ptr = os::javaTimeNanos();
3630 return JVMTI_ERROR_NONE;
3631 } /* end GetTime */
3632
3633
3634 // processor_count_ptr - pre-checked for NULL
3635 jvmtiError
3636 JvmtiEnv::GetAvailableProcessors(jint* processor_count_ptr) {
3637 *processor_count_ptr = os::active_processor_count();
3638 return JVMTI_ERROR_NONE;
3639 } /* end GetAvailableProcessors */
3640
3641 jvmtiError
3642 JvmtiEnv::SetHeapSamplingRate(jint sampling_rate) {
3643 if (sampling_rate < 0) {
3644 return JVMTI_ERROR_ILLEGAL_ARGUMENT;
3645 }
3646 ThreadHeapSampler::set_tlab_heap_sampling(sampling_rate);
3647 return JVMTI_ERROR_NONE;
3648 } /* end SetHeapSamplingRate */
3649
3650 //
3651 // System Properties functions
3652 //
3653
3654 // count_ptr - pre-checked for NULL
3655 // property_ptr - pre-checked for NULL
3656 jvmtiError
3657 JvmtiEnv::GetSystemProperties(jint* count_ptr, char*** property_ptr) {
3658 jvmtiError err = JVMTI_ERROR_NONE;
3659
3660 // Get the number of readable properties.
3661 *count_ptr = Arguments::PropertyList_readable_count(Arguments::system_properties());
3662
3663 // Allocate memory to hold the exact number of readable properties.
3664 err = allocate(*count_ptr * sizeof(char *), (unsigned char **)property_ptr);
3665 if (err != JVMTI_ERROR_NONE) {
|