Print this page
2915 DTrace in a zone should see "cpu", "curpsinfo", et al
2916 DTrace in a zone should be able to access fds[]
2917 DTrace in a zone should have limited provider access
Reviewed by: Joshua M. Clulow <josh@sysmgr.org>
Reviewed by: Adam Leventhal <ahl@delphix.com>


   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 2004 Sun Microsystems, Inc.  All rights reserved.
  24  * Use is subject to license terms.
  25  */
  26 




  27 #ifndef _SYS_SDT_IMPL_H
  28 #define _SYS_SDT_IMPL_H
  29 
  30 #pragma ident   "%Z%%M% %I%     %E% SMI"
  31 
  32 #ifdef  __cplusplus
  33 extern "C" {
  34 #endif
  35 
  36 #include <sys/dtrace.h>
  37 
  38 #if defined(__i386) || defined(__amd64)
  39 typedef uint8_t sdt_instr_t;
  40 #else
  41 typedef uint32_t sdt_instr_t;
  42 #endif
  43 
  44 typedef struct sdt_provider {
  45         char                    *sdtp_name;     /* name of provider */
  46         char                    *sdtp_prefix;   /* prefix for probe names */
  47         dtrace_pattr_t          *sdtp_attr;     /* stability attributes */

  48         dtrace_provider_id_t    sdtp_id;        /* provider ID */
  49 } sdt_provider_t;
  50 
  51 extern sdt_provider_t sdt_providers[];          /* array of providers */
  52 
  53 typedef struct sdt_probe {
  54         sdt_provider_t  *sdp_provider;          /* provider */
  55         char            *sdp_name;              /* name of probe */
  56         int             sdp_namelen;            /* length of allocated name */
  57         dtrace_id_t     sdp_id;                 /* probe ID */
  58         struct modctl   *sdp_ctl;               /* modctl for module */
  59         int             sdp_loadcnt;            /* load count for module */
  60         int             sdp_primary;            /* non-zero if primary mod */
  61         sdt_instr_t     *sdp_patchpoint;        /* patch point */
  62         sdt_instr_t     sdp_patchval;           /* instruction to patch */
  63         sdt_instr_t     sdp_savedval;           /* saved instruction value */
  64         struct sdt_probe *sdp_next;             /* next probe */
  65         struct sdt_probe *sdp_hashnext;         /* next on hash */
  66 } sdt_probe_t;
  67 
  68 typedef struct sdt_argdesc {
  69         const char *sda_provider;               /* provider for arg */
  70         const char *sda_name;                   /* name of probe */
  71         const int sda_ndx;                      /* argument index */
  72         const int sda_mapping;                  /* mapping of argument */
  73         const char *sda_native;                 /* native type of argument */
  74         const char *sda_xlate;                  /* translated type of arg */
  75 } sdt_argdesc_t;
  76 
  77 extern void sdt_getargdesc(void *, dtrace_id_t, void *, dtrace_argdesc_t *);

  78 
  79 #ifdef  __cplusplus
  80 }
  81 #endif
  82 
  83 #endif  /* _SYS_SDT_IMPL_H */


   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 2004 Sun Microsystems, Inc.  All rights reserved.
  24  * Use is subject to license terms.
  25  */
  26 
  27 /*
  28  * Copyright (c) 2012, Joyent, Inc. All rights reserved.
  29  */
  30 
  31 #ifndef _SYS_SDT_IMPL_H
  32 #define _SYS_SDT_IMPL_H
  33 


  34 #ifdef  __cplusplus
  35 extern "C" {
  36 #endif
  37 
  38 #include <sys/dtrace.h>
  39 
  40 #if defined(__i386) || defined(__amd64)
  41 typedef uint8_t sdt_instr_t;
  42 #else
  43 typedef uint32_t sdt_instr_t;
  44 #endif
  45 
  46 typedef struct sdt_provider {
  47         char                    *sdtp_name;     /* name of provider */
  48         char                    *sdtp_prefix;   /* prefix for probe names */
  49         dtrace_pattr_t          *sdtp_attr;     /* stability attributes */
  50         uint32_t                sdtp_priv;      /* privilege, if any */
  51         dtrace_provider_id_t    sdtp_id;        /* provider ID */
  52 } sdt_provider_t;
  53 
  54 extern sdt_provider_t sdt_providers[];          /* array of providers */
  55 
  56 typedef struct sdt_probe {
  57         sdt_provider_t  *sdp_provider;          /* provider */
  58         char            *sdp_name;              /* name of probe */
  59         int             sdp_namelen;            /* length of allocated name */
  60         dtrace_id_t     sdp_id;                 /* probe ID */
  61         struct modctl   *sdp_ctl;               /* modctl for module */
  62         int             sdp_loadcnt;            /* load count for module */
  63         int             sdp_primary;            /* non-zero if primary mod */
  64         sdt_instr_t     *sdp_patchpoint;        /* patch point */
  65         sdt_instr_t     sdp_patchval;           /* instruction to patch */
  66         sdt_instr_t     sdp_savedval;           /* saved instruction value */
  67         struct sdt_probe *sdp_next;             /* next probe */
  68         struct sdt_probe *sdp_hashnext;         /* next on hash */
  69 } sdt_probe_t;
  70 
  71 typedef struct sdt_argdesc {
  72         const char *sda_provider;               /* provider for arg */
  73         const char *sda_name;                   /* name of probe */
  74         const int sda_ndx;                      /* argument index */
  75         const int sda_mapping;                  /* mapping of argument */
  76         const char *sda_native;                 /* native type of argument */
  77         const char *sda_xlate;                  /* translated type of arg */
  78 } sdt_argdesc_t;
  79 
  80 extern void sdt_getargdesc(void *, dtrace_id_t, void *, dtrace_argdesc_t *);
  81 extern int sdt_mode(void *, dtrace_id_t, void *);
  82 
  83 #ifdef  __cplusplus
  84 }
  85 #endif
  86 
  87 #endif  /* _SYS_SDT_IMPL_H */