Print this page
4474 DTrace Userland CTF Support
4475 DTrace userland Keyword
4476 DTrace tests should be better citizens
4479 pid provider types
4480 dof emulation missing checks
Reviewed by: Bryan Cantrill <bryan@joyent.com>


   6  * (the "License").  You may not use this file except in compliance
   7  * with the License.
   8  *
   9  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
  10  * or http://www.opensolaris.org/os/licensing.
  11  * See the License for the specific language governing permissions
  12  * and limitations under the License.
  13  *
  14  * When distributing Covered Code, include this CDDL HEADER in each
  15  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  16  * If applicable, add the following below this CDDL HEADER, with the
  17  * fields enclosed by brackets "[]" replaced with your own identifying
  18  * information: Portions Copyright [yyyy] [name of copyright owner]
  19  *
  20  * CDDL HEADER END
  21  */
  22 /*
  23  * Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
  24  * Use is subject to license terms.
  25  */




  26 
  27 #ifndef _DT_DECL_H
  28 #define _DT_DECL_H
  29 
  30 #pragma ident   "%Z%%M% %I%     %E% SMI"
  31 
  32 #include <sys/types.h>
  33 #include <libctf.h>
  34 #include <dtrace.h>
  35 #include <stdio.h>
  36 
  37 #ifdef  __cplusplus
  38 extern "C" {
  39 #endif
  40 
  41 struct dt_node;                         /* forward declaration of dt_node_t */
  42 
  43 typedef struct dt_decl {
  44         ushort_t dd_kind;               /* declaration kind (CTF_K_* kind) */
  45         ushort_t dd_attr;               /* attributes (DT_DA_* flags) */
  46         ctf_file_t *dd_ctfp;            /* CTF container for decl's type */
  47         ctf_id_t dd_type;               /* CTF identifier for decl's type */
  48         char *dd_name;                  /* string name of this decl (or NULL) */
  49         struct dt_node *dd_node;        /* node for array size or parm list */
  50         struct dt_decl *dd_next;        /* next declaration in list */
  51 } dt_decl_t;
  52 
  53 #define DT_DA_SIGNED    0x0001          /* signed integer value */
  54 #define DT_DA_UNSIGNED  0x0002          /* unsigned integer value */
  55 #define DT_DA_SHORT     0x0004          /* short integer value */
  56 #define DT_DA_LONG      0x0008          /* long integer or double */
  57 #define DT_DA_LONGLONG  0x0010          /* long long integer value */
  58 #define DT_DA_CONST     0x0020          /* qualify type as const */
  59 #define DT_DA_RESTRICT  0x0040          /* qualify type as restrict */
  60 #define DT_DA_VOLATILE  0x0080          /* qualify type as volatile */
  61 #define DT_DA_PAREN     0x0100          /* parenthesis tag */

  62 
  63 typedef enum dt_dclass {
  64         DT_DC_DEFAULT,                  /* no storage class specified */
  65         DT_DC_AUTO,                     /* automatic storage */
  66         DT_DC_REGISTER,                 /* register storage */
  67         DT_DC_STATIC,                   /* static storage */
  68         DT_DC_EXTERN,                   /* extern storage */
  69         DT_DC_TYPEDEF,                  /* type definition */
  70         DT_DC_SELF,                     /* thread-local storage */
  71         DT_DC_THIS                      /* clause-local storage */
  72 } dt_dclass_t;
  73 
  74 typedef struct dt_scope {
  75         dt_decl_t *ds_decl;             /* pointer to top of decl stack */
  76         struct dt_scope *ds_next;       /* pointer to next scope */
  77         char *ds_ident;                 /* identifier for this scope (if any) */
  78         ctf_file_t *ds_ctfp;            /* CTF container for this scope */
  79         ctf_id_t ds_type;               /* CTF id of enclosing type */
  80         dt_dclass_t ds_class;           /* declaration class for this scope */
  81         int ds_enumval;                 /* most recent enumerator value */




   6  * (the "License").  You may not use this file except in compliance
   7  * with the License.
   8  *
   9  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
  10  * or http://www.opensolaris.org/os/licensing.
  11  * See the License for the specific language governing permissions
  12  * and limitations under the License.
  13  *
  14  * When distributing Covered Code, include this CDDL HEADER in each
  15  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  16  * If applicable, add the following below this CDDL HEADER, with the
  17  * fields enclosed by brackets "[]" replaced with your own identifying
  18  * information: Portions Copyright [yyyy] [name of copyright owner]
  19  *
  20  * CDDL HEADER END
  21  */
  22 /*
  23  * Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
  24  * Use is subject to license terms.
  25  */
  26 /*
  27  * Copyright (c) 2013 by Delphix. All rights reserved.
  28  * Copyright (c) 2013 Joyent, Inc. All rights reserved.
  29  */
  30 
  31 #ifndef _DT_DECL_H
  32 #define _DT_DECL_H
  33 


  34 #include <sys/types.h>
  35 #include <libctf.h>
  36 #include <dtrace.h>
  37 #include <stdio.h>
  38 
  39 #ifdef  __cplusplus
  40 extern "C" {
  41 #endif
  42 
  43 struct dt_node;                         /* forward declaration of dt_node_t */
  44 
  45 typedef struct dt_decl {
  46         ushort_t dd_kind;               /* declaration kind (CTF_K_* kind) */
  47         ushort_t dd_attr;               /* attributes (DT_DA_* flags) */
  48         ctf_file_t *dd_ctfp;            /* CTF container for decl's type */
  49         ctf_id_t dd_type;               /* CTF identifier for decl's type */
  50         char *dd_name;                  /* string name of this decl (or NULL) */
  51         struct dt_node *dd_node;        /* node for array size or parm list */
  52         struct dt_decl *dd_next;        /* next declaration in list */
  53 } dt_decl_t;
  54 
  55 #define DT_DA_SIGNED    0x0001          /* signed integer value */
  56 #define DT_DA_UNSIGNED  0x0002          /* unsigned integer value */
  57 #define DT_DA_SHORT     0x0004          /* short integer value */
  58 #define DT_DA_LONG      0x0008          /* long integer or double */
  59 #define DT_DA_LONGLONG  0x0010          /* long long integer value */
  60 #define DT_DA_CONST     0x0020          /* qualify type as const */
  61 #define DT_DA_RESTRICT  0x0040          /* qualify type as restrict */
  62 #define DT_DA_VOLATILE  0x0080          /* qualify type as volatile */
  63 #define DT_DA_PAREN     0x0100          /* parenthesis tag */
  64 #define DT_DA_USER      0x0200          /* user-land type specifier */
  65 
  66 typedef enum dt_dclass {
  67         DT_DC_DEFAULT,                  /* no storage class specified */
  68         DT_DC_AUTO,                     /* automatic storage */
  69         DT_DC_REGISTER,                 /* register storage */
  70         DT_DC_STATIC,                   /* static storage */
  71         DT_DC_EXTERN,                   /* extern storage */
  72         DT_DC_TYPEDEF,                  /* type definition */
  73         DT_DC_SELF,                     /* thread-local storage */
  74         DT_DC_THIS                      /* clause-local storage */
  75 } dt_dclass_t;
  76 
  77 typedef struct dt_scope {
  78         dt_decl_t *ds_decl;             /* pointer to top of decl stack */
  79         struct dt_scope *ds_next;       /* pointer to next scope */
  80         char *ds_ident;                 /* identifier for this scope (if any) */
  81         ctf_file_t *ds_ctfp;            /* CTF container for this scope */
  82         ctf_id_t ds_type;               /* CTF id of enclosing type */
  83         dt_dclass_t ds_class;           /* declaration class for this scope */
  84         int ds_enumval;                 /* most recent enumerator value */