Print this page
OS-1723 DTrace should speak JSON
Reviewed by: Bryan Cantrill <bmc@joyent.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 ↓ 103 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_10    DT_VERSION_NUMBER(1, 10, 0)
 114      -#define DT_VERS_LATEST  DT_VERS_1_10
 115      -#define DT_VERS_STRING  "Sun D 1.10"
      114 +#define DT_VERS_1_11    DT_VERSION_NUMBER(1, 11, 0)
      115 +#define DT_VERS_LATEST  DT_VERS_1_11
      116 +#define DT_VERS_STRING  "Sun D 1.11"
 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_10,   /* D API 1.10 */
      138 +        DT_VERS_1_11,   /* D API 1.11 */
 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 ↓ 109 lines elided ↑ open up ↑
 256  258  { "index", DT_IDENT_FUNC, 0, DIF_SUBR_INDEX, DT_ATTR_STABCMN, DT_VERS_1_1,
 257  259          &dt_idops_func, "int(const char *, const char *, [int])" },
 258  260  { "inet_ntoa", DT_IDENT_FUNC, 0, DIF_SUBR_INET_NTOA, DT_ATTR_STABCMN,
 259  261          DT_VERS_1_5, &dt_idops_func, "string(ipaddr_t *)" },
 260  262  { "inet_ntoa6", DT_IDENT_FUNC, 0, DIF_SUBR_INET_NTOA6, DT_ATTR_STABCMN,
 261  263          DT_VERS_1_5, &dt_idops_func, "string(in6_addr_t *)" },
 262  264  { "inet_ntop", DT_IDENT_FUNC, 0, DIF_SUBR_INET_NTOP, DT_ATTR_STABCMN,
 263  265          DT_VERS_1_5, &dt_idops_func, "string(int, void *)" },
 264  266  { "ipl", DT_IDENT_SCALAR, 0, DIF_VAR_IPL, DT_ATTR_STABCMN, DT_VERS_1_0,
 265  267          &dt_idops_type, "uint_t" },
      268 +{ "json", DT_IDENT_FUNC, 0, DIF_SUBR_JSON, DT_ATTR_STABCMN, DT_VERS_1_11,
      269 +        &dt_idops_func, "string(const char *, const char *)" },
 266  270  { "jstack", DT_IDENT_ACTFUNC, 0, DT_ACT_JSTACK, DT_ATTR_STABCMN, DT_VERS_1_0,
 267  271          &dt_idops_func, "stack(...)" },
 268  272  { "lltostr", DT_IDENT_FUNC, 0, DIF_SUBR_LLTOSTR, DT_ATTR_STABCMN, DT_VERS_1_0,
 269  273          &dt_idops_func, "string(int64_t, [int])" },
 270  274  { "llquantize", DT_IDENT_AGGFUNC, 0, DTRACEAGG_LLQUANTIZE, DT_ATTR_STABCMN,
 271  275          DT_VERS_1_7, &dt_idops_func,
 272  276          "void(@, int32_t, int32_t, int32_t, int32_t, ...)" },
 273  277  { "lquantize", DT_IDENT_AGGFUNC, 0, DTRACEAGG_LQUANTIZE,
 274  278          DT_ATTR_STABCMN, DT_VERS_1_0,
 275  279          &dt_idops_func, "void(@, int32_t, int32_t, ...)" },
↓ open down ↓ 94 lines elided ↑ open up ↑
 370  374  { "strlen", DT_IDENT_FUNC, 0, DIF_SUBR_STRLEN, DT_ATTR_STABCMN, DT_VERS_1_0,
 371  375          &dt_idops_func, "size_t(const char *)" },
 372  376  { "strjoin", DT_IDENT_FUNC, 0, DIF_SUBR_STRJOIN, DT_ATTR_STABCMN, DT_VERS_1_0,
 373  377          &dt_idops_func, "string(const char *, const char *)" },
 374  378  { "strrchr", DT_IDENT_FUNC, 0, DIF_SUBR_STRRCHR, DT_ATTR_STABCMN, DT_VERS_1_1,
 375  379          &dt_idops_func, "string(const char *, char)" },
 376  380  { "strstr", DT_IDENT_FUNC, 0, DIF_SUBR_STRSTR, DT_ATTR_STABCMN, DT_VERS_1_1,
 377  381          &dt_idops_func, "string(const char *, const char *)" },
 378  382  { "strtok", DT_IDENT_FUNC, 0, DIF_SUBR_STRTOK, DT_ATTR_STABCMN, DT_VERS_1_1,
 379  383          &dt_idops_func, "string(const char *, const char *)" },
      384 +{ "strtoll", DT_IDENT_FUNC, 0, DIF_SUBR_STRTOLL, DT_ATTR_STABCMN, DT_VERS_1_11,
      385 +        &dt_idops_func, "int64_t(const char *, [int])" },
 380  386  { "substr", DT_IDENT_FUNC, 0, DIF_SUBR_SUBSTR, DT_ATTR_STABCMN, DT_VERS_1_1,
 381  387          &dt_idops_func, "string(const char *, int, [int])" },
 382  388  { "sum", DT_IDENT_AGGFUNC, 0, DTRACEAGG_SUM, DT_ATTR_STABCMN, DT_VERS_1_0,
 383  389          &dt_idops_func, "void(@)" },
 384  390  { "sym", DT_IDENT_ACTFUNC, 0, DT_ACT_SYM, DT_ATTR_STABCMN,
 385  391          DT_VERS_1_2, &dt_idops_func, "_symaddr(uintptr_t)" },
 386  392  { "system", DT_IDENT_ACTFUNC, 0, DT_ACT_SYSTEM, DT_ATTR_STABCMN, DT_VERS_1_0,
 387  393          &dt_idops_func, "void(@, ...)" },
 388  394  { "this", DT_IDENT_PTR, 0, 0, DT_ATTR_STABCMN, DT_VERS_1_0,
 389  395          &dt_idops_type, "void" },
↓ open down ↓ 1024 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX