blob: 87dc833d23c7ddf91330de2f8d9fb2b987284c6b [file] [log] [blame]
J. Duke319a3b92007-12-01 00:00:00 +00001/*
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
35void io_flush(void);
36void io_setup(void);
37void io_cleanup(void);
38
39void io_write_file_header(void);
40void io_write_file_footer(void);
41
42void io_write_class_load(SerialNumber class_serial_num, ObjectIndex index,
43 SerialNumber trace_serial_num, char *csig);
44void io_write_class_unload(SerialNumber class_serial_num, ObjectIndex index);
45
46void 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);
50void 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);
55void io_write_sites_footer(void);
56
57void 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);
60void io_write_thread_end(SerialNumber thread_serial_num);
61
62void io_write_frame(FrameIndex index, SerialNumber serial_num,
63 char *mname, char *msig,
64 char *sname, SerialNumber class_serial_num,
65 jint lineno);
66
67void io_write_trace_header(SerialNumber trace_serial_num,
68 SerialNumber thread_serial_num, jint n_frames,
69 char * phase_str);
70void 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);
74void io_write_trace_footer(SerialNumber trace_serial_num,
75 SerialNumber thread_serial_num, jint n_frames);
76
77void io_write_cpu_samples_header(jlong total_cost, jint n_items);
78void 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);
82void io_write_cpu_samples_footer(void);
83
84void io_write_heap_summary(jlong total_live_bytes, jlong total_live_instances,
85 jlong total_alloced_bytes,
86 jlong total_alloced_instances);
87
88void io_write_oldprof_header(void);
89void 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);
93void io_write_oldprof_footer(void);
94
95void io_write_monitor_header(jlong total_time);
96void io_write_monitor_elem(jint index, double percent, double accum,
97 jint num_hits, SerialNumber trace_serial_num,
98 char *sig);
99void io_write_monitor_footer(void);
100
101void io_write_monitor_sleep(jlong timeout, SerialNumber thread_serial_num);
102void io_write_monitor_wait(char *sig, jlong timeout,
103 SerialNumber thread_serial_num);
104void io_write_monitor_waited(char *sig, jlong time_waited,
105 SerialNumber thread_serial_num);
106void io_write_monitor_exit(char *sig, SerialNumber thread_serial_num);
107
108void io_write_monitor_dump_header(void);
109void io_write_monitor_dump_thread_state(SerialNumber thread_serial_num,
110 SerialNumber trace_serial_num,
111 jint threadState);
112void 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);
116void io_write_monitor_dump_footer(void);
117
118void io_heap_header(jlong total_live_instances, jlong total_live_bytes);
119
120void io_heap_root_thread_object(ObjectIndex thread_id,
121 SerialNumber thread_serial_num,
122 SerialNumber trace_serial_num);
123void io_heap_root_unknown(ObjectIndex obj_id);
124void io_heap_root_jni_global(ObjectIndex obj_id, SerialNumber gref_serial_num,
125 SerialNumber trace_serial_num);
126void io_heap_root_jni_local(ObjectIndex obj_id,
127 SerialNumber thread_serial_num, jint frame_depth);
128void io_heap_root_system_class(ObjectIndex obj_id, char *sig, SerialNumber class_serial_num);
129void io_heap_root_monitor(ObjectIndex obj_id);
130void io_heap_root_thread(ObjectIndex obj_id,
131 SerialNumber thread_serial_num);
132void io_heap_root_java_frame(ObjectIndex obj_id,
133 SerialNumber thread_serial_num, jint frame_depth);
134void io_heap_root_native_stack(ObjectIndex obj_id,
135 SerialNumber thread_serial_num);
136
137void 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
145void 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
151void 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);
154void io_heap_prim_array(ObjectIndex obj_id, SerialNumber trace_serial_num,
155 jint size, jint num_elements, char *sig,
156 void *elements);
157
158void io_heap_footer(void);
159
160#endif