557b231bbd97c44cfe62ff825a3ffe00303e35fc
[openjpeg.git] / applications / JavaOpenJPEG / java-jni / include / jvmpi.h
1 /*\r
2  * @(#)jvmpi.h  1.28 03/12/19\r
3  *\r
4  * Copyright 2004 Sun Microsystems, Inc. All rights reserved.\r
5  * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.\r
6  */\r
7 \r
8 #ifndef _JAVASOFT_JVMPI_H_\r
9 #define _JAVASOFT_JVMPI_H_\r
10 \r
11 #include "jni.h"\r
12 \r
13 #define JVMPI_VERSION_1   ((jint)0x10000001)  /* implied 0 for minor version */\r
14 #define JVMPI_VERSION_1_1 ((jint)0x10000002)\r
15 #define JVMPI_VERSION_1_2 ((jint)0x10000003)\r
16 \r
17 #ifdef __cplusplus\r
18 extern "C" {\r
19 #endif\r
20   typedef void (*jvmpi_void_function_of_void)(void *);\r
21 #ifdef __cplusplus\r
22 }\r
23 #endif\r
24 \r
25 /****************************************************************\r
26  * Profiler interface data structures.\r
27  ****************************************************************/\r
28 /* identifier types. */\r
29 struct _jobjectID;\r
30 typedef struct _jobjectID * jobjectID;       /* type of object ids */ \r
31 \r
32 /* raw monitors */\r
33 struct _JVMPI_RawMonitor;\r
34 typedef struct _JVMPI_RawMonitor * JVMPI_RawMonitor;\r
35 \r
36 /* call frame */\r
37 typedef struct {\r
38     jint lineno;                      /* line number in the source file */\r
39     jmethodID method_id;              /* method executed in this frame */\r
40 } JVMPI_CallFrame;\r
41 \r
42 /* call trace */\r
43 typedef struct {\r
44     JNIEnv *env_id;                   /* Env where trace was recorded */\r
45     jint num_frames;                  /* number of frames in this trace */\r
46     JVMPI_CallFrame *frames;          /* frames */\r
47 } JVMPI_CallTrace;\r
48 \r
49 /* method */\r
50 typedef struct {\r
51     char *method_name;                /* name of method */\r
52     char *method_signature;           /* signature of method */\r
53     jint start_lineno;                /* -1 if native, abstract .. */\r
54     jint end_lineno;                  /* -1 if native, abstract .. */\r
55     jmethodID method_id;              /* id assigned to this method */\r
56 } JVMPI_Method;\r
57 \r
58 /* Field */\r
59 typedef struct {\r
60     char *field_name;                 /* name of field */\r
61     char *field_signature;            /* signature of field */\r
62 } JVMPI_Field;\r
63 \r
64 /* line number info for a compiled method */\r
65 typedef struct {\r
66     jint offset;                      /* offset from beginning of method */\r
67     jint lineno;                      /* lineno from beginning of src file */\r
68 } JVMPI_Lineno;\r
69 \r
70 /* event */\r
71 typedef struct {\r
72     jint event_type;                  /* event_type */\r
73     JNIEnv *env_id;                   /* env where this event occured */\r
74   \r
75     union {\r
76         struct {\r
77             const char *class_name;   /* class name */\r
78             char *source_name;        /* name of source file */\r
79             jint num_interfaces;      /* number of interfaces implemented */\r
80             jint num_methods;         /* number of methods in the class */\r
81             JVMPI_Method *methods;    /* methods */\r
82             jint num_static_fields;   /* number of static fields */\r
83             JVMPI_Field *statics;     /* static fields */\r
84             jint num_instance_fields; /* number of instance fields */\r
85             JVMPI_Field *instances;   /* instance fields */\r
86             jobjectID class_id;       /* id of the class object */\r
87         } class_load;\r
88 \r
89         struct {\r
90             jobjectID class_id;       /* id of the class object */\r
91         } class_unload;\r
92 \r
93         struct {\r
94             unsigned char *class_data;        /* content of class file */\r
95             jint class_data_len;              /* class file length */\r
96             unsigned char *new_class_data;    /* instrumented class file */\r
97             jint new_class_data_len;          /* new class file length */\r
98             void * (*malloc_f)(unsigned int); /* memory allocation function */\r
99         } class_load_hook;\r
100 \r
101         struct {\r
102             jint arena_id;\r
103             jobjectID class_id;       /* id of object class */\r
104             jint is_array;            /* JVMPI_NORMAL_OBJECT, ... */\r
105             jint size;                /* size in number of bytes */\r
106             jobjectID obj_id;         /* id assigned to this object */\r
107         } obj_alloc;\r
108 \r
109         struct {\r
110             jobjectID obj_id;         /* id of the object */\r
111         } obj_free;\r
112 \r
113         struct {\r
114             jint arena_id;            /* cur arena id */\r
115             jobjectID obj_id;         /* cur object id */\r
116             jint new_arena_id;        /* new arena id */\r
117             jobjectID new_obj_id;     /* new object id */         \r
118         } obj_move;\r
119 \r
120         struct {\r
121             jint arena_id;            /* id of arena */\r
122             const char *arena_name;   /* name of arena */\r
123         } new_arena;\r
124 \r
125         struct {\r
126             jint arena_id;            /* id of arena */\r
127         } delete_arena;\r
128 \r
129         struct {\r
130             char *thread_name;        /* name of thread */\r
131             char *group_name;         /* name of group */\r
132             char *parent_name;        /* name of parent */\r
133             jobjectID thread_id;      /* id of the thread object */\r
134             JNIEnv *thread_env_id;\r
135         } thread_start;\r
136 \r
137         struct {\r
138             int dump_level;           /* level of the heap dump info */\r
139             char *begin;              /* where all the root records begin,\r
140                                          please see the heap dump buffer \r
141                                          format described below */\r
142             char *end;                /* where the object records end. */\r
143             jint num_traces;          /* number of thread traces, \r
144                                          0 if dump level = JVMPI_DUMP_LEVEL_0 */\r
145             JVMPI_CallTrace *traces;  /* thread traces collected during \r
146                                          heap dump */ \r
147         } heap_dump;\r
148 \r
149         struct {\r
150             jobjectID obj_id;         /* object id */\r
151             jobject ref_id;           /* id assigned to the globalref */\r
152         } jni_globalref_alloc;\r
153       \r
154         struct {\r
155             jobject ref_id;           /* id of the global ref */\r
156         } jni_globalref_free;\r
157 \r
158         struct {\r
159             jmethodID method_id;      /* method */\r
160         } method;\r
161 \r
162         struct {\r
163             jmethodID method_id;      /* id of method */\r
164             jobjectID obj_id;         /* id of target object */\r
165         } method_entry2;\r
166 \r
167         struct {\r
168             jmethodID method_id;        /* id of compiled method */\r
169             void *code_addr;            /* code start addr. in memory */\r
170             jint code_size;             /* code size */\r
171             jint lineno_table_size;     /* size of lineno table */\r
172             JVMPI_Lineno *lineno_table; /* lineno info */\r
173         } compiled_method_load;\r
174         \r
175         struct {\r
176             jmethodID method_id;        /* id of unloaded compiled method */\r
177         } compiled_method_unload;\r
178 \r
179         struct {\r
180             jmethodID method_id; /* id of the method the instruction belongs to */\r
181             jint offset;         /* instruction offset in the method's bytecode */\r
182             union {\r
183                 struct {\r
184                     jboolean is_true; /* whether true or false branch is taken  */\r
185                 } if_info;\r
186                 struct {\r
187                     jint key; /* top stack value used as an index */\r
188                     jint low; /* min value of the index           */\r
189                     jint hi;  /* max value of the index           */\r
190                 } tableswitch_info;\r
191                 struct {\r
192                     jint chosen_pair_index; /* actually chosen pair index (0-based)\r
193                                              * if chosen_pair_index == pairs_total then\r
194                                              * the 'default' branch is taken\r
195                                              */\r
196                     jint pairs_total;       /* total number of lookupswitch pairs */\r
197                 } lookupswitch_info;\r
198             } u;\r
199         } instruction;\r
200         \r
201         struct {\r
202             char *begin;                /* beginning of dump buffer, \r
203                                            see below for format */\r
204             char *end;                  /* end of dump buffer */\r
205             jint num_traces;            /* number of traces */\r
206             JVMPI_CallTrace *traces;    /* traces of all threads */\r
207             jint *threads_status;       /* status of all threads */\r
208         } monitor_dump;\r
209 \r
210         struct {\r
211             const char *name;           /* name of raw monitor */\r
212             JVMPI_RawMonitor id;        /* id */\r
213         } raw_monitor;\r
214 \r
215         struct {\r
216             jobjectID object;           /* Java object */\r
217         } monitor;\r
218 \r
219         struct {\r
220             jobjectID object;           /* Java object */\r
221             jlong timeout;              /* timeout period */\r
222         } monitor_wait;\r
223 \r
224         struct {\r
225             jlong used_objects;\r
226             jlong used_object_space;\r
227             jlong total_object_space;\r
228         } gc_info;\r
229 \r
230         struct {\r
231             jint data_len;\r
232             char *data;\r
233         } object_dump;\r
234     } u;\r
235 } JVMPI_Event;\r
236 \r
237 /* interface functions */\r
238 typedef struct {\r
239     jint version;   /* JVMPI version */\r
240     \r
241     /* ------interface implemented by the profiler------ */\r
242 \r
243     /**\r
244      * Function called by the JVM to notify an event. \r
245      */\r
246     void (*NotifyEvent)(JVMPI_Event *event);\r
247   \r
248     /* ------interface implemented by the JVM------ */\r
249     \r
250     /**\r
251      * Function called by the profiler to enable/disable/send notification \r
252      * for a particular event type.  \r
253      * \r
254      * event_type - event_type\r
255      * arg - event specific arg\r
256      *\r
257      * return JVMPI_NOT_AVAILABLE, JVMPI_SUCCESS or JVMPI_FAIL\r
258      */\r
259     jint (*EnableEvent)(jint event_type, void *arg);\r
260     jint (*DisableEvent)(jint event_type, void *arg);\r
261     jint (*RequestEvent)(jint event_type, void *arg);\r
262   \r
263     /**\r
264      * Function called by the profiler to get a stack\r
265      * trace from the JVM.\r
266      *\r
267      * trace - trace data structure to be filled\r
268      * depth - maximum depth of the trace.\r
269      */\r
270     void (*GetCallTrace)(JVMPI_CallTrace *trace, jint depth);\r
271 \r
272     /**\r
273      * Function called by profiler when it wants to exit/stop.\r
274      */\r
275     void (*ProfilerExit)(jint);\r
276 \r
277     /**\r
278      * Utility functions provided by the JVM.\r
279      */\r
280     JVMPI_RawMonitor (*RawMonitorCreate)(char *lock_name);\r
281     void (*RawMonitorEnter)(JVMPI_RawMonitor lock_id);\r
282     void (*RawMonitorExit)(JVMPI_RawMonitor lock_id);\r
283     void (*RawMonitorWait)(JVMPI_RawMonitor lock_id, jlong ms);\r
284     void (*RawMonitorNotifyAll)(JVMPI_RawMonitor lock_id);\r
285     void (*RawMonitorDestroy)(JVMPI_RawMonitor lock_id);\r
286 \r
287     /**\r
288      * Function called by the profiler to get the current thread's CPU time.\r
289      *\r
290      * return time in nanoseconds;\r
291      */\r
292     jlong (*GetCurrentThreadCpuTime)(void);\r
293 \r
294     void (*SuspendThread)(JNIEnv *env);\r
295     void (*ResumeThread)(JNIEnv *env);\r
296     jint (*GetThreadStatus)(JNIEnv *env);\r
297     jboolean (*ThreadHasRun)(JNIEnv *env);\r
298 \r
299     /* This function can be called safely only after JVMPI_EVENT_VM_INIT_DONE\r
300        notification by the JVM. */\r
301     jint (*CreateSystemThread)(char *name, jint priority, void (*f)(void *));\r
302 \r
303     /* thread local storage access functions to avoid locking in time \r
304        critical functions */\r
305     void (*SetThreadLocalStorage)(JNIEnv *env_id, void *ptr);\r
306     void * (*GetThreadLocalStorage)(JNIEnv *env_id);\r
307 \r
308     /* control GC */\r
309     void (*DisableGC)(void);\r
310     void (*EnableGC)(void);\r
311     void (*RunGC)(void);\r
312 \r
313     jobjectID (*GetThreadObject)(JNIEnv *env);\r
314     jobjectID (*GetMethodClass)(jmethodID mid);\r
315 \r
316     /* JNI <-> jobject conversions */\r
317     jobject   (*jobjectID2jobject)(jobjectID jid);\r
318     jobjectID (*jobject2jobjectID)(jobject jobj);\r
319 \r
320     void (*SuspendThreadList)\r
321       (jint reqCount, JNIEnv **reqList, jint *results);\r
322     void (*ResumeThreadList)\r
323       (jint reqCount, JNIEnv **reqList, jint *results);\r
324 } JVMPI_Interface;\r
325 \r
326 /* type of argument passed to RequestEvent for heap dumps */\r
327 typedef struct {\r
328     jint heap_dump_level;\r
329 } JVMPI_HeapDumpArg;\r
330 \r
331 /**********************************************************************\r
332  * Constants and formats used in JVM Profiler Interface.\r
333  **********************************************************************/\r
334 /*\r
335  * Event type constants.\r
336  */\r
337 #define JVMPI_EVENT_METHOD_ENTRY            ((jint)1) \r
338 #define JVMPI_EVENT_METHOD_ENTRY2           ((jint)2) \r
339 #define JVMPI_EVENT_METHOD_EXIT             ((jint)3) \r
340 \r
341 #define JVMPI_EVENT_OBJECT_ALLOC            ((jint)4) \r
342 #define JVMPI_EVENT_OBJECT_FREE             ((jint)5) \r
343 #define JVMPI_EVENT_OBJECT_MOVE             ((jint)6) \r
344 \r
345 #define JVMPI_EVENT_COMPILED_METHOD_LOAD    ((jint)7) \r
346 #define JVMPI_EVENT_COMPILED_METHOD_UNLOAD  ((jint)8) \r
347 \r
348 #define JVMPI_EVENT_INSTRUCTION_START       ((jint)9) \r
349 \r
350 #define JVMPI_EVENT_THREAD_START           ((jint)33) \r
351 #define JVMPI_EVENT_THREAD_END             ((jint)34) \r
352 \r
353 #define JVMPI_EVENT_CLASS_LOAD_HOOK        ((jint)35) \r
354 \r
355 #define JVMPI_EVENT_HEAP_DUMP                     ((jint)37) \r
356 #define JVMPI_EVENT_JNI_GLOBALREF_ALLOC           ((jint)38) \r
357 #define JVMPI_EVENT_JNI_GLOBALREF_FREE            ((jint)39) \r
358 #define JVMPI_EVENT_JNI_WEAK_GLOBALREF_ALLOC      ((jint)40) \r
359 #define JVMPI_EVENT_JNI_WEAK_GLOBALREF_FREE       ((jint)41) \r
360 #define JVMPI_EVENT_CLASS_LOAD                    ((jint)42) \r
361 #define JVMPI_EVENT_CLASS_UNLOAD                  ((jint)43) \r
362 #define JVMPI_EVENT_DATA_DUMP_REQUEST             ((jint)44) \r
363 #define JVMPI_EVENT_DATA_RESET_REQUEST            ((jint)45) \r
364 \r
365 #define JVMPI_EVENT_JVM_INIT_DONE          ((jint)46) \r
366 #define JVMPI_EVENT_JVM_SHUT_DOWN          ((jint)47) \r
367 \r
368 #define JVMPI_EVENT_ARENA_NEW              ((jint)48)\r
369 #define JVMPI_EVENT_ARENA_DELETE           ((jint)49)\r
370 \r
371 #define JVMPI_EVENT_OBJECT_DUMP            ((jint)50)\r
372 \r
373 #define JVMPI_EVENT_RAW_MONITOR_CONTENDED_ENTER   ((jint)51)\r
374 #define JVMPI_EVENT_RAW_MONITOR_CONTENDED_ENTERED ((jint)52)\r
375 #define JVMPI_EVENT_RAW_MONITOR_CONTENDED_EXIT    ((jint)53)\r
376 #define JVMPI_EVENT_MONITOR_CONTENDED_ENTER       ((jint)54)\r
377 #define JVMPI_EVENT_MONITOR_CONTENDED_ENTERED     ((jint)55)\r
378 #define JVMPI_EVENT_MONITOR_CONTENDED_EXIT        ((jint)56)\r
379 #define JVMPI_EVENT_MONITOR_WAIT                  ((jint)57)\r
380 #define JVMPI_EVENT_MONITOR_WAITED                ((jint)58)\r
381 #define JVMPI_EVENT_MONITOR_DUMP                  ((jint)59)\r
382 \r
383 #define JVMPI_EVENT_GC_START                      ((jint)60)\r
384 #define JVMPI_EVENT_GC_FINISH                     ((jint)61)\r
385 \r
386 #define JVMPI_MAX_EVENT_TYPE_VAL                  ((jint)61)\r
387 \r
388 /* old definitions, to be removed */\r
389 #define JVMPI_EVENT_LOAD_COMPILED_METHOD          ((jint)7) \r
390 #define JVMPI_EVENT_UNLOAD_COMPILED_METHOD        ((jint)8) \r
391 #define JVMPI_EVENT_NEW_ARENA                     ((jint)48)\r
392 #define JVMPI_EVENT_DELETE_ARENA                  ((jint)49)\r
393 #define JVMPI_EVENT_DUMP_DATA_REQUEST             ((jint)44) \r
394 #define JVMPI_EVENT_RESET_DATA_REQUEST            ((jint)45) \r
395 #define JVMPI_EVENT_OBJ_ALLOC                     ((jint)4) \r
396 #define JVMPI_EVENT_OBJ_FREE                      ((jint)5) \r
397 #define JVMPI_EVENT_OBJ_MOVE                      ((jint)6) \r
398 \r
399 #define JVMPI_REQUESTED_EVENT                     ((jint)0x10000000)\r
400 \r
401 \r
402  \r
403 /* \r
404  * enabling/disabling event notification.\r
405  */\r
406 /* results */\r
407 #define JVMPI_SUCCESS                    ((jint)0)\r
408 #define JVMPI_NOT_AVAILABLE              ((jint)1)\r
409 #define JVMPI_FAIL                       ((jint)-1)\r
410 \r
411 /*\r
412  * Thread status\r
413  */\r
414 enum {\r
415     JVMPI_THREAD_RUNNABLE = 1,\r
416     JVMPI_THREAD_MONITOR_WAIT,\r
417     JVMPI_THREAD_CONDVAR_WAIT\r
418 };\r
419 \r
420 #define JVMPI_THREAD_SUSPENDED        0x8000\r
421 #define JVMPI_THREAD_INTERRUPTED      0x4000\r
422 \r
423 /*\r
424  * Thread priority\r
425  */\r
426 #define JVMPI_MINIMUM_PRIORITY      1\r
427 #define JVMPI_MAXIMUM_PRIORITY      10\r
428 #define JVMPI_NORMAL_PRIORITY       5\r
429 \r
430 /*\r
431  * Object type constants.\r
432  */\r
433 #define JVMPI_NORMAL_OBJECT              ((jint)0)\r
434 #define JVMPI_CLASS                      ((jint)2)\r
435 #define JVMPI_BOOLEAN                    ((jint)4)\r
436 #define JVMPI_CHAR                       ((jint)5)\r
437 #define JVMPI_FLOAT                      ((jint)6)\r
438 #define JVMPI_DOUBLE                     ((jint)7)\r
439 #define JVMPI_BYTE                       ((jint)8)\r
440 #define JVMPI_SHORT                      ((jint)9)\r
441 #define JVMPI_INT                        ((jint)10)\r
442 #define JVMPI_LONG                       ((jint)11)    \r
443 \r
444 /*\r
445  * Monitor dump constants.\r
446  */\r
447 \r
448 #define JVMPI_MONITOR_JAVA          0x01\r
449 #define JVMPI_MONITOR_RAW           0x02\r
450 \r
451 /*\r
452  * Heap dump constants.\r
453  */\r
454 #define JVMPI_GC_ROOT_UNKNOWN       0xff\r
455 #define JVMPI_GC_ROOT_JNI_GLOBAL    0x01\r
456 #define JVMPI_GC_ROOT_JNI_LOCAL     0x02\r
457 #define JVMPI_GC_ROOT_JAVA_FRAME    0x03\r
458 #define JVMPI_GC_ROOT_NATIVE_STACK  0x04\r
459 #define JVMPI_GC_ROOT_STICKY_CLASS  0x05\r
460 #define JVMPI_GC_ROOT_THREAD_BLOCK  0x06\r
461 #define JVMPI_GC_ROOT_MONITOR_USED  0x07\r
462 #define JVMPI_GC_ROOT_THREAD_OBJ    0x08\r
463 \r
464 #define JVMPI_GC_CLASS_DUMP         0x20\r
465 #define JVMPI_GC_INSTANCE_DUMP      0x21 \r
466 #define JVMPI_GC_OBJ_ARRAY_DUMP     0x22\r
467 #define JVMPI_GC_PRIM_ARRAY_DUMP    0x23\r
468 \r
469 /*\r
470  * Dump levels\r
471  */\r
472 #define JVMPI_DUMP_LEVEL_0    ((jint)0)\r
473 #define JVMPI_DUMP_LEVEL_1    ((jint)1)\r
474 #define JVMPI_DUMP_LEVEL_2    ((jint)2)\r
475 \r
476 /* Types used in dumps -\r
477  *\r
478  * u1: 1 byte\r
479  * u2: 2 bytes\r
480  * u4: 4 bytes\r
481  * u8: 8 bytes\r
482  *\r
483  * ty: u1 where:\r
484  *     JVMPI_CLASS:   object\r
485  *     JVMPI_BOOLEAN: boolean\r
486  *     JVMPI_CHAR:    char\r
487  *     JVMPI_FLOAT:   float\r
488  *     JVMPI_DOUBLE:  double\r
489  *     JVMPI_BYTE:    byte\r
490  *     JVMPI_SHORT:   short\r
491  *     JVMPI_INT:     int\r
492  *     JVMPI_LONG:    long\r
493  *\r
494  * vl: values, exact type depends on the type of the value:\r
495  *     JVMPI_BOOLEAN & JVMPI_BYTE:   u1\r
496  *     JVMPI_SHORT & JVMPI_CHAR:     u2\r
497  *     JVMPI_INT & JVMPI_FLOAT:      u4\r
498  *     JVMPI_LONG & JVMPI_DOUBLE:    u8\r
499  *     JVMPI_CLASS:                  jobjectID\r
500  */\r
501 \r
502 /* Format of the monitor dump buffer:\r
503  *\r
504  *               u1                          monitor type\r
505  *\r
506  *               JVMPI_MONITOR_JAVA          Java monitor\r
507  *\r
508  *                          jobjectID        object\r
509  *                          JNIEnv *         owner thread\r
510  *                          u4               entry count\r
511  *                          u4               # of threads waiting to enter\r
512  *                          [JNIEnv *]*      threads waiting to enter\r
513  *                          u4               # of threads waiting to be notified\r
514  *                          [JNIEnv *]*      threads waiting to be notified\r
515  *\r
516  *               JVMPI_MONITOR_RAW           raw monitor\r
517  *\r
518  *                          char *           name\r
519  *                          JVMPI_RawMonitor raw monitor\r
520  *                          JNIEnv *         owner thread\r
521  *                          u4               entry count\r
522  *                          u4               # of threads waiting to enter\r
523  *                          [JNIEnv *]*      threads waiting to enter\r
524  *                          u4               # of threads waiting to be notified\r
525  *                          [JNIEnv *]*      threads waiting to be notified\r
526  */\r
527 \r
528 /* Format of the heap dump buffer depends on the dump level \r
529  * specified in the JVMPI_HeapDumpArg passed to RequestEvent as arg. \r
530  * The default is JVMPI_DUMP_LEVEL_2.\r
531  *\r
532  * JVMPI_DUMP_LEVEL_0:\r
533  * \r
534  *               u1                          object type (JVMPI_CLASS ...)\r
535  *               jobjectID                   object\r
536  *\r
537  * JVMPI_DUMP_LEVEL_1 and JVMPI_DUMP_LEVEL_2 use the following format:  \r
538  * In the case of JVMPI_DUMP_LEVEL_1 the values of primitive fields in object \r
539  * instance dumps , the values of primitive statics in class dumps and the \r
540  * values of primitive arrays are excluded.  JVMPI_DUMP_LEVEL_2 includes the\r
541  * primitive values.\r
542  *\r
543  *               u1                          record type\r
544  *\r
545  *               JVMPI_GC_ROOT_UNKNOWN       unknown root\r
546  *\r
547  *                          jobjectID        object\r
548  *\r
549  *               JVMPI_GC_ROOT_JNI_GLOBAL    JNI global ref root\r
550  *\r
551  *                          jobjectID        object\r
552  *                          jobject          JNI global reference\r
553  *\r
554  *               JVMPI_GC_ROOT_JNI_LOCAL     JNI local ref\r
555  *\r
556  *                          jobjectID        object\r
557  *                          JNIEnv *         thread\r
558  *                          u4               frame # in stack trace (-1 for empty)\r
559  *\r
560  *               JVMPI_GC_ROOT_JAVA_FRAME    Java stack frame\r
561  *\r
562  *                          jobjectID        object\r
563  *                          JNIEnv *         thread\r
564  *                          u4               frame # in stack trace (-1 for empty)\r
565  *\r
566  *               JVMPI_GC_ROOT_NATIVE_STACK  Native stack\r
567  *\r
568  *                          jobjectID        object\r
569  *                          JNIEnv *         thread\r
570  *\r
571  *               JVMPI_GC_ROOT_STICKY_CLASS  System class\r
572  *\r
573  *                          jobjectID        class object\r
574  *\r
575  *               JVMPI_GC_ROOT_THREAD_BLOCK  Reference from thread block\r
576  *\r
577  *                          jobjectID        thread object\r
578  *                          JNIEnv *         thread\r
579  *\r
580  *               JVMPI_GC_ROOT_MONITOR_USED  Busy monitor\r
581  *\r
582  *                          jobjectID        object\r
583  *\r
584  *               JVMPI_GC_CLASS_DUMP         dump of a class object\r
585  *\r
586  *                          jobjectID        class\r
587  *                          jobjectID        super\r
588  *                          jobjectID        class loader\r
589  *                          jobjectID        signers\r
590  *                          jobjectID        protection domain\r
591  *                          jobjectID        class name\r
592  *                          void *           reserved\r
593  *\r
594  *                          u4               instance size (in bytes)\r
595  *\r
596  *                          [jobjectID]*     interfaces\r
597  *\r
598  *                          u2               size of constant pool\r
599  *                          [u2,             constant pool index,\r
600  *                           ty,             type, \r
601  *                           vl]*            value\r
602  *\r
603  *                          [vl]*            static field values\r
604  *\r
605  *               JVMPI_GC_INSTANCE_DUMP      dump of a normal object\r
606  *\r
607  *                          jobjectID        object\r
608  *                          jobjectID        class\r
609  *                          u4               number of bytes that follow\r
610  *                          [vl]*            instance field values (class, followed\r
611  *                                           by super, super's super ...)\r
612  *\r
613  *               JVMPI_GC_OBJ_ARRAY_DUMP     dump of an object array\r
614  *\r
615  *                          jobjectID        array object\r
616  *                          u4               number of elements\r
617  *                          jobjectID        element class\r
618  *                          [jobjectID]*     elements\r
619  *\r
620  *               JVMPI_GC_PRIM_ARRAY_DUMP    dump of a primitive array\r
621  *\r
622  *                          jobjectID        array object\r
623  *                          u4               number of elements\r
624  *                          ty               element type\r
625  *                          [vl]*            elements\r
626  *\r
627  */\r
628 \r
629 /* Format of the dump received in JVMPI_EVENT_OBJECT_DUMP:\r
630  * All the records have JVMPI_DUMP_LEVEL_2 information.\r
631  *\r
632  *               u1                          record type\r
633  *\r
634  *                     followed by a:\r
635  *\r
636  *                          JVMPI_GC_CLASS_DUMP,\r
637  *                          JVMPI_GC_INSTANCE_DUMP,\r
638  *                          JVMPI_GC_OBJ_ARRAY_DUMP, or\r
639  *                          JVMPI_GC_PRIM_ARRAY_DUMP record.\r
640  */\r
641 \r
642 #endif /* !_JAVASOFT_JVMPI_H_ */\r