1/*
2 * Copyright (c) 2014, 2019, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
23 */
24
25#ifndef SHARE_JFR_JNI_JFRJNIMETHOD_HPP
26#define SHARE_JFR_JNI_JFRJNIMETHOD_HPP
27
28#include "jni.h"
29
30/*
31 * Native methods for jdk.jfr.internal.JVM
32 */
33
34#ifdef __cplusplus
35extern "C" {
36#endif
37
38jboolean JNICALL jfr_is_enabled();
39
40jboolean JNICALL jfr_is_disabled();
41
42jboolean JNICALL jfr_is_started();
43
44jlong JNICALL jfr_elapsed_counter(JNIEnv* env, jobject jvm);
45
46jboolean JNICALL jfr_create_jfr(JNIEnv* env, jobject jvm, jboolean simulate_failure);
47
48jboolean JNICALL jfr_destroy_jfr(JNIEnv* env, jobject jvm);
49
50void JNICALL jfr_begin_recording(JNIEnv* env, jobject jvm);
51
52void JNICALL jfr_end_recording(JNIEnv* env, jobject jvm);
53
54jboolean JNICALL jfr_emit_event(JNIEnv* env, jobject jvm, jlong eventTypeId, jlong timeStamp, jlong when);
55
56jobject JNICALL jfr_get_all_event_classes(JNIEnv* env, jobject jvm);
57
58jlong JNICALL jfr_class_id(JNIEnv* env, jclass jvm, jclass jc);
59
60jstring JNICALL jfr_get_pid(JNIEnv* env, jobject jvm);
61
62jlong JNICALL jfr_stacktrace_id(JNIEnv* env, jobject jvm, jint skip);
63
64jlong JNICALL jfr_elapsed_frequency(JNIEnv* env, jobject jvm);
65
66void JNICALL jfr_subscribe_log_level(JNIEnv* env, jobject jvm, jobject log_tag, jint id);
67
68void JNICALL jfr_log(JNIEnv* env, jobject jvm, jint tag_set, jint level, jstring message);
69
70void JNICALL jfr_retransform_classes(JNIEnv* env, jobject jvm, jobjectArray classes);
71
72void JNICALL jfr_set_enabled(JNIEnv* env, jobject jvm, jlong event_type_id, jboolean enabled);
73
74void JNICALL jfr_set_file_notification(JNIEnv* env, jobject jvm, jlong delta);
75
76void JNICALL jfr_set_global_buffer_count(JNIEnv* env, jobject jvm, jlong count);
77
78void JNICALL jfr_set_global_buffer_size(JNIEnv* env, jobject jvm, jlong size);
79
80void JNICALL jfr_set_method_sampling_interval(JNIEnv* env, jobject jvm, jlong type, jlong intervalMillis);
81
82void JNICALL jfr_set_output(JNIEnv* env, jobject jvm, jstring path);
83
84void JNICALL jfr_set_sample_threads(JNIEnv* env, jobject jvm, jboolean sampleThreads);
85
86void JNICALL jfr_set_stack_depth(JNIEnv* env, jobject jvm, jint depth);
87
88void JNICALL jfr_set_stacktrace_enabled(JNIEnv* env, jobject jvm, jlong event_type_id, jboolean enabled);
89
90void JNICALL jfr_set_thread_buffer_size(JNIEnv* env, jobject jvm, jlong size);
91
92void JNICALL jfr_set_memory_size(JNIEnv* env, jobject jvm, jlong size);
93
94jboolean JNICALL jfr_set_threshold(JNIEnv* env, jobject jvm, jlong event_type_id, jlong thresholdTicks);
95
96void JNICALL jfr_store_metadata_descriptor(JNIEnv* env, jobject jvm, jbyteArray descriptor);
97
98jlong JNICALL jfr_id_for_thread(JNIEnv* env, jobject jvm, jobject t);
99
100jboolean JNICALL jfr_allow_event_retransforms(JNIEnv* env, jobject jvm);
101
102jboolean JNICALL jfr_is_available(JNIEnv* env, jclass jvm);
103
104jdouble JNICALL jfr_time_conv_factor(JNIEnv* env, jobject jvm);
105
106jlong JNICALL jfr_type_id(JNIEnv* env, jobject jvm, jclass jc);
107
108void JNICALL jfr_set_repository_location(JNIEnv* env, jobject repo, jstring location);
109
110jobject JNICALL jfr_get_event_writer(JNIEnv* env, jclass cls);
111
112jobject JNICALL jfr_new_event_writer(JNIEnv* env, jclass cls);
113
114jboolean JNICALL jfr_event_writer_flush(JNIEnv* env, jclass cls, jobject writer, jint used_size, jint requested_size);
115
116void JNICALL jfr_abort(JNIEnv* env, jobject jvm, jstring errorMsg);
117
118jlong JNICALL jfr_get_epoch_address(JNIEnv* env, jobject jvm);
119
120jboolean JNICALL jfr_add_string_constant(JNIEnv* env, jclass jvm, jboolean epoch, jlong id, jstring string);
121
122void JNICALL jfr_uncaught_exception(JNIEnv* env, jobject jvm, jobject thread, jthrowable throwable);
123
124void JNICALL jfr_set_force_instrumentation(JNIEnv* env, jobject jvm, jboolean force);
125
126jlong JNICALL jfr_get_unloaded_event_classes_count(JNIEnv* env, jobject jvm);
127
128jboolean JNICALL jfr_set_cutoff(JNIEnv* env, jobject jvm, jlong event_type_id, jlong cutoff_ticks);
129
130void JNICALL jfr_emit_old_object_samples(JNIEnv* env, jobject jvm, jlong cutoff_ticks, jboolean);
131
132jboolean JNICALL jfr_should_rotate_disk(JNIEnv* env, jobject jvm);
133
134
135#ifdef __cplusplus
136}
137#endif
138
139#endif // SHARE_JFR_JNI_JFRJNIMETHOD_HPP
140