Date: Mon, 24 Apr 2006 02:39:39 GMT From: John Birrell <jb@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 95982 for review Message-ID: <200604240239.k3O2dddq071111@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=95982 Change 95982 by jb@jb_freebsd2 on 2006/04/24 02:39:21 Use the enable IO argument structure to pass info to and from the ENABLE ioctl. Affected files ... .. //depot/projects/dtrace/src/contrib/opensolaris/lib/libdtrace/common/dt_pid.c#5 edit .. //depot/projects/dtrace/src/contrib/opensolaris/lib/libdtrace/common/dt_program.c#4 edit .. //depot/projects/dtrace/src/contrib/opensolaris/lib/libdtrace/common/dt_work.c#5 edit Differences ... ==== //depot/projects/dtrace/src/contrib/opensolaris/lib/libdtrace/common/dt_pid.c#5 (text) ==== @@ -741,6 +741,7 @@ int dt_pid_create_probes_module(dtrace_hdl_t *dtp, dt_proc_t *dpr) { + dtrace_enable_io_t args; dtrace_prog_t *pgp; dt_stmt_t *stp; dtrace_probedesc_t *pdp, pd; @@ -779,8 +780,9 @@ * Give DTrace a shot to the ribs to get it to check * out the newly created probes. */ -printf("%s:%s(%d) ioctl args can't be optional on FreeBSD!\n",__FUNCTION__,__FILE__,__LINE__); - (void) dt_ioctl(dtp, DTRACEIOC_ENABLE, NULL); + args.dof = NULL; + args.n_matched = 0; + (void) dt_ioctl(dtp, DTRACEIOC_ENABLE, &args); } return (ret); ==== //depot/projects/dtrace/src/contrib/opensolaris/lib/libdtrace/common/dt_program.c#4 (text) ==== @@ -153,19 +153,18 @@ dtrace_program_exec(dtrace_hdl_t *dtp, dtrace_prog_t *pgp, dtrace_proginfo_t *pip) { + dtrace_enable_io_t args; void *dof; int n, err; -printf("%s: call dtrace_program_info\n",__FUNCTION__); dtrace_program_info(dtp, pgp, pip); -printf("%s: call dtrace_dof_create\n",__FUNCTION__); if ((dof = dtrace_dof_create(dtp, pgp, DTRACE_D_STRIP)) == NULL) return (-1); -printf("%s: ioctl DTRACEIOC_ENABLE dof %p &dof %p\n",__FUNCTION__,dof,&dof); - n = dt_ioctl(dtp, DTRACEIOC_ENABLE, &dof); -printf("%s: call dtrace_dof_destroy\n",__FUNCTION__); + args.dof = dof; + args.n_matched = 0; + n = dt_ioctl(dtp, DTRACEIOC_ENABLE, &args); dtrace_dof_destroy(dtp, dof); if (n == -1) { @@ -183,14 +182,12 @@ err = errno; } -printf("%s: dtrace_dof_destroy returned an error\n",__FUNCTION__); return (dt_set_errno(dtp, err)); } if (pip != NULL) - pip->dpi_matches += n; + pip->dpi_matches += args.n_matched; -printf("%s: returns\n",__FUNCTION__); return (0); } ==== //depot/projects/dtrace/src/contrib/opensolaris/lib/libdtrace/common/dt_work.c#5 (text) ==== @@ -166,6 +166,7 @@ int dtrace_go(dtrace_hdl_t *dtp) { + dtrace_enable_io_t args; void *dof; int err; @@ -187,13 +188,15 @@ if ((dof = dtrace_getopt_dof(dtp)) == NULL) return (-1); /* dt_errno has been set for us */ -printf("%s:%s(%d) ioctl DTRACEIOC_ENABLE\n",__FUNCTION__,__FILE__,__LINE__); - err = dt_ioctl(dtp, DTRACEIOC_ENABLE, dof); + args.dof = dof; + args.n_matched = 0; + err = dt_ioctl(dtp, DTRACEIOC_ENABLE, &args); dtrace_dof_destroy(dtp, dof); if (err == -1 && (errno != ENOTTY || dtp->dt_vector == NULL)) return (dt_set_errno(dtp, errno)); +printf("%s: ioctl DTRACEIOC_GO\n",__FUNCTION__); if (dt_ioctl(dtp, DTRACEIOC_GO, &dtp->dt_beganon) == -1) { if (errno == EACCES) return (dt_set_errno(dtp, EDT_DESTRUCTIVE));
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200604240239.k3O2dddq071111>