jfrJniMethod.hpp 5.6 KB
Newer Older
A
apetushkov 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
/*
 * Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved.
 * 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.
 *
 */

#ifndef SHARE_VM_JFR_JNI_JFRJNIMETHOD_HPP
#define SHARE_VM_JFR_JNI_JFRJNIMETHOD_HPP

#include "jni.h"

/*
 * Native methods for jdk.jfr.internal.JVM
 */

#ifdef __cplusplus
extern "C" {
#endif

jboolean JNICALL jfr_is_enabled();

jboolean JNICALL jfr_is_disabled();

jboolean JNICALL jfr_is_started();

jlong JNICALL jfr_elapsed_counter(JNIEnv* env, jobject jvm);

jboolean JNICALL jfr_create_jfr(JNIEnv* env, jobject jvm, jboolean simulate_failure);

jboolean JNICALL jfr_destroy_jfr(JNIEnv* env, jobject jvm);

void JNICALL jfr_begin_recording(JNIEnv* env, jobject jvm);

52 53
jboolean JNICALL jfr_is_recording(JNIEnv* env, jobject jvm);

A
apetushkov 已提交
54 55
void JNICALL jfr_end_recording(JNIEnv* env, jobject jvm);

56 57
void JNICALL jfr_mark_chunk_final(JNIEnv* env, jobject jvm);

A
apetushkov 已提交
58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99
jboolean JNICALL jfr_emit_event(JNIEnv* env, jobject jvm, jlong eventTypeId, jlong timeStamp, jlong when);

jobject JNICALL jfr_get_all_event_classes(JNIEnv* env, jobject jvm);

jlong JNICALL jfr_class_id(JNIEnv* env, jclass jvm, jclass jc);

jstring JNICALL jfr_get_pid(JNIEnv* env, jobject jvm);

jlong JNICALL jfr_stacktrace_id(JNIEnv* env, jobject jvm, jint skip);

jlong JNICALL jfr_elapsed_frequency(JNIEnv* env, jobject jvm);

void JNICALL jfr_subscribe_log_level(JNIEnv* env, jobject jvm, jobject log_tag, jint id);

void JNICALL jfr_log(JNIEnv* env, jobject jvm, jint tag_set, jint level, jstring message);

void JNICALL jfr_retransform_classes(JNIEnv* env, jobject jvm, jobjectArray classes);

void JNICALL jfr_set_enabled(JNIEnv* env, jobject jvm, jlong event_type_id, jboolean enabled);

void JNICALL jfr_set_file_notification(JNIEnv* env, jobject jvm, jlong delta);

void JNICALL jfr_set_global_buffer_count(JNIEnv* env, jobject jvm, jlong count);

void JNICALL jfr_set_global_buffer_size(JNIEnv* env, jobject jvm, jlong size);

void JNICALL jfr_set_method_sampling_interval(JNIEnv* env, jobject jvm, jlong type, jlong intervalMillis);

void JNICALL jfr_set_output(JNIEnv* env, jobject jvm, jstring path);

void JNICALL jfr_set_sample_threads(JNIEnv* env, jobject jvm, jboolean sampleThreads);

void JNICALL jfr_set_stack_depth(JNIEnv* env, jobject jvm, jint depth);

void JNICALL jfr_set_stacktrace_enabled(JNIEnv* env, jobject jvm, jlong event_type_id, jboolean enabled);

void JNICALL jfr_set_thread_buffer_size(JNIEnv* env, jobject jvm, jlong size);

void JNICALL jfr_set_memory_size(JNIEnv* env, jobject jvm, jlong size);

jboolean JNICALL jfr_set_threshold(JNIEnv* env, jobject jvm, jlong event_type_id, jlong thresholdTicks);

100 101 102 103
void JNICALL jfr_set_sample_object_allocations(JNIEnv* env, jobject jvm,  jboolean sampleAllocations);

void JNICALL jfr_set_object_allocations_sampling_interval(JNIEnv* env, jobject jvm, jlong interval);

A
apetushkov 已提交
104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123
void JNICALL jfr_store_metadata_descriptor(JNIEnv* env, jobject jvm, jbyteArray descriptor);

jlong JNICALL jfr_id_for_thread(JNIEnv* env, jobject jvm, jobject t);

jboolean JNICALL jfr_allow_event_retransforms(JNIEnv* env, jobject jvm);

jboolean JNICALL jfr_is_available(JNIEnv* env, jclass jvm);

jdouble JNICALL jfr_time_conv_factor(JNIEnv* env, jobject jvm);

jlong JNICALL jfr_type_id(JNIEnv* env, jobject jvm, jclass jc);

void JNICALL jfr_set_repository_location(JNIEnv* env, jobject repo, jstring location);

jobject JNICALL jfr_get_event_writer(JNIEnv* env, jclass cls);

jobject JNICALL jfr_new_event_writer(JNIEnv* env, jclass cls);

jboolean JNICALL jfr_event_writer_flush(JNIEnv* env, jclass cls, jobject writer, jint used_size, jint requested_size);

124
void JNICALL jfr_flush(JNIEnv* env, jobject jvm);
A
apetushkov 已提交
125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140
void JNICALL jfr_abort(JNIEnv* env, jobject jvm, jstring errorMsg);

jlong JNICALL jfr_get_epoch_address(JNIEnv* env, jobject jvm);

jboolean JNICALL jfr_add_string_constant(JNIEnv* env, jclass jvm, jboolean epoch, jlong id, jstring string);

void JNICALL jfr_uncaught_exception(JNIEnv* env, jobject jvm, jobject thread, jthrowable throwable);

void JNICALL jfr_set_force_instrumentation(JNIEnv* env, jobject jvm, jboolean force);

jlong JNICALL jfr_get_unloaded_event_classes_count(JNIEnv* env, jobject jvm);

jboolean JNICALL jfr_set_cutoff(JNIEnv* env, jobject jvm, jlong event_type_id, jlong cutoff_ticks);

void JNICALL jfr_emit_old_object_samples(JNIEnv* env, jobject jvm, jlong cutoff_ticks, jboolean);

141 142
jboolean JNICALL jfr_should_rotate_disk(JNIEnv* env, jobject jvm);

143 144 145 146 147 148 149
void JNICALL jfr_exclude_thread(JNIEnv* env, jobject jvm, jobject t);

void JNICALL jfr_include_thread(JNIEnv* env, jobject jvm, jobject t);

jboolean JNICALL jfr_is_thread_excluded(JNIEnv* env, jobject jvm, jobject t);

jlong JNICALL jfr_chunk_start_nanos(JNIEnv* env, jobject jvm);
150

A
apetushkov 已提交
151 152 153 154 155
#ifdef __cplusplus
}
#endif

#endif // SHARE_VM_JFR_JNI_JFRJNIMETHOD_HPP