J. Duke | 319a3b9 | 2007-12-01 00:00:00 +0000 | [diff] [blame^] | 1 | /* |
| 2 | * Copyright 2003-2005 Sun Microsystems, Inc. All Rights Reserved. |
| 3 | * |
| 4 | * Redistribution and use in source and binary forms, with or without |
| 5 | * modification, are permitted provided that the following conditions |
| 6 | * are met: |
| 7 | * |
| 8 | * - Redistributions of source code must retain the above copyright |
| 9 | * notice, this list of conditions and the following disclaimer. |
| 10 | * |
| 11 | * - Redistributions in binary form must reproduce the above copyright |
| 12 | * notice, this list of conditions and the following disclaimer in the |
| 13 | * documentation and/or other materials provided with the distribution. |
| 14 | * |
| 15 | * - Neither the name of Sun Microsystems nor the names of its |
| 16 | * contributors may be used to endorse or promote products derived |
| 17 | * from this software without specific prior written permission. |
| 18 | * |
| 19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS |
| 20 | * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, |
| 21 | * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR |
| 22 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR |
| 23 | * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, |
| 24 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, |
| 25 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR |
| 26 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF |
| 27 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING |
| 28 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
| 29 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 30 | */ |
| 31 | |
| 32 | #ifndef HPROF_IO_H |
| 33 | #define HPROF_IO_H |
| 34 | |
| 35 | void io_flush(void); |
| 36 | void io_setup(void); |
| 37 | void io_cleanup(void); |
| 38 | |
| 39 | void io_write_file_header(void); |
| 40 | void io_write_file_footer(void); |
| 41 | |
| 42 | void io_write_class_load(SerialNumber class_serial_num, ObjectIndex index, |
| 43 | SerialNumber trace_serial_num, char *csig); |
| 44 | void io_write_class_unload(SerialNumber class_serial_num, ObjectIndex index); |
| 45 | |
| 46 | void io_write_sites_header(const char * comment_str, jint flags, |
| 47 | double cutoff, jint total_live_bytes, |
| 48 | jint total_live_instances, jlong total_alloced_bytes, |
| 49 | jlong total_alloced_instances, jint count); |
| 50 | void io_write_sites_elem(jint index, double ratio, double accum_percent, |
| 51 | char *csig, SerialNumber class_serial_num, |
| 52 | SerialNumber trace_serial_num, |
| 53 | jint n_live_bytes, jint n_live_instances, |
| 54 | jint n_alloced_bytes, jint n_alloced_instances); |
| 55 | void io_write_sites_footer(void); |
| 56 | |
| 57 | void io_write_thread_start(SerialNumber thread_serial_num, TlsIndex tls_index, |
| 58 | SerialNumber trace_serial_num, char *thread_name, |
| 59 | char *thread_group_name, char *thread_parent_name); |
| 60 | void io_write_thread_end(SerialNumber thread_serial_num); |
| 61 | |
| 62 | void io_write_frame(FrameIndex index, SerialNumber serial_num, |
| 63 | char *mname, char *msig, |
| 64 | char *sname, SerialNumber class_serial_num, |
| 65 | jint lineno); |
| 66 | |
| 67 | void io_write_trace_header(SerialNumber trace_serial_num, |
| 68 | SerialNumber thread_serial_num, jint n_frames, |
| 69 | char * phase_str); |
| 70 | void io_write_trace_elem(SerialNumber trace_serial_num, |
| 71 | FrameIndex frame_index, SerialNumber frame_serial_num, |
| 72 | char *csig, char *mname, |
| 73 | char *sname, jint lineno); |
| 74 | void io_write_trace_footer(SerialNumber trace_serial_num, |
| 75 | SerialNumber thread_serial_num, jint n_frames); |
| 76 | |
| 77 | void io_write_cpu_samples_header(jlong total_cost, jint n_items); |
| 78 | void io_write_cpu_samples_elem(jint index, double percent, double accum, |
| 79 | jint num_hits, jlong cost, |
| 80 | SerialNumber trace_serial_num, jint n_frames, |
| 81 | char *csig, char *mname); |
| 82 | void io_write_cpu_samples_footer(void); |
| 83 | |
| 84 | void io_write_heap_summary(jlong total_live_bytes, jlong total_live_instances, |
| 85 | jlong total_alloced_bytes, |
| 86 | jlong total_alloced_instances); |
| 87 | |
| 88 | void io_write_oldprof_header(void); |
| 89 | void io_write_oldprof_elem(jint num_hits, jint num_frames, char *csig_callee, |
| 90 | char *mname_callee, char *msig_callee, |
| 91 | char *csig_caller, char *mname_caller, |
| 92 | char *msig_caller, jlong cost); |
| 93 | void io_write_oldprof_footer(void); |
| 94 | |
| 95 | void io_write_monitor_header(jlong total_time); |
| 96 | void io_write_monitor_elem(jint index, double percent, double accum, |
| 97 | jint num_hits, SerialNumber trace_serial_num, |
| 98 | char *sig); |
| 99 | void io_write_monitor_footer(void); |
| 100 | |
| 101 | void io_write_monitor_sleep(jlong timeout, SerialNumber thread_serial_num); |
| 102 | void io_write_monitor_wait(char *sig, jlong timeout, |
| 103 | SerialNumber thread_serial_num); |
| 104 | void io_write_monitor_waited(char *sig, jlong time_waited, |
| 105 | SerialNumber thread_serial_num); |
| 106 | void io_write_monitor_exit(char *sig, SerialNumber thread_serial_num); |
| 107 | |
| 108 | void io_write_monitor_dump_header(void); |
| 109 | void io_write_monitor_dump_thread_state(SerialNumber thread_serial_num, |
| 110 | SerialNumber trace_serial_num, |
| 111 | jint threadState); |
| 112 | void io_write_monitor_dump_state(char *sig, |
| 113 | SerialNumber thread_serial_num, jint entry_count, |
| 114 | SerialNumber *waiters, jint waiter_count, |
| 115 | SerialNumber *notify_waiters, jint notify_waiter_count); |
| 116 | void io_write_monitor_dump_footer(void); |
| 117 | |
| 118 | void io_heap_header(jlong total_live_instances, jlong total_live_bytes); |
| 119 | |
| 120 | void io_heap_root_thread_object(ObjectIndex thread_id, |
| 121 | SerialNumber thread_serial_num, |
| 122 | SerialNumber trace_serial_num); |
| 123 | void io_heap_root_unknown(ObjectIndex obj_id); |
| 124 | void io_heap_root_jni_global(ObjectIndex obj_id, SerialNumber gref_serial_num, |
| 125 | SerialNumber trace_serial_num); |
| 126 | void io_heap_root_jni_local(ObjectIndex obj_id, |
| 127 | SerialNumber thread_serial_num, jint frame_depth); |
| 128 | void io_heap_root_system_class(ObjectIndex obj_id, char *sig, SerialNumber class_serial_num); |
| 129 | void io_heap_root_monitor(ObjectIndex obj_id); |
| 130 | void io_heap_root_thread(ObjectIndex obj_id, |
| 131 | SerialNumber thread_serial_num); |
| 132 | void io_heap_root_java_frame(ObjectIndex obj_id, |
| 133 | SerialNumber thread_serial_num, jint frame_depth); |
| 134 | void io_heap_root_native_stack(ObjectIndex obj_id, |
| 135 | SerialNumber thread_serial_num); |
| 136 | |
| 137 | void io_heap_class_dump(ClassIndex cnum, char *sig, ObjectIndex class_id, |
| 138 | SerialNumber trace_serial_num, |
| 139 | ObjectIndex super_id, ObjectIndex loader_id, |
| 140 | ObjectIndex signers_id, ObjectIndex domain_id, |
| 141 | jint inst_size, |
| 142 | jint n_cpool, ConstantPoolValue *cpool, |
| 143 | jint n_fields, FieldInfo *fields, jvalue *fvalues); |
| 144 | |
| 145 | void io_heap_instance_dump(ClassIndex cnum, ObjectIndex obj_id, |
| 146 | SerialNumber trace_serial_num, |
| 147 | ObjectIndex class_id, jint size, |
| 148 | char *sig, FieldInfo *fields, |
| 149 | jvalue *fvalues, jint n_fields); |
| 150 | |
| 151 | void io_heap_object_array(ObjectIndex obj_id, SerialNumber trace_serial_num, |
| 152 | jint size, jint num_elements, char *sig, |
| 153 | ObjectIndex *values, ObjectIndex class_id); |
| 154 | void io_heap_prim_array(ObjectIndex obj_id, SerialNumber trace_serial_num, |
| 155 | jint size, jint num_elements, char *sig, |
| 156 | void *elements); |
| 157 | |
| 158 | void io_heap_footer(void); |
| 159 | |
| 160 | #endif |