Print this page
4471 DTrace count() with histogram
4472 DTrace full width distribution histograms
4473 DTrace frequency trails

Split Close
Expand all
Collapse all
          --- old/usr/src/lib/libdtrace/common/dt_options.c
          +++ new/usr/src/lib/libdtrace/common/dt_options.c
↓ open down ↓ 17 lines elided ↑ open up ↑
  18   18   *
  19   19   * CDDL HEADER END
  20   20   */
  21   21  
  22   22  /*
  23   23   * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
  24   24   * Use is subject to license terms.
  25   25   */
  26   26  
  27   27  /*
       28 + * Copyright (c) 2013, Joyent, Inc. All rights reserved.
  28   29   * Copyright (c) 2012 by Delphix. All rights reserved.
  29   30   */
  30   31  
  31   32  #include <sys/resource.h>
  32   33  #include <sys/mman.h>
  33   34  #include <sys/types.h>
  34   35  
  35   36  #include <strings.h>
  36   37  #include <signal.h>
  37   38  #include <stdlib.h>
↓ open down ↓ 291 lines elided ↑ open up ↑
 329  330          else if (strcasecmp(arg, "dof") == 0)
 330  331                  dtp->dt_linktype = DT_LTYP_DOF;
 331  332          else
 332  333                  return (dt_set_errno(dtp, EDT_BADOPTVAL));
 333  334  
 334  335          return (0);
 335  336  }
 336  337  
 337  338  /*ARGSUSED*/
 338  339  static int
      340 +dt_opt_encoding(dtrace_hdl_t *dtp, const char *arg, uintptr_t option)
      341 +{
      342 +        if (arg == NULL)
      343 +                return (dt_set_errno(dtp, EDT_BADOPTVAL));
      344 +
      345 +        if (strcmp(arg, "ascii") == 0)
      346 +                dtp->dt_encoding = DT_ENCODING_ASCII;
      347 +        else if (strcmp(arg, "utf8") == 0)
      348 +                dtp->dt_encoding = DT_ENCODING_UTF8;
      349 +        else
      350 +                return (dt_set_errno(dtp, EDT_BADOPTVAL));
      351 +
      352 +        return (0);
      353 +}
      354 +
      355 +/*ARGSUSED*/
      356 +static int
 339  357  dt_opt_evaltime(dtrace_hdl_t *dtp, const char *arg, uintptr_t option)
 340  358  {
 341  359          if (arg == NULL)
 342  360                  return (dt_set_errno(dtp, EDT_BADOPTVAL));
 343  361  
 344  362          if (strcmp(arg, "exec") == 0)
 345  363                  dtp->dt_prcmode = DT_PROC_STOP_CREATE;
 346  364          else if (strcmp(arg, "preinit") == 0)
 347  365                  dtp->dt_prcmode = DT_PROC_STOP_PREINIT;
 348  366          else if (strcmp(arg, "postinit") == 0)
↓ open down ↓ 561 lines elided ↑ open up ↑
 910  928          { "cpp", dt_opt_cflags, DTRACE_C_CPP },
 911  929          { "cpphdrs", dt_opt_cpp_hdrs },
 912  930          { "cpppath", dt_opt_cpp_path },
 913  931          { "ctypes", dt_opt_ctypes },
 914  932          { "defaultargs", dt_opt_cflags, DTRACE_C_DEFARG },
 915  933          { "dtypes", dt_opt_dtypes },
 916  934          { "debug", dt_opt_debug },
 917  935          { "define", dt_opt_cpp_opts, (uintptr_t)"-D" },
 918  936          { "droptags", dt_opt_droptags },
 919  937          { "empty", dt_opt_cflags, DTRACE_C_EMPTY },
      938 +        { "encoding", dt_opt_encoding },
 920  939          { "errtags", dt_opt_cflags, DTRACE_C_ETAGS },
 921  940          { "evaltime", dt_opt_evaltime },
 922  941          { "incdir", dt_opt_cpp_opts, (uintptr_t)"-I" },
 923  942          { "iregs", dt_opt_iregs },
 924  943          { "kdefs", dt_opt_invcflags, DTRACE_C_KNODEF },
 925  944          { "knodefs", dt_opt_cflags, DTRACE_C_KNODEF },
 926  945          { "late", dt_opt_xlate },
 927  946          { "lazyload", dt_opt_lazyload },
 928  947          { "ldpath", dt_opt_ld_path },
 929  948          { "libdir", dt_opt_libdir },
↓ open down ↓ 40 lines elided ↑ open up ↑
 970  989          { "strsize", dt_opt_strsize, DTRACEOPT_STRSIZE },
 971  990          { "ustackframes", dt_opt_runtime, DTRACEOPT_USTACKFRAMES },
 972  991          { "temporal", dt_opt_runtime, DTRACEOPT_TEMPORAL },
 973  992          { NULL }
 974  993  };
 975  994  
 976  995  /*
 977  996   * Dynamic run-time options.
 978  997   */
 979  998  static const dt_option_t _dtrace_drtoptions[] = {
      999 +        { "agghist", dt_opt_runtime, DTRACEOPT_AGGHIST },
     1000 +        { "aggpack", dt_opt_runtime, DTRACEOPT_AGGPACK },
 980 1001          { "aggrate", dt_opt_rate, DTRACEOPT_AGGRATE },
 981 1002          { "aggsortkey", dt_opt_runtime, DTRACEOPT_AGGSORTKEY },
 982 1003          { "aggsortkeypos", dt_opt_runtime, DTRACEOPT_AGGSORTKEYPOS },
 983 1004          { "aggsortpos", dt_opt_runtime, DTRACEOPT_AGGSORTPOS },
 984 1005          { "aggsortrev", dt_opt_runtime, DTRACEOPT_AGGSORTREV },
     1006 +        { "aggzoom", dt_opt_runtime, DTRACEOPT_AGGZOOM },
 985 1007          { "flowindent", dt_opt_runtime, DTRACEOPT_FLOWINDENT },
 986 1008          { "quiet", dt_opt_runtime, DTRACEOPT_QUIET },
 987 1009          { "rawbytes", dt_opt_runtime, DTRACEOPT_RAWBYTES },
 988 1010          { "stackindent", dt_opt_runtime, DTRACEOPT_STACKINDENT },
 989 1011          { "switchrate", dt_opt_rate, DTRACEOPT_SWITCHRATE },
 990 1012          { NULL }
 991 1013  };
 992 1014  
 993 1015  int
 994 1016  dtrace_getopt(dtrace_hdl_t *dtp, const char *opt, dtrace_optval_t *val)
↓ open down ↓ 60 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX