Deleted Added
full compact
dt_open.c (210767) dt_open.c (211554)
1/*
2 * CDDL HEADER START
3 *
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
7 *
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE

--- 269 unchanged lines hidden (view full) ---

278 DT_VERS_1_5, &dt_idops_func, "string(in6_addr_t *)" },
279#else
280 DT_VERS_1_5, &dt_idops_func, "string(struct in6_addr *)" },
281#endif
282{ "inet_ntop", DT_IDENT_FUNC, 0, DIF_SUBR_INET_NTOP, DT_ATTR_STABCMN,
283 DT_VERS_1_5, &dt_idops_func, "string(int, void *)" },
284{ "ipl", DT_IDENT_SCALAR, 0, DIF_VAR_IPL, DT_ATTR_STABCMN, DT_VERS_1_0,
285 &dt_idops_type, "uint_t" },
1/*
2 * CDDL HEADER START
3 *
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
7 *
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE

--- 269 unchanged lines hidden (view full) ---

278 DT_VERS_1_5, &dt_idops_func, "string(in6_addr_t *)" },
279#else
280 DT_VERS_1_5, &dt_idops_func, "string(struct in6_addr *)" },
281#endif
282{ "inet_ntop", DT_IDENT_FUNC, 0, DIF_SUBR_INET_NTOP, DT_ATTR_STABCMN,
283 DT_VERS_1_5, &dt_idops_func, "string(int, void *)" },
284{ "ipl", DT_IDENT_SCALAR, 0, DIF_VAR_IPL, DT_ATTR_STABCMN, DT_VERS_1_0,
285 &dt_idops_type, "uint_t" },
286#if defined(sun)
287{ "jstack", DT_IDENT_ACTFUNC, 0, DT_ACT_JSTACK, DT_ATTR_STABCMN, DT_VERS_1_0,
288 &dt_idops_func, "stack(...)" },
286{ "jstack", DT_IDENT_ACTFUNC, 0, DT_ACT_JSTACK, DT_ATTR_STABCMN, DT_VERS_1_0,
287 &dt_idops_func, "stack(...)" },
289#endif
290{ "lltostr", DT_IDENT_FUNC, 0, DIF_SUBR_LLTOSTR, DT_ATTR_STABCMN, DT_VERS_1_0,
291 &dt_idops_func, "string(int64_t)" },
292{ "lquantize", DT_IDENT_AGGFUNC, 0, DTRACEAGG_LQUANTIZE,
293 DT_ATTR_STABCMN, DT_VERS_1_0,
294 &dt_idops_func, "void(@, int32_t, int32_t, ...)" },
295{ "max", DT_IDENT_AGGFUNC, 0, DTRACEAGG_MAX, DT_ATTR_STABCMN, DT_VERS_1_0,
296 &dt_idops_func, "void(@)" },
297{ "memref", DT_IDENT_FUNC, 0, DIF_SUBR_MEMREF, DT_ATTR_STABCMN, DT_VERS_1_1,

--- 162 unchanged lines hidden (view full) ---

460 &dt_idops_func, "void(@, size_t)" },
461{ "trunc", DT_IDENT_ACTFUNC, 0, DT_ACT_TRUNC, DT_ATTR_STABCMN,
462 DT_VERS_1_0, &dt_idops_func, "void(...)" },
463{ "typeref", DT_IDENT_FUNC, 0, DIF_SUBR_TYPEREF, DT_ATTR_STABCMN, DT_VERS_1_1,
464 &dt_idops_func, "uintptr_t *(void *, size_t, string, size_t)" },
465#if defined(sun)
466{ "uaddr", DT_IDENT_ACTFUNC, 0, DT_ACT_UADDR, DT_ATTR_STABCMN,
467 DT_VERS_1_2, &dt_idops_func, "_usymaddr(uintptr_t)" },
288{ "lltostr", DT_IDENT_FUNC, 0, DIF_SUBR_LLTOSTR, DT_ATTR_STABCMN, DT_VERS_1_0,
289 &dt_idops_func, "string(int64_t)" },
290{ "lquantize", DT_IDENT_AGGFUNC, 0, DTRACEAGG_LQUANTIZE,
291 DT_ATTR_STABCMN, DT_VERS_1_0,
292 &dt_idops_func, "void(@, int32_t, int32_t, ...)" },
293{ "max", DT_IDENT_AGGFUNC, 0, DTRACEAGG_MAX, DT_ATTR_STABCMN, DT_VERS_1_0,
294 &dt_idops_func, "void(@)" },
295{ "memref", DT_IDENT_FUNC, 0, DIF_SUBR_MEMREF, DT_ATTR_STABCMN, DT_VERS_1_1,

--- 162 unchanged lines hidden (view full) ---

458 &dt_idops_func, "void(@, size_t)" },
459{ "trunc", DT_IDENT_ACTFUNC, 0, DT_ACT_TRUNC, DT_ATTR_STABCMN,
460 DT_VERS_1_0, &dt_idops_func, "void(...)" },
461{ "typeref", DT_IDENT_FUNC, 0, DIF_SUBR_TYPEREF, DT_ATTR_STABCMN, DT_VERS_1_1,
462 &dt_idops_func, "uintptr_t *(void *, size_t, string, size_t)" },
463#if defined(sun)
464{ "uaddr", DT_IDENT_ACTFUNC, 0, DT_ACT_UADDR, DT_ATTR_STABCMN,
465 DT_VERS_1_2, &dt_idops_func, "_usymaddr(uintptr_t)" },
466#endif
468{ "ucaller", DT_IDENT_SCALAR, 0, DIF_VAR_UCALLER, DT_ATTR_STABCMN,
469 DT_VERS_1_2, &dt_idops_type, "uint64_t" },
467{ "ucaller", DT_IDENT_SCALAR, 0, DIF_VAR_UCALLER, DT_ATTR_STABCMN,
468 DT_VERS_1_2, &dt_idops_type, "uint64_t" },
469#if defined(sun)
470{ "ufunc", DT_IDENT_ACTFUNC, 0, DT_ACT_USYM, DT_ATTR_STABCMN,
471 DT_VERS_1_2, &dt_idops_func, "_usymaddr(uintptr_t)" },
472#endif
473{ "uid", DT_IDENT_SCALAR, 0, DIF_VAR_UID, DT_ATTR_STABCMN, DT_VERS_1_0,
474 &dt_idops_type, "uid_t" },
475#if defined(sun)
476{ "umod", DT_IDENT_ACTFUNC, 0, DT_ACT_UMOD, DT_ATTR_STABCMN,
477 DT_VERS_1_2, &dt_idops_func, "_usymaddr(uintptr_t)" },
470{ "ufunc", DT_IDENT_ACTFUNC, 0, DT_ACT_USYM, DT_ATTR_STABCMN,
471 DT_VERS_1_2, &dt_idops_func, "_usymaddr(uintptr_t)" },
472#endif
473{ "uid", DT_IDENT_SCALAR, 0, DIF_VAR_UID, DT_ATTR_STABCMN, DT_VERS_1_0,
474 &dt_idops_type, "uid_t" },
475#if defined(sun)
476{ "umod", DT_IDENT_ACTFUNC, 0, DT_ACT_UMOD, DT_ATTR_STABCMN,
477 DT_VERS_1_2, &dt_idops_func, "_usymaddr(uintptr_t)" },
478#endif
478{ "uregs", DT_IDENT_ARRAY, 0, DIF_VAR_UREGS, DT_ATTR_STABCMN, DT_VERS_1_0,
479 &dt_idops_regs, NULL },
480{ "ustack", DT_IDENT_ACTFUNC, 0, DT_ACT_USTACK, DT_ATTR_STABCMN, DT_VERS_1_0,
481 &dt_idops_func, "stack(...)" },
482{ "ustackdepth", DT_IDENT_SCALAR, 0, DIF_VAR_USTACKDEPTH,
483 DT_ATTR_STABCMN, DT_VERS_1_2,
484 &dt_idops_type, "uint32_t" },
479{ "uregs", DT_IDENT_ARRAY, 0, DIF_VAR_UREGS, DT_ATTR_STABCMN, DT_VERS_1_0,
480 &dt_idops_regs, NULL },
481{ "ustack", DT_IDENT_ACTFUNC, 0, DT_ACT_USTACK, DT_ATTR_STABCMN, DT_VERS_1_0,
482 &dt_idops_func, "stack(...)" },
483{ "ustackdepth", DT_IDENT_SCALAR, 0, DIF_VAR_USTACKDEPTH,
484 DT_ATTR_STABCMN, DT_VERS_1_2,
485 &dt_idops_type, "uint32_t" },
486#if defined(sun)
485{ "usym", DT_IDENT_ACTFUNC, 0, DT_ACT_USYM, DT_ATTR_STABCMN,
486 DT_VERS_1_2, &dt_idops_func, "_usymaddr(uintptr_t)" },
487#endif
488{ "vtimestamp", DT_IDENT_SCALAR, 0, DIF_VAR_VTIMESTAMP,
489 DT_ATTR_STABCMN, DT_VERS_1_0,
490 &dt_idops_type, "uint64_t" },
491{ "walltimestamp", DT_IDENT_SCALAR, 0, DIF_VAR_WALLTIMESTAMP,
492 DT_ATTR_STABCMN, DT_VERS_1_0,

--- 262 unchanged lines hidden (view full) ---

755uint_t _dtrace_stkindent = 14; /* default whitespace indent for stack/ustack */
756uint_t _dtrace_pidbuckets = 64; /* default number of pid hash buckets */
757uint_t _dtrace_pidlrulim = 8; /* default number of pid handles to cache */
758size_t _dtrace_bufsize = 512; /* default dt_buf_create() size */
759int _dtrace_argmax = 32; /* default maximum number of probe arguments */
760
761int _dtrace_debug = 0; /* debug messages enabled (off) */
762const char *const _dtrace_version = DT_VERS_STRING; /* API version string */
487{ "usym", DT_IDENT_ACTFUNC, 0, DT_ACT_USYM, DT_ATTR_STABCMN,
488 DT_VERS_1_2, &dt_idops_func, "_usymaddr(uintptr_t)" },
489#endif
490{ "vtimestamp", DT_IDENT_SCALAR, 0, DIF_VAR_VTIMESTAMP,
491 DT_ATTR_STABCMN, DT_VERS_1_0,
492 &dt_idops_type, "uint64_t" },
493{ "walltimestamp", DT_IDENT_SCALAR, 0, DIF_VAR_WALLTIMESTAMP,
494 DT_ATTR_STABCMN, DT_VERS_1_0,

--- 262 unchanged lines hidden (view full) ---

757uint_t _dtrace_stkindent = 14; /* default whitespace indent for stack/ustack */
758uint_t _dtrace_pidbuckets = 64; /* default number of pid hash buckets */
759uint_t _dtrace_pidlrulim = 8; /* default number of pid handles to cache */
760size_t _dtrace_bufsize = 512; /* default dt_buf_create() size */
761int _dtrace_argmax = 32; /* default maximum number of probe arguments */
762
763int _dtrace_debug = 0; /* debug messages enabled (off) */
764const char *const _dtrace_version = DT_VERS_STRING; /* API version string */
763#if defined(sun)
764int _dtrace_rdvers = RD_VERSION; /* rtld_db feature version */
765int _dtrace_rdvers = RD_VERSION; /* rtld_db feature version */
765#endif
766
767typedef struct dt_fdlist {
768 int *df_fds; /* array of provider driver file descriptors */
769 uint_t df_ents; /* number of valid elements in df_fds[] */
770 uint_t df_size; /* size of df_fds[] */
771} dt_fdlist_t;
772
773#if defined(sun)
774#pragma init(_dtrace_init)
775#else
776void _dtrace_init(void) __attribute__ ((constructor));
777#endif
778void
779_dtrace_init(void)
780{
781 _dtrace_debug = getenv("DTRACE_DEBUG") != NULL;
782
766
767typedef struct dt_fdlist {
768 int *df_fds; /* array of provider driver file descriptors */
769 uint_t df_ents; /* number of valid elements in df_fds[] */
770 uint_t df_size; /* size of df_fds[] */
771} dt_fdlist_t;
772
773#if defined(sun)
774#pragma init(_dtrace_init)
775#else
776void _dtrace_init(void) __attribute__ ((constructor));
777#endif
778void
779_dtrace_init(void)
780{
781 _dtrace_debug = getenv("DTRACE_DEBUG") != NULL;
782
783#if defined(sun)
784 for (; _dtrace_rdvers > 0; _dtrace_rdvers--) {
785 if (rd_init(_dtrace_rdvers) == RD_OK)
786 break;
787 }
783 for (; _dtrace_rdvers > 0; _dtrace_rdvers--) {
784 if (rd_init(_dtrace_rdvers) == RD_OK)
785 break;
786 }
788#endif
789#if defined(__i386__)
790 /* make long doubles 64 bits -sson */
791 (void) fpsetprec(FP_PE);
792#endif
793}
794
795static dtrace_hdl_t *
796set_open_errno(dtrace_hdl_t *dtp, int *errp, int err)

--- 300 unchanged lines hidden (view full) ---

1097 (void) fcntl(ftfd, F_SETFD, FD_CLOEXEC);
1098
1099alloc:
1100 if ((dtp = malloc(sizeof (dtrace_hdl_t))) == NULL)
1101 return (set_open_errno(dtp, errp, EDT_NOMEM));
1102
1103 bzero(dtp, sizeof (dtrace_hdl_t));
1104 dtp->dt_oflags = flags;
787#if defined(__i386__)
788 /* make long doubles 64 bits -sson */
789 (void) fpsetprec(FP_PE);
790#endif
791}
792
793static dtrace_hdl_t *
794set_open_errno(dtrace_hdl_t *dtp, int *errp, int err)

--- 300 unchanged lines hidden (view full) ---

1095 (void) fcntl(ftfd, F_SETFD, FD_CLOEXEC);
1096
1097alloc:
1098 if ((dtp = malloc(sizeof (dtrace_hdl_t))) == NULL)
1099 return (set_open_errno(dtp, errp, EDT_NOMEM));
1100
1101 bzero(dtp, sizeof (dtrace_hdl_t));
1102 dtp->dt_oflags = flags;
1103#if defined(sun)
1105 dtp->dt_prcmode = DT_PROC_STOP_PREINIT;
1104 dtp->dt_prcmode = DT_PROC_STOP_PREINIT;
1105#else
1106 dtp->dt_prcmode = DT_PROC_STOP_POSTINIT;
1107#endif
1106 dtp->dt_linkmode = DT_LINK_KERNEL;
1107 dtp->dt_linktype = DT_LTYP_ELF;
1108 dtp->dt_xlatemode = DT_XL_STATIC;
1109 dtp->dt_stdcmode = DT_STDC_XA;
1110 dtp->dt_version = version;
1111 dtp->dt_fd = dtfd;
1112 dtp->dt_ftfd = ftfd;
1113 dtp->dt_fterr = fterr;

--- 531 unchanged lines hidden ---
1108 dtp->dt_linkmode = DT_LINK_KERNEL;
1109 dtp->dt_linktype = DT_LTYP_ELF;
1110 dtp->dt_xlatemode = DT_XL_STATIC;
1111 dtp->dt_stdcmode = DT_STDC_XA;
1112 dtp->dt_version = version;
1113 dtp->dt_fd = dtfd;
1114 dtp->dt_ftfd = ftfd;
1115 dtp->dt_fterr = fterr;

--- 531 unchanged lines hidden ---