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