home *** CD-ROM | disk | FTP | other *** search
/ Programming Languages Suite / JBuilder8.iso / Solaris / resource / jre / include / jvmpi.h < prev   
C/C++ Source or Header  |  2002-09-05  |  22KB  |  638 lines

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