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>

Split Close
Expand all
Collapse all
          --- old/usr/src/lib/libdtrace/common/dt_open.c
          +++ new/usr/src/lib/libdtrace/common/dt_open.c
↓ open down ↓ 13 lines elided ↑ open up ↑
  14   14   * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15   15   * If applicable, add the following below this CDDL HEADER, with the
  16   16   * fields enclosed by brackets "[]" replaced with your own identifying
  17   17   * information: Portions Copyright [yyyy] [name of copyright owner]
  18   18   *
  19   19   * CDDL HEADER END
  20   20   */
  21   21  
  22   22  /*
  23   23   * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  24      - * Copyright (c) 2011, Joyent, Inc. All rights reserved.
       24 + * Copyright (c) 2012, Joyent, Inc. All rights reserved.
  25   25   * Copyright (c) 2012 by Delphix. All rights reserved.
  26   26   */
  27   27  
  28   28  #include <sys/types.h>
  29   29  #include <sys/modctl.h>
  30   30  #include <sys/systeminfo.h>
  31   31  #include <sys/resource.h>
  32   32  
  33   33  #include <libelf.h>
  34   34  #include <strings.h>
↓ open down ↓ 69 lines elided ↑ open up ↑
 104  104  #define DT_VERS_1_6     DT_VERSION_NUMBER(1, 6, 0)
 105  105  #define DT_VERS_1_6_1   DT_VERSION_NUMBER(1, 6, 1)
 106  106  #define DT_VERS_1_6_2   DT_VERSION_NUMBER(1, 6, 2)
 107  107  #define DT_VERS_1_6_3   DT_VERSION_NUMBER(1, 6, 3)
 108  108  #define DT_VERS_1_7     DT_VERSION_NUMBER(1, 7, 0)
 109  109  #define DT_VERS_1_7_1   DT_VERSION_NUMBER(1, 7, 1)
 110  110  #define DT_VERS_1_8     DT_VERSION_NUMBER(1, 8, 0)
 111  111  #define DT_VERS_1_8_1   DT_VERSION_NUMBER(1, 8, 1)
 112  112  #define DT_VERS_1_9     DT_VERSION_NUMBER(1, 9, 0)
 113  113  #define DT_VERS_1_9_1   DT_VERSION_NUMBER(1, 9, 1)
 114      -#define DT_VERS_LATEST  DT_VERS_1_9_1
 115      -#define DT_VERS_STRING  "Sun D 1.9.1"
      114 +#define DT_VERS_1_10    DT_VERSION_NUMBER(1, 10, 0)
      115 +#define DT_VERS_LATEST  DT_VERS_1_10
      116 +#define DT_VERS_STRING  "Sun D 1.10"
 116  117  
 117  118  const dt_version_t _dtrace_versions[] = {
 118  119          DT_VERS_1_0,    /* D API 1.0.0 (PSARC 2001/466) Solaris 10 FCS */
 119  120          DT_VERS_1_1,    /* D API 1.1.0 Solaris Express 6/05 */
 120  121          DT_VERS_1_2,    /* D API 1.2.0 Solaris 10 Update 1 */
 121  122          DT_VERS_1_2_1,  /* D API 1.2.1 Solaris Express 4/06 */
 122  123          DT_VERS_1_2_2,  /* D API 1.2.2 Solaris Express 6/06 */
 123  124          DT_VERS_1_3,    /* D API 1.3 Solaris Express 10/06 */
 124  125          DT_VERS_1_4,    /* D API 1.4 Solaris Express 2/07 */
 125  126          DT_VERS_1_4_1,  /* D API 1.4.1 Solaris Express 4/07 */
↓ open down ↓ 1 lines elided ↑ open up ↑
 127  128          DT_VERS_1_6,    /* D API 1.6 */
 128  129          DT_VERS_1_6_1,  /* D API 1.6.1 */
 129  130          DT_VERS_1_6_2,  /* D API 1.6.2 */
 130  131          DT_VERS_1_6_3,  /* D API 1.6.3 */
 131  132          DT_VERS_1_7,    /* D API 1.7 */
 132  133          DT_VERS_1_7_1,  /* D API 1.7.1 */
 133  134          DT_VERS_1_8,    /* D API 1.8 */
 134  135          DT_VERS_1_8_1,  /* D API 1.8.1 */
 135  136          DT_VERS_1_9,    /* D API 1.9 */
 136  137          DT_VERS_1_9_1,  /* D API 1.9.1 */
      138 +        DT_VERS_1_10,   /* D API 1.10 */
 137  139          0
 138  140  };
 139  141  
 140  142  /*
 141  143   * Table of global identifiers.  This is used to populate the global identifier
 142  144   * hash when a new dtrace client open occurs.  For more info see dt_ident.h.
 143  145   * The global identifiers that represent functions use the dt_idops_func ops
 144  146   * and specify the private data pointer as a prototype string which is parsed
 145  147   * when the identifier is first encountered.  These prototypes look like ANSI
 146  148   * C function prototypes except that the special symbol "@" can be used as a
↓ open down ↓ 93 lines elided ↑ open up ↑
 240  242          &dt_idops_func, "genunix`major_t(genunix`dev_t)" },
 241  243  { "getminor", DT_IDENT_FUNC, 0, DIF_SUBR_GETMINOR,
 242  244          DT_ATTR_EVOLCMN, DT_VERS_1_0,
 243  245          &dt_idops_func, "genunix`minor_t(genunix`dev_t)" },
 244  246  { "htonl", DT_IDENT_FUNC, 0, DIF_SUBR_HTONL, DT_ATTR_EVOLCMN, DT_VERS_1_3,
 245  247          &dt_idops_func, "uint32_t(uint32_t)" },
 246  248  { "htonll", DT_IDENT_FUNC, 0, DIF_SUBR_HTONLL, DT_ATTR_EVOLCMN, DT_VERS_1_3,
 247  249          &dt_idops_func, "uint64_t(uint64_t)" },
 248  250  { "htons", DT_IDENT_FUNC, 0, DIF_SUBR_HTONS, DT_ATTR_EVOLCMN, DT_VERS_1_3,
 249  251          &dt_idops_func, "uint16_t(uint16_t)" },
      252 +{ "getf", DT_IDENT_FUNC, 0, DIF_SUBR_GETF, DT_ATTR_STABCMN, DT_VERS_1_10,
      253 +        &dt_idops_func, "file_t *(int)" },
 250  254  { "gid", DT_IDENT_SCALAR, 0, DIF_VAR_GID, DT_ATTR_STABCMN, DT_VERS_1_0,
 251  255          &dt_idops_type, "gid_t" },
 252  256  { "id", DT_IDENT_SCALAR, 0, DIF_VAR_ID, DT_ATTR_STABCMN, DT_VERS_1_0,
 253  257          &dt_idops_type, "uint_t" },
 254  258  { "index", DT_IDENT_FUNC, 0, DIF_SUBR_INDEX, DT_ATTR_STABCMN, DT_VERS_1_1,
 255  259          &dt_idops_func, "int(const char *, const char *, [int])" },
 256  260  { "inet_ntoa", DT_IDENT_FUNC, 0, DIF_SUBR_INET_NTOA, DT_ATTR_STABCMN,
 257  261          DT_VERS_1_5, &dt_idops_func, "string(ipaddr_t *)" },
 258  262  { "inet_ntoa6", DT_IDENT_FUNC, 0, DIF_SUBR_INET_NTOA6, DT_ATTR_STABCMN,
 259  263          DT_VERS_1_5, &dt_idops_func, "string(in6_addr_t *)" },
↓ open down ↓ 1152 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX