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