0N/A/*
2362N/A * Copyright (c) 2003, 2005, Oracle and/or its affiliates. All rights reserved.
0N/A *
0N/A * Redistribution and use in source and binary forms, with or without
0N/A * modification, are permitted provided that the following conditions
0N/A * are met:
0N/A *
0N/A * - Redistributions of source code must retain the above copyright
0N/A * notice, this list of conditions and the following disclaimer.
0N/A *
0N/A * - Redistributions in binary form must reproduce the above copyright
0N/A * notice, this list of conditions and the following disclaimer in the
0N/A * documentation and/or other materials provided with the distribution.
0N/A *
2362N/A * - Neither the name of Oracle nor the names of its
0N/A * contributors may be used to endorse or promote products derived
0N/A * from this software without specific prior written permission.
0N/A *
0N/A * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
0N/A * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
0N/A * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
0N/A * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
0N/A * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
0N/A * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
0N/A * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
0N/A * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
0N/A * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
0N/A * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
0N/A * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
0N/A */
0N/A
4378N/A/*
4378N/A * This source code is provided to illustrate the usage of a given feature
4378N/A * or technique and has been deliberately simplified. Additional steps
4378N/A * required for a production-quality application, such as security checks,
4378N/A * input validation and proper error handling, might not be present in
4378N/A * this sample code.
4378N/A */
4378N/A
4378N/A
0N/A#ifndef HPROF_IO_H
0N/A#define HPROF_IO_H
0N/A
0N/Avoid io_flush(void);
0N/Avoid io_setup(void);
0N/Avoid io_cleanup(void);
0N/A
0N/Avoid io_write_file_header(void);
0N/Avoid io_write_file_footer(void);
0N/A
0N/Avoid io_write_class_load(SerialNumber class_serial_num, ObjectIndex index,
0N/A SerialNumber trace_serial_num, char *csig);
0N/Avoid io_write_class_unload(SerialNumber class_serial_num, ObjectIndex index);
0N/A
0N/Avoid io_write_sites_header(const char * comment_str, jint flags,
0N/A double cutoff, jint total_live_bytes,
0N/A jint total_live_instances, jlong total_alloced_bytes,
0N/A jlong total_alloced_instances, jint count);
0N/Avoid io_write_sites_elem(jint index, double ratio, double accum_percent,
0N/A char *csig, SerialNumber class_serial_num,
0N/A SerialNumber trace_serial_num,
0N/A jint n_live_bytes, jint n_live_instances,
0N/A jint n_alloced_bytes, jint n_alloced_instances);
0N/Avoid io_write_sites_footer(void);
0N/A
0N/Avoid io_write_thread_start(SerialNumber thread_serial_num, TlsIndex tls_index,
0N/A SerialNumber trace_serial_num, char *thread_name,
0N/A char *thread_group_name, char *thread_parent_name);
0N/Avoid io_write_thread_end(SerialNumber thread_serial_num);
0N/A
0N/Avoid io_write_frame(FrameIndex index, SerialNumber serial_num,
0N/A char *mname, char *msig,
0N/A char *sname, SerialNumber class_serial_num,
0N/A jint lineno);
0N/A
0N/Avoid io_write_trace_header(SerialNumber trace_serial_num,
0N/A SerialNumber thread_serial_num, jint n_frames,
0N/A char * phase_str);
0N/Avoid io_write_trace_elem(SerialNumber trace_serial_num,
0N/A FrameIndex frame_index, SerialNumber frame_serial_num,
0N/A char *csig, char *mname,
0N/A char *sname, jint lineno);
0N/Avoid io_write_trace_footer(SerialNumber trace_serial_num,
0N/A SerialNumber thread_serial_num, jint n_frames);
0N/A
0N/Avoid io_write_cpu_samples_header(jlong total_cost, jint n_items);
0N/Avoid io_write_cpu_samples_elem(jint index, double percent, double accum,
0N/A jint num_hits, jlong cost,
0N/A SerialNumber trace_serial_num, jint n_frames,
0N/A char *csig, char *mname);
0N/Avoid io_write_cpu_samples_footer(void);
0N/A
0N/Avoid io_write_heap_summary(jlong total_live_bytes, jlong total_live_instances,
0N/A jlong total_alloced_bytes,
0N/A jlong total_alloced_instances);
0N/A
0N/Avoid io_write_oldprof_header(void);
0N/Avoid io_write_oldprof_elem(jint num_hits, jint num_frames, char *csig_callee,
0N/A char *mname_callee, char *msig_callee,
0N/A char *csig_caller, char *mname_caller,
0N/A char *msig_caller, jlong cost);
0N/Avoid io_write_oldprof_footer(void);
0N/A
0N/Avoid io_write_monitor_header(jlong total_time);
0N/Avoid io_write_monitor_elem(jint index, double percent, double accum,
0N/A jint num_hits, SerialNumber trace_serial_num,
0N/A char *sig);
0N/Avoid io_write_monitor_footer(void);
0N/A
0N/Avoid io_write_monitor_sleep(jlong timeout, SerialNumber thread_serial_num);
0N/Avoid io_write_monitor_wait(char *sig, jlong timeout,
0N/A SerialNumber thread_serial_num);
0N/Avoid io_write_monitor_waited(char *sig, jlong time_waited,
0N/A SerialNumber thread_serial_num);
0N/Avoid io_write_monitor_exit(char *sig, SerialNumber thread_serial_num);
0N/A
0N/Avoid io_write_monitor_dump_header(void);
0N/Avoid io_write_monitor_dump_thread_state(SerialNumber thread_serial_num,
0N/A SerialNumber trace_serial_num,
0N/A jint threadState);
0N/Avoid io_write_monitor_dump_state(char *sig,
0N/A SerialNumber thread_serial_num, jint entry_count,
0N/A SerialNumber *waiters, jint waiter_count,
0N/A SerialNumber *notify_waiters, jint notify_waiter_count);
0N/Avoid io_write_monitor_dump_footer(void);
0N/A
0N/Avoid io_heap_header(jlong total_live_instances, jlong total_live_bytes);
0N/A
0N/Avoid io_heap_root_thread_object(ObjectIndex thread_id,
0N/A SerialNumber thread_serial_num,
0N/A SerialNumber trace_serial_num);
0N/Avoid io_heap_root_unknown(ObjectIndex obj_id);
0N/Avoid io_heap_root_jni_global(ObjectIndex obj_id, SerialNumber gref_serial_num,
0N/A SerialNumber trace_serial_num);
0N/Avoid io_heap_root_jni_local(ObjectIndex obj_id,
0N/A SerialNumber thread_serial_num, jint frame_depth);
0N/Avoid io_heap_root_system_class(ObjectIndex obj_id, char *sig, SerialNumber class_serial_num);
0N/Avoid io_heap_root_monitor(ObjectIndex obj_id);
0N/Avoid io_heap_root_thread(ObjectIndex obj_id,
0N/A SerialNumber thread_serial_num);
0N/Avoid io_heap_root_java_frame(ObjectIndex obj_id,
0N/A SerialNumber thread_serial_num, jint frame_depth);
0N/Avoid io_heap_root_native_stack(ObjectIndex obj_id,
0N/A SerialNumber thread_serial_num);
0N/A
0N/Avoid io_heap_class_dump(ClassIndex cnum, char *sig, ObjectIndex class_id,
0N/A SerialNumber trace_serial_num,
0N/A ObjectIndex super_id, ObjectIndex loader_id,
0N/A ObjectIndex signers_id, ObjectIndex domain_id,
0N/A jint inst_size,
0N/A jint n_cpool, ConstantPoolValue *cpool,
0N/A jint n_fields, FieldInfo *fields, jvalue *fvalues);
0N/A
0N/Avoid io_heap_instance_dump(ClassIndex cnum, ObjectIndex obj_id,
0N/A SerialNumber trace_serial_num,
0N/A ObjectIndex class_id, jint size,
0N/A char *sig, FieldInfo *fields,
0N/A jvalue *fvalues, jint n_fields);
0N/A
0N/Avoid io_heap_object_array(ObjectIndex obj_id, SerialNumber trace_serial_num,
0N/A jint size, jint num_elements, char *sig,
0N/A ObjectIndex *values, ObjectIndex class_id);
0N/Avoid io_heap_prim_array(ObjectIndex obj_id, SerialNumber trace_serial_num,
0N/A jint size, jint num_elements, char *sig,
0N/A void *elements);
0N/A
0N/Avoid io_heap_footer(void);
0N/A
0N/A#endif