From owner-p4-projects@FreeBSD.ORG Mon Apr 24 02:39:40 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 061D416A407; Mon, 24 Apr 2006 02:39:40 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id BFED916A400 for ; Mon, 24 Apr 2006 02:39:39 +0000 (UTC) (envelope-from jb@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 872EB43D4C for ; Mon, 24 Apr 2006 02:39:39 +0000 (GMT) (envelope-from jb@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.1/8.13.1) with ESMTP id k3O2ddWw071117 for ; Mon, 24 Apr 2006 02:39:39 GMT (envelope-from jb@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id k3O2dddq071111 for perforce@freebsd.org; Mon, 24 Apr 2006 02:39:39 GMT (envelope-from jb@freebsd.org) Date: Mon, 24 Apr 2006 02:39:39 GMT Message-Id: <200604240239.k3O2dddq071111@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to jb@freebsd.org using -f From: John Birrell To: Perforce Change Reviews Cc: Subject: PERFORCE change 95982 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Apr 2006 02:39:40 -0000 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));