Print this page
4477 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 ↓ 104 lines elided ↑ open up ↑
 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  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"
      115 +#define DT_VERS_1_11    DT_VERSION_NUMBER(1, 11, 0)
      116 +#define DT_VERS_LATEST  DT_VERS_1_11
      117 +#define DT_VERS_STRING  "Sun D 1.11"
 117  118  
 118  119  const dt_version_t _dtrace_versions[] = {
 119  120          DT_VERS_1_0,    /* D API 1.0.0 (PSARC 2001/466) Solaris 10 FCS */
 120  121          DT_VERS_1_1,    /* D API 1.1.0 Solaris Express 6/05 */
 121  122          DT_VERS_1_2,    /* D API 1.2.0 Solaris 10 Update 1 */
 122  123          DT_VERS_1_2_1,  /* D API 1.2.1 Solaris Express 4/06 */
 123  124          DT_VERS_1_2_2,  /* D API 1.2.2 Solaris Express 6/06 */
 124  125          DT_VERS_1_3,    /* D API 1.3 Solaris Express 10/06 */
 125  126          DT_VERS_1_4,    /* D API 1.4 Solaris Express 2/07 */
 126  127          DT_VERS_1_4_1,  /* D API 1.4.1 Solaris Express 4/07 */
↓ open down ↓ 2 lines elided ↑ open up ↑
 129  130          DT_VERS_1_6_1,  /* D API 1.6.1 */
 130  131          DT_VERS_1_6_2,  /* D API 1.6.2 */
 131  132          DT_VERS_1_6_3,  /* D API 1.6.3 */
 132  133          DT_VERS_1_7,    /* D API 1.7 */
 133  134          DT_VERS_1_7_1,  /* D API 1.7.1 */
 134  135          DT_VERS_1_8,    /* D API 1.8 */
 135  136          DT_VERS_1_8_1,  /* D API 1.8.1 */
 136  137          DT_VERS_1_9,    /* D API 1.9 */
 137  138          DT_VERS_1_9_1,  /* D API 1.9.1 */
 138  139          DT_VERS_1_10,   /* D API 1.10 */
      140 +        DT_VERS_1_11,   /* D API 1.11 */
 139  141          0
 140  142  };
 141  143  
 142  144  /*
 143  145   * Table of global identifiers.  This is used to populate the global identifier
 144  146   * hash when a new dtrace client open occurs.  For more info see dt_ident.h.
 145  147   * The global identifiers that represent functions use the dt_idops_func ops
 146  148   * and specify the private data pointer as a prototype string which is parsed
 147  149   * when the identifier is first encountered.  These prototypes look like ANSI
 148  150   * C function prototypes except that the special symbol "@" can be used as a
↓ open down ↓ 109 lines elided ↑ open up ↑
 258  260  { "index", DT_IDENT_FUNC, 0, DIF_SUBR_INDEX, DT_ATTR_STABCMN, DT_VERS_1_1,
 259  261          &dt_idops_func, "int(const char *, const char *, [int])" },
 260  262  { "inet_ntoa", DT_IDENT_FUNC, 0, DIF_SUBR_INET_NTOA, DT_ATTR_STABCMN,
 261  263          DT_VERS_1_5, &dt_idops_func, "string(ipaddr_t *)" },
 262  264  { "inet_ntoa6", DT_IDENT_FUNC, 0, DIF_SUBR_INET_NTOA6, DT_ATTR_STABCMN,
 263  265          DT_VERS_1_5, &dt_idops_func, "string(in6_addr_t *)" },
 264  266  { "inet_ntop", DT_IDENT_FUNC, 0, DIF_SUBR_INET_NTOP, DT_ATTR_STABCMN,
 265  267          DT_VERS_1_5, &dt_idops_func, "string(int, void *)" },
 266  268  { "ipl", DT_IDENT_SCALAR, 0, DIF_VAR_IPL, DT_ATTR_STABCMN, DT_VERS_1_0,
 267  269          &dt_idops_type, "uint_t" },
      270 +{ "json", DT_IDENT_FUNC, 0, DIF_SUBR_JSON, DT_ATTR_STABCMN, DT_VERS_1_11,
      271 +        &dt_idops_func, "string(const char *, const char *)" },
 268  272  { "jstack", DT_IDENT_ACTFUNC, 0, DT_ACT_JSTACK, DT_ATTR_STABCMN, DT_VERS_1_0,
 269  273          &dt_idops_func, "stack(...)" },
 270  274  { "lltostr", DT_IDENT_FUNC, 0, DIF_SUBR_LLTOSTR, DT_ATTR_STABCMN, DT_VERS_1_0,
 271  275          &dt_idops_func, "string(int64_t, [int])" },
 272  276  { "llquantize", DT_IDENT_AGGFUNC, 0, DTRACEAGG_LLQUANTIZE, DT_ATTR_STABCMN,
 273  277          DT_VERS_1_7, &dt_idops_func,
 274  278          "void(@, int32_t, int32_t, int32_t, int32_t, ...)" },
 275  279  { "lquantize", DT_IDENT_AGGFUNC, 0, DTRACEAGG_LQUANTIZE,
 276  280          DT_ATTR_STABCMN, DT_VERS_1_0,
 277  281          &dt_idops_func, "void(@, int32_t, int32_t, ...)" },
↓ open down ↓ 94 lines elided ↑ open up ↑
 372  376  { "strlen", DT_IDENT_FUNC, 0, DIF_SUBR_STRLEN, DT_ATTR_STABCMN, DT_VERS_1_0,
 373  377          &dt_idops_func, "size_t(const char *)" },
 374  378  { "strjoin", DT_IDENT_FUNC, 0, DIF_SUBR_STRJOIN, DT_ATTR_STABCMN, DT_VERS_1_0,
 375  379          &dt_idops_func, "string(const char *, const char *)" },
 376  380  { "strrchr", DT_IDENT_FUNC, 0, DIF_SUBR_STRRCHR, DT_ATTR_STABCMN, DT_VERS_1_1,
 377  381          &dt_idops_func, "string(const char *, char)" },
 378  382  { "strstr", DT_IDENT_FUNC, 0, DIF_SUBR_STRSTR, DT_ATTR_STABCMN, DT_VERS_1_1,
 379  383          &dt_idops_func, "string(const char *, const char *)" },
 380  384  { "strtok", DT_IDENT_FUNC, 0, DIF_SUBR_STRTOK, DT_ATTR_STABCMN, DT_VERS_1_1,
 381  385          &dt_idops_func, "string(const char *, const char *)" },
      386 +{ "strtoll", DT_IDENT_FUNC, 0, DIF_SUBR_STRTOLL, DT_ATTR_STABCMN, DT_VERS_1_11,
      387 +        &dt_idops_func, "int64_t(const char *, [int])" },
 382  388  { "substr", DT_IDENT_FUNC, 0, DIF_SUBR_SUBSTR, DT_ATTR_STABCMN, DT_VERS_1_1,
 383  389          &dt_idops_func, "string(const char *, int, [int])" },
 384  390  { "sum", DT_IDENT_AGGFUNC, 0, DTRACEAGG_SUM, DT_ATTR_STABCMN, DT_VERS_1_0,
 385  391          &dt_idops_func, "void(@)" },
 386  392  { "sym", DT_IDENT_ACTFUNC, 0, DT_ACT_SYM, DT_ATTR_STABCMN,
 387  393          DT_VERS_1_2, &dt_idops_func, "_symaddr(uintptr_t)" },
 388  394  { "system", DT_IDENT_ACTFUNC, 0, DT_ACT_SYSTEM, DT_ATTR_STABCMN, DT_VERS_1_0,
 389  395          &dt_idops_func, "void(@, ...)" },
 390  396  { "this", DT_IDENT_PTR, 0, 0, DT_ATTR_STABCMN, DT_VERS_1_0,
 391  397          &dt_idops_type, "void" },
↓ open down ↓ 1024 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX