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


 163         dt_ahashent_t   **dtah_hash;            /* hash table */
 164         dt_ahashent_t   *dtah_all;              /* list of all elements */
 165         size_t          dtah_size;              /* size of hash table */
 166 } dt_ahash_t;
 167 
 168 typedef struct dt_aggregate {
 169         dtrace_bufdesc_t dtat_buf;      /* buf aggregation snapshot */
 170         int dtat_flags;                 /* aggregate flags */
 171         processorid_t dtat_ncpus;       /* number of CPUs in aggregate */
 172         processorid_t *dtat_cpus;       /* CPUs in aggregate */
 173         processorid_t dtat_ncpu;        /* size of dtat_cpus array */
 174         processorid_t dtat_maxcpu;      /* maximum number of CPUs */
 175         dt_ahash_t dtat_hash;           /* aggregate hash table */
 176 } dt_aggregate_t;
 177 
 178 typedef struct dt_print_aggdata {
 179         dtrace_hdl_t *dtpa_dtp;         /* pointer to libdtrace handle */
 180         dtrace_aggvarid_t dtpa_id;      /* aggregation variable of interest */
 181         FILE *dtpa_fp;                  /* file pointer */
 182         int dtpa_allunprint;            /* print only unprinted aggregations */



 183 } dt_print_aggdata_t;
 184 
 185 typedef struct dt_dirpath {
 186         dt_list_t dir_list;             /* linked-list forward/back pointers */
 187         char *dir_path;                 /* directory pathname */
 188 } dt_dirpath_t;
 189 
 190 typedef struct dt_lib_depend {
 191         dt_list_t dtld_deplist;         /* linked-list forward/back pointers */
 192         char *dtld_library;             /* library name */
 193         char *dtld_libpath;             /* library pathname */
 194         uint_t dtld_finish;             /* completion time in tsort for lib */
 195         uint_t dtld_start;              /* starting time in tsort for lib */
 196         uint_t dtld_loaded;             /* boolean: is this library loaded */
 197         dt_list_t dtld_dependencies;    /* linked-list of lib dependencies */
 198         dt_list_t dtld_dependents;      /* linked-list of lib dependents */
 199 } dt_lib_depend_t;
 200 
 201 typedef uint32_t dt_version_t;          /* encoded version (see below) */
 202 


 257         char *dt_cpp_path;      /* pathname of cpp(1) to invoke if needed */
 258         char **dt_cpp_argv;     /* argument vector for exec'ing cpp(1) */
 259         int dt_cpp_argc;        /* count of initialized cpp(1) arguments */
 260         int dt_cpp_args;        /* size of dt_cpp_argv[] array */
 261         char *dt_ld_path;       /* pathname of ld(1) to invoke if needed */
 262         dt_list_t dt_lib_path;  /* linked-list forming library search path */
 263         uint_t dt_lazyload;     /* boolean:  set via -xlazyload */
 264         uint_t dt_droptags;     /* boolean:  set via -xdroptags */
 265         uint_t dt_active;       /* boolean:  set once tracing is active */
 266         uint_t dt_stopped;      /* boolean:  set once tracing is stopped */
 267         processorid_t dt_beganon; /* CPU that executed BEGIN probe (if any) */
 268         processorid_t dt_endedon; /* CPU that executed END probe (if any) */
 269         uint_t dt_oflags;       /* dtrace open-time options (see dtrace.h) */
 270         uint_t dt_cflags;       /* dtrace compile-time options (see dtrace.h) */
 271         uint_t dt_dflags;       /* dtrace link-time options (see dtrace.h) */
 272         uint_t dt_prcmode;      /* dtrace process create mode (see dt_proc.h) */
 273         uint_t dt_linkmode;     /* dtrace symbol linking mode (see below) */
 274         uint_t dt_linktype;     /* dtrace link output file type (see below) */
 275         uint_t dt_xlatemode;    /* dtrace translator linking mode (see below) */
 276         uint_t dt_stdcmode;     /* dtrace stdc compatibility mode (see below) */

 277         uint_t dt_treedump;     /* dtrace tree debug bitmap (see below) */
 278         uint64_t dt_options[DTRACEOPT_MAX]; /* dtrace run-time options */
 279         int dt_version;         /* library version requested by client */
 280         int dt_ctferr;          /* error resulting from last CTF failure */
 281         int dt_errno;           /* error resulting from last failed operation */
 282         int dt_fd;              /* file descriptor for dtrace pseudo-device */
 283         int dt_ftfd;            /* file descriptor for fasttrap pseudo-device */
 284         int dt_fterr;           /* saved errno from failed open of dt_ftfd */
 285         int dt_cdefs_fd;        /* file descriptor for C CTF debugging cache */
 286         int dt_ddefs_fd;        /* file descriptor for D CTF debugging cache */
 287         int dt_stdout_fd;       /* file descriptor for saved stdout */
 288         dtrace_handle_err_f *dt_errhdlr; /* error handler, if any */
 289         void *dt_errarg;        /* error handler argument */
 290         dtrace_prog_t *dt_errprog; /* error handler program, if any */
 291         dtrace_handle_drop_f *dt_drophdlr; /* drop handler, if any */
 292         void *dt_droparg;       /* drop handler argument */
 293         dtrace_handle_proc_f *dt_prochdlr; /* proc handler, if any */
 294         void *dt_procarg;       /* proc handler argument */
 295         dtrace_handle_setopt_f *dt_setopthdlr; /* setopt handler, if any */
 296         void *dt_setoptarg;     /* setopt handler argument */


 340 #define DT_LTYP_ELF     0       /* produce ELF containing DOF */
 341 #define DT_LTYP_DOF     1       /* produce stand-alone DOF */
 342 
 343 /*
 344  * Values for the dt_xlatemode property, which is used to determine whether
 345  * references to dynamic translators are permitted.  Set using -xlate=<mode>.
 346  */
 347 #define DT_XL_STATIC    0       /* require xlators to be statically defined */
 348 #define DT_XL_DYNAMIC   1       /* produce references to dynamic translators */
 349 
 350 /*
 351  * Values for the dt_stdcmode property, which is used by the compiler when
 352  * running cpp to determine the presence and setting of the __STDC__ macro.
 353  */
 354 #define DT_STDC_XA      0       /* ISO C + K&R C compat w/o ISO: __STDC__=0 */
 355 #define DT_STDC_XC      1       /* Strict ISO C: __STDC__=1 */
 356 #define DT_STDC_XS      2       /* K&R C: __STDC__ not defined */
 357 #define DT_STDC_XT      3       /* ISO C + K&R C compat with ISO: __STDC__=0 */
 358 
 359 /*








 360  * Macro to test whether a given pass bit is set in the dt_treedump bit-vector.
 361  * If the bit for pass 'p' is set, the D compiler displays the parse tree for
 362  * the program by printing it to stderr at the end of compiler pass 'p'.
 363  */
 364 #define DT_TREEDUMP_PASS(dtp, p)        ((dtp)->dt_treedump & (1 << ((p) - 1)))
 365 
 366 /*
 367  * Macros for accessing the cached CTF container and type ID for the common
 368  * types "int", "string", and <DYN>, which we need to use frequently in the D
 369  * compiler.  The DT_INT_* macro relies upon "int" being at index 0 in the
 370  * _dtrace_ints_* tables in dt_open.c; the others are also set up there.
 371  */
 372 #define DT_INT_CTFP(dtp)        ((dtp)->dt_ints[0].did_ctfp)
 373 #define DT_INT_TYPE(dtp)        ((dtp)->dt_ints[0].did_type)
 374 
 375 #define DT_FUNC_CTFP(dtp)       ((dtp)->dt_ddefs->dm_ctfp)
 376 #define DT_FUNC_TYPE(dtp)       ((dtp)->dt_type_func)
 377 
 378 #define DT_FPTR_CTFP(dtp)       ((dtp)->dt_ddefs->dm_ctfp)
 379 #define DT_FPTR_TYPE(dtp)       ((dtp)->dt_type_fptr)




 163         dt_ahashent_t   **dtah_hash;            /* hash table */
 164         dt_ahashent_t   *dtah_all;              /* list of all elements */
 165         size_t          dtah_size;              /* size of hash table */
 166 } dt_ahash_t;
 167 
 168 typedef struct dt_aggregate {
 169         dtrace_bufdesc_t dtat_buf;      /* buf aggregation snapshot */
 170         int dtat_flags;                 /* aggregate flags */
 171         processorid_t dtat_ncpus;       /* number of CPUs in aggregate */
 172         processorid_t *dtat_cpus;       /* CPUs in aggregate */
 173         processorid_t dtat_ncpu;        /* size of dtat_cpus array */
 174         processorid_t dtat_maxcpu;      /* maximum number of CPUs */
 175         dt_ahash_t dtat_hash;           /* aggregate hash table */
 176 } dt_aggregate_t;
 177 
 178 typedef struct dt_print_aggdata {
 179         dtrace_hdl_t *dtpa_dtp;         /* pointer to libdtrace handle */
 180         dtrace_aggvarid_t dtpa_id;      /* aggregation variable of interest */
 181         FILE *dtpa_fp;                  /* file pointer */
 182         int dtpa_allunprint;            /* print only unprinted aggregations */
 183         int dtpa_agghist;               /* print aggregation as histogram */
 184         int dtpa_agghisthdr;            /* aggregation histogram hdr printed */
 185         int dtpa_aggpack;               /* pack quantized aggregations */
 186 } dt_print_aggdata_t;
 187 
 188 typedef struct dt_dirpath {
 189         dt_list_t dir_list;             /* linked-list forward/back pointers */
 190         char *dir_path;                 /* directory pathname */
 191 } dt_dirpath_t;
 192 
 193 typedef struct dt_lib_depend {
 194         dt_list_t dtld_deplist;         /* linked-list forward/back pointers */
 195         char *dtld_library;             /* library name */
 196         char *dtld_libpath;             /* library pathname */
 197         uint_t dtld_finish;             /* completion time in tsort for lib */
 198         uint_t dtld_start;              /* starting time in tsort for lib */
 199         uint_t dtld_loaded;             /* boolean: is this library loaded */
 200         dt_list_t dtld_dependencies;    /* linked-list of lib dependencies */
 201         dt_list_t dtld_dependents;      /* linked-list of lib dependents */
 202 } dt_lib_depend_t;
 203 
 204 typedef uint32_t dt_version_t;          /* encoded version (see below) */
 205 


 260         char *dt_cpp_path;      /* pathname of cpp(1) to invoke if needed */
 261         char **dt_cpp_argv;     /* argument vector for exec'ing cpp(1) */
 262         int dt_cpp_argc;        /* count of initialized cpp(1) arguments */
 263         int dt_cpp_args;        /* size of dt_cpp_argv[] array */
 264         char *dt_ld_path;       /* pathname of ld(1) to invoke if needed */
 265         dt_list_t dt_lib_path;  /* linked-list forming library search path */
 266         uint_t dt_lazyload;     /* boolean:  set via -xlazyload */
 267         uint_t dt_droptags;     /* boolean:  set via -xdroptags */
 268         uint_t dt_active;       /* boolean:  set once tracing is active */
 269         uint_t dt_stopped;      /* boolean:  set once tracing is stopped */
 270         processorid_t dt_beganon; /* CPU that executed BEGIN probe (if any) */
 271         processorid_t dt_endedon; /* CPU that executed END probe (if any) */
 272         uint_t dt_oflags;       /* dtrace open-time options (see dtrace.h) */
 273         uint_t dt_cflags;       /* dtrace compile-time options (see dtrace.h) */
 274         uint_t dt_dflags;       /* dtrace link-time options (see dtrace.h) */
 275         uint_t dt_prcmode;      /* dtrace process create mode (see dt_proc.h) */
 276         uint_t dt_linkmode;     /* dtrace symbol linking mode (see below) */
 277         uint_t dt_linktype;     /* dtrace link output file type (see below) */
 278         uint_t dt_xlatemode;    /* dtrace translator linking mode (see below) */
 279         uint_t dt_stdcmode;     /* dtrace stdc compatibility mode (see below) */
 280         uint_t dt_encoding;     /* dtrace output encoding (see below) */
 281         uint_t dt_treedump;     /* dtrace tree debug bitmap (see below) */
 282         uint64_t dt_options[DTRACEOPT_MAX]; /* dtrace run-time options */
 283         int dt_version;         /* library version requested by client */
 284         int dt_ctferr;          /* error resulting from last CTF failure */
 285         int dt_errno;           /* error resulting from last failed operation */
 286         int dt_fd;              /* file descriptor for dtrace pseudo-device */
 287         int dt_ftfd;            /* file descriptor for fasttrap pseudo-device */
 288         int dt_fterr;           /* saved errno from failed open of dt_ftfd */
 289         int dt_cdefs_fd;        /* file descriptor for C CTF debugging cache */
 290         int dt_ddefs_fd;        /* file descriptor for D CTF debugging cache */
 291         int dt_stdout_fd;       /* file descriptor for saved stdout */
 292         dtrace_handle_err_f *dt_errhdlr; /* error handler, if any */
 293         void *dt_errarg;        /* error handler argument */
 294         dtrace_prog_t *dt_errprog; /* error handler program, if any */
 295         dtrace_handle_drop_f *dt_drophdlr; /* drop handler, if any */
 296         void *dt_droparg;       /* drop handler argument */
 297         dtrace_handle_proc_f *dt_prochdlr; /* proc handler, if any */
 298         void *dt_procarg;       /* proc handler argument */
 299         dtrace_handle_setopt_f *dt_setopthdlr; /* setopt handler, if any */
 300         void *dt_setoptarg;     /* setopt handler argument */


 344 #define DT_LTYP_ELF     0       /* produce ELF containing DOF */
 345 #define DT_LTYP_DOF     1       /* produce stand-alone DOF */
 346 
 347 /*
 348  * Values for the dt_xlatemode property, which is used to determine whether
 349  * references to dynamic translators are permitted.  Set using -xlate=<mode>.
 350  */
 351 #define DT_XL_STATIC    0       /* require xlators to be statically defined */
 352 #define DT_XL_DYNAMIC   1       /* produce references to dynamic translators */
 353 
 354 /*
 355  * Values for the dt_stdcmode property, which is used by the compiler when
 356  * running cpp to determine the presence and setting of the __STDC__ macro.
 357  */
 358 #define DT_STDC_XA      0       /* ISO C + K&R C compat w/o ISO: __STDC__=0 */
 359 #define DT_STDC_XC      1       /* Strict ISO C: __STDC__=1 */
 360 #define DT_STDC_XS      2       /* K&R C: __STDC__ not defined */
 361 #define DT_STDC_XT      3       /* ISO C + K&R C compat with ISO: __STDC__=0 */
 362 
 363 /*
 364  * Values for the dt_encoding property, which is used to force a particular
 365  * character encoding (overriding default behavior and/or automatic detection).
 366  */
 367 #define DT_ENCODING_UNSET       0
 368 #define DT_ENCODING_ASCII       1
 369 #define DT_ENCODING_UTF8        2
 370 
 371 /*
 372  * Macro to test whether a given pass bit is set in the dt_treedump bit-vector.
 373  * If the bit for pass 'p' is set, the D compiler displays the parse tree for
 374  * the program by printing it to stderr at the end of compiler pass 'p'.
 375  */
 376 #define DT_TREEDUMP_PASS(dtp, p)        ((dtp)->dt_treedump & (1 << ((p) - 1)))
 377 
 378 /*
 379  * Macros for accessing the cached CTF container and type ID for the common
 380  * types "int", "string", and <DYN>, which we need to use frequently in the D
 381  * compiler.  The DT_INT_* macro relies upon "int" being at index 0 in the
 382  * _dtrace_ints_* tables in dt_open.c; the others are also set up there.
 383  */
 384 #define DT_INT_CTFP(dtp)        ((dtp)->dt_ints[0].did_ctfp)
 385 #define DT_INT_TYPE(dtp)        ((dtp)->dt_ints[0].did_type)
 386 
 387 #define DT_FUNC_CTFP(dtp)       ((dtp)->dt_ddefs->dm_ctfp)
 388 #define DT_FUNC_TYPE(dtp)       ((dtp)->dt_type_func)
 389 
 390 #define DT_FPTR_CTFP(dtp)       ((dtp)->dt_ddefs->dm_ctfp)
 391 #define DT_FPTR_TYPE(dtp)       ((dtp)->dt_type_fptr)