jdk/src/share/demo/jvmti/hprof/hprof_io.h
author goetz
Thu, 21 Nov 2013 18:29:34 -0800
changeset 22852 1063026e8cee
parent 14342 8435a30053c1
permissions -rw-r--r--
8028471: PPC64 (part 215): opto: Extend ImplicitNullCheck optimization. Summary: Fixed Implicit NULL check optimization for AIX, where the page at address '0' is only write-protected. Reviewed-by: kvn
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
/*
14342
8435a30053c1 7197491: update copyright year to match last edit in jdk8 jdk repository
alanb
parents: 10292
diff changeset
     2
 * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     3
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
     4
 * Redistribution and use in source and binary forms, with or without
90ce3da70b43 Initial load
duke
parents:
diff changeset
     5
 * modification, are permitted provided that the following conditions
90ce3da70b43 Initial load
duke
parents:
diff changeset
     6
 * are met:
90ce3da70b43 Initial load
duke
parents:
diff changeset
     7
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
 *   - Redistributions of source code must retain the above copyright
90ce3da70b43 Initial load
duke
parents:
diff changeset
     9
 *     notice, this list of conditions and the following disclaimer.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    10
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    11
 *   - Redistributions in binary form must reproduce the above copyright
90ce3da70b43 Initial load
duke
parents:
diff changeset
    12
 *     notice, this list of conditions and the following disclaimer in the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    13
 *     documentation and/or other materials provided with the distribution.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    14
 *
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    15
 *   - Neither the name of Oracle nor the names of its
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    16
 *     contributors may be used to endorse or promote products derived
90ce3da70b43 Initial load
duke
parents:
diff changeset
    17
 *     from this software without specific prior written permission.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    18
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    19
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
90ce3da70b43 Initial load
duke
parents:
diff changeset
    20
 * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    21
 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
90ce3da70b43 Initial load
duke
parents:
diff changeset
    22
 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR
90ce3da70b43 Initial load
duke
parents:
diff changeset
    23
 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    24
 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    25
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
90ce3da70b43 Initial load
duke
parents:
diff changeset
    26
 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
10292
ed7db6a12c2a 7067811: Update demo/sample code to state it should not be used for production
nloodin
parents: 5506
diff changeset
    32
/*
ed7db6a12c2a 7067811: Update demo/sample code to state it should not be used for production
nloodin
parents: 5506
diff changeset
    33
 * This source code is provided to illustrate the usage of a given feature
ed7db6a12c2a 7067811: Update demo/sample code to state it should not be used for production
nloodin
parents: 5506
diff changeset
    34
 * or technique and has been deliberately simplified. Additional steps
ed7db6a12c2a 7067811: Update demo/sample code to state it should not be used for production
nloodin
parents: 5506
diff changeset
    35
 * required for a production-quality application, such as security checks,
ed7db6a12c2a 7067811: Update demo/sample code to state it should not be used for production
nloodin
parents: 5506
diff changeset
    36
 * input validation and proper error handling, might not be present in
ed7db6a12c2a 7067811: Update demo/sample code to state it should not be used for production
nloodin
parents: 5506
diff changeset
    37
 * this sample code.
ed7db6a12c2a 7067811: Update demo/sample code to state it should not be used for production
nloodin
parents: 5506
diff changeset
    38
 */
ed7db6a12c2a 7067811: Update demo/sample code to state it should not be used for production
nloodin
parents: 5506
diff changeset
    39
ed7db6a12c2a 7067811: Update demo/sample code to state it should not be used for production
nloodin
parents: 5506
diff changeset
    40
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
#ifndef HPROF_IO_H
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
#define HPROF_IO_H
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
void io_flush(void);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
void io_setup(void);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
void io_cleanup(void);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
void io_write_file_header(void);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
void io_write_file_footer(void);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
void io_write_class_load(SerialNumber class_serial_num, ObjectIndex index,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
                        SerialNumber trace_serial_num, char *csig);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
void io_write_class_unload(SerialNumber class_serial_num, ObjectIndex index);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
void io_write_sites_header(const char * comment_str, jint flags,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
                        double cutoff, jint total_live_bytes,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
                        jint total_live_instances, jlong total_alloced_bytes,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
                        jlong total_alloced_instances, jint count);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
void io_write_sites_elem(jint index, double ratio, double accum_percent,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
                        char *csig, SerialNumber class_serial_num,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
                        SerialNumber trace_serial_num,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
                        jint n_live_bytes, jint n_live_instances,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
                        jint n_alloced_bytes, jint n_alloced_instances);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
void io_write_sites_footer(void);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
void io_write_thread_start(SerialNumber thread_serial_num, TlsIndex tls_index,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
                        SerialNumber trace_serial_num, char *thread_name,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
                        char *thread_group_name, char *thread_parent_name);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
void io_write_thread_end(SerialNumber thread_serial_num);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
void io_write_frame(FrameIndex index, SerialNumber serial_num,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
                    char *mname, char *msig,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
                    char *sname, SerialNumber class_serial_num,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
                        jint lineno);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
void io_write_trace_header(SerialNumber trace_serial_num,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
                        SerialNumber thread_serial_num, jint n_frames,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
                        char * phase_str);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
void io_write_trace_elem(SerialNumber trace_serial_num,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
                         FrameIndex frame_index, SerialNumber frame_serial_num,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
                         char *csig, char *mname,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
                         char *sname, jint lineno);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
void io_write_trace_footer(SerialNumber trace_serial_num,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
                        SerialNumber thread_serial_num, jint n_frames);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
void io_write_cpu_samples_header(jlong total_cost, jint n_items);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
void io_write_cpu_samples_elem(jint index, double percent, double accum,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
                        jint num_hits, jlong cost,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
                        SerialNumber trace_serial_num, jint n_frames,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
                        char *csig, char *mname);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
void io_write_cpu_samples_footer(void);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
void io_write_heap_summary(jlong total_live_bytes, jlong total_live_instances,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
                        jlong total_alloced_bytes,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
                        jlong total_alloced_instances);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
void io_write_oldprof_header(void);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
void io_write_oldprof_elem(jint num_hits, jint num_frames, char *csig_callee,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
                        char *mname_callee, char *msig_callee,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
                        char *csig_caller, char *mname_caller,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
                        char *msig_caller, jlong cost);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
void io_write_oldprof_footer(void);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
void io_write_monitor_header(jlong total_time);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
void io_write_monitor_elem(jint index, double percent, double accum,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
                        jint num_hits, SerialNumber trace_serial_num,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
                        char *sig);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
void io_write_monitor_footer(void);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
void io_write_monitor_sleep(jlong timeout, SerialNumber thread_serial_num);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
void io_write_monitor_wait(char *sig, jlong timeout,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
                        SerialNumber thread_serial_num);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   113
void io_write_monitor_waited(char *sig, jlong time_waited,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   114
                        SerialNumber thread_serial_num);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   115
void io_write_monitor_exit(char *sig, SerialNumber thread_serial_num);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   116
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
void io_write_monitor_dump_header(void);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
void io_write_monitor_dump_thread_state(SerialNumber thread_serial_num,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   119
                        SerialNumber trace_serial_num,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
                        jint threadState);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   121
void io_write_monitor_dump_state(char *sig,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   122
                        SerialNumber thread_serial_num, jint entry_count,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   123
                        SerialNumber *waiters, jint waiter_count,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   124
                        SerialNumber *notify_waiters, jint notify_waiter_count);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   125
void io_write_monitor_dump_footer(void);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
90ce3da70b43 Initial load
duke
parents:
diff changeset
   127
void io_heap_header(jlong total_live_instances, jlong total_live_bytes);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
90ce3da70b43 Initial load
duke
parents:
diff changeset
   129
void io_heap_root_thread_object(ObjectIndex thread_id,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   130
                        SerialNumber thread_serial_num,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   131
                        SerialNumber trace_serial_num);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   132
void io_heap_root_unknown(ObjectIndex obj_id);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   133
void io_heap_root_jni_global(ObjectIndex obj_id, SerialNumber gref_serial_num,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   134
                        SerialNumber trace_serial_num);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   135
void io_heap_root_jni_local(ObjectIndex obj_id,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   136
                        SerialNumber thread_serial_num, jint frame_depth);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   137
void io_heap_root_system_class(ObjectIndex obj_id, char *sig, SerialNumber class_serial_num);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   138
void io_heap_root_monitor(ObjectIndex obj_id);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   139
void io_heap_root_thread(ObjectIndex obj_id,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   140
                        SerialNumber thread_serial_num);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   141
void io_heap_root_java_frame(ObjectIndex obj_id,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   142
                        SerialNumber thread_serial_num, jint frame_depth);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   143
void io_heap_root_native_stack(ObjectIndex obj_id,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   144
                        SerialNumber thread_serial_num);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   145
90ce3da70b43 Initial load
duke
parents:
diff changeset
   146
void io_heap_class_dump(ClassIndex cnum, char *sig, ObjectIndex class_id,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   147
                        SerialNumber trace_serial_num,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   148
                        ObjectIndex super_id, ObjectIndex loader_id,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   149
                        ObjectIndex signers_id, ObjectIndex domain_id,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   150
                        jint inst_size,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   151
                        jint n_cpool, ConstantPoolValue *cpool,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   152
                        jint n_fields, FieldInfo *fields, jvalue *fvalues);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   153
90ce3da70b43 Initial load
duke
parents:
diff changeset
   154
void io_heap_instance_dump(ClassIndex cnum, ObjectIndex obj_id,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   155
                        SerialNumber trace_serial_num,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   156
                        ObjectIndex class_id, jint size,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   157
                        char *sig, FieldInfo *fields,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   158
                        jvalue *fvalues, jint n_fields);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   159
90ce3da70b43 Initial load
duke
parents:
diff changeset
   160
void io_heap_object_array(ObjectIndex obj_id, SerialNumber trace_serial_num,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   161
                        jint size, jint num_elements, char *sig,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   162
                        ObjectIndex *values, ObjectIndex class_id);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   163
void io_heap_prim_array(ObjectIndex obj_id, SerialNumber trace_serial_num,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   164
                        jint size, jint num_elements, char *sig,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   165
                        void *elements);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   166
90ce3da70b43 Initial load
duke
parents:
diff changeset
   167
void io_heap_footer(void);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   168
90ce3da70b43 Initial load
duke
parents:
diff changeset
   169
#endif