Path: blob/aarch64-shenandoah-jdk8u272-b10/jdk/src/share/demo/jvmti/hprof/hprof_io.h
38829 views
/*1* Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.2*3* Redistribution and use in source and binary forms, with or without4* modification, are permitted provided that the following conditions5* are met:6*7* - Redistributions of source code must retain the above copyright8* notice, this list of conditions and the following disclaimer.9*10* - Redistributions in binary form must reproduce the above copyright11* notice, this list of conditions and the following disclaimer in the12* documentation and/or other materials provided with the distribution.13*14* - Neither the name of Oracle nor the names of its15* contributors may be used to endorse or promote products derived16* from this software without specific prior written permission.17*18* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS19* IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,20* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR21* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR22* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,23* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,24* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR25* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF26* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING27* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS28* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.29*/3031/*32* This source code is provided to illustrate the usage of a given feature33* or technique and has been deliberately simplified. Additional steps34* required for a production-quality application, such as security checks,35* input validation and proper error handling, might not be present in36* this sample code.37*/383940#ifndef HPROF_IO_H41#define HPROF_IO_H4243void io_flush(void);44void io_setup(void);45void io_cleanup(void);4647void io_write_file_header(void);48void io_write_file_footer(void);4950void io_write_class_load(SerialNumber class_serial_num, ObjectIndex index,51SerialNumber trace_serial_num, char *csig);52void io_write_class_unload(SerialNumber class_serial_num, ObjectIndex index);5354void io_write_sites_header(const char * comment_str, jint flags,55double cutoff, jint total_live_bytes,56jint total_live_instances, jlong total_alloced_bytes,57jlong total_alloced_instances, jint count);58void io_write_sites_elem(jint index, double ratio, double accum_percent,59char *csig, SerialNumber class_serial_num,60SerialNumber trace_serial_num,61jint n_live_bytes, jint n_live_instances,62jint n_alloced_bytes, jint n_alloced_instances);63void io_write_sites_footer(void);6465void io_write_thread_start(SerialNumber thread_serial_num, TlsIndex tls_index,66SerialNumber trace_serial_num, char *thread_name,67char *thread_group_name, char *thread_parent_name);68void io_write_thread_end(SerialNumber thread_serial_num);6970void io_write_frame(FrameIndex index, SerialNumber serial_num,71char *mname, char *msig,72char *sname, SerialNumber class_serial_num,73jint lineno);7475void io_write_trace_header(SerialNumber trace_serial_num,76SerialNumber thread_serial_num, jint n_frames,77char * phase_str);78void io_write_trace_elem(SerialNumber trace_serial_num,79FrameIndex frame_index, SerialNumber frame_serial_num,80char *csig, char *mname,81char *sname, jint lineno);82void io_write_trace_footer(SerialNumber trace_serial_num,83SerialNumber thread_serial_num, jint n_frames);8485void io_write_cpu_samples_header(jlong total_cost, jint n_items);86void io_write_cpu_samples_elem(jint index, double percent, double accum,87jint num_hits, jlong cost,88SerialNumber trace_serial_num, jint n_frames,89char *csig, char *mname);90void io_write_cpu_samples_footer(void);9192void io_write_heap_summary(jlong total_live_bytes, jlong total_live_instances,93jlong total_alloced_bytes,94jlong total_alloced_instances);9596void io_write_oldprof_header(void);97void io_write_oldprof_elem(jint num_hits, jint num_frames, char *csig_callee,98char *mname_callee, char *msig_callee,99char *csig_caller, char *mname_caller,100char *msig_caller, jlong cost);101void io_write_oldprof_footer(void);102103void io_write_monitor_header(jlong total_time);104void io_write_monitor_elem(jint index, double percent, double accum,105jint num_hits, SerialNumber trace_serial_num,106char *sig);107void io_write_monitor_footer(void);108109void io_write_monitor_sleep(jlong timeout, SerialNumber thread_serial_num);110void io_write_monitor_wait(char *sig, jlong timeout,111SerialNumber thread_serial_num);112void io_write_monitor_waited(char *sig, jlong time_waited,113SerialNumber thread_serial_num);114void io_write_monitor_exit(char *sig, SerialNumber thread_serial_num);115116void io_write_monitor_dump_header(void);117void io_write_monitor_dump_thread_state(SerialNumber thread_serial_num,118SerialNumber trace_serial_num,119jint threadState);120void io_write_monitor_dump_state(char *sig,121SerialNumber thread_serial_num, jint entry_count,122SerialNumber *waiters, jint waiter_count,123SerialNumber *notify_waiters, jint notify_waiter_count);124void io_write_monitor_dump_footer(void);125126void io_heap_header(jlong total_live_instances, jlong total_live_bytes);127128void io_heap_root_thread_object(ObjectIndex thread_id,129SerialNumber thread_serial_num,130SerialNumber trace_serial_num);131void io_heap_root_unknown(ObjectIndex obj_id);132void io_heap_root_jni_global(ObjectIndex obj_id, SerialNumber gref_serial_num,133SerialNumber trace_serial_num);134void io_heap_root_jni_local(ObjectIndex obj_id,135SerialNumber thread_serial_num, jint frame_depth);136void io_heap_root_system_class(ObjectIndex obj_id, char *sig, SerialNumber class_serial_num);137void io_heap_root_monitor(ObjectIndex obj_id);138void io_heap_root_thread(ObjectIndex obj_id,139SerialNumber thread_serial_num);140void io_heap_root_java_frame(ObjectIndex obj_id,141SerialNumber thread_serial_num, jint frame_depth);142void io_heap_root_native_stack(ObjectIndex obj_id,143SerialNumber thread_serial_num);144145void io_heap_class_dump(ClassIndex cnum, char *sig, ObjectIndex class_id,146SerialNumber trace_serial_num,147ObjectIndex super_id, ObjectIndex loader_id,148ObjectIndex signers_id, ObjectIndex domain_id,149jint inst_size,150jint n_cpool, ConstantPoolValue *cpool,151jint n_fields, FieldInfo *fields, jvalue *fvalues);152153void io_heap_instance_dump(ClassIndex cnum, ObjectIndex obj_id,154SerialNumber trace_serial_num,155ObjectIndex class_id, jint size,156char *sig, FieldInfo *fields,157jvalue *fvalues, jint n_fields);158159void io_heap_object_array(ObjectIndex obj_id, SerialNumber trace_serial_num,160jint size, jint num_elements, char *sig,161ObjectIndex *values, ObjectIndex class_id);162void io_heap_prim_array(ObjectIndex obj_id, SerialNumber trace_serial_num,163jint size, jint num_elements, char *sig,164void *elements);165166void io_heap_footer(void);167168#endif169170171