From owner-p4-projects@FreeBSD.ORG Wed Apr 26 04:33:10 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 0D87E16A403; Wed, 26 Apr 2006 04:33:10 +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 E1CD316A401 for ; Wed, 26 Apr 2006 04:33:09 +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 928FC43D46 for ; Wed, 26 Apr 2006 04:33:09 +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 k3Q4X9Uw037204 for ; Wed, 26 Apr 2006 04:33:09 GMT (envelope-from jb@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.1/8.13.1/Submit) id k3Q4X9fQ037198 for perforce@freebsd.org; Wed, 26 Apr 2006 04:33:09 GMT (envelope-from jb@freebsd.org) Date: Wed, 26 Apr 2006 04:33:09 GMT Message-Id: <200604260433.k3Q4X9fQ037198@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 96134 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: Wed, 26 Apr 2006 04:33:10 -0000 http://perforce.freebsd.org/chv.cgi?CH=96134 Change 96134 by jb@jb_freebsd2 on 2006/04/26 04:33:03 SysV -> BSD ioctl changes. There are still a few hacks here. Need to get the max CPU ID via a sysctl. Affected files ... .. //depot/projects/dtrace/src/contrib/opensolaris/lib/libdtrace/common/dt_consume.c#5 edit Differences ... ==== //depot/projects/dtrace/src/contrib/opensolaris/lib/libdtrace/common/dt_consume.c#5 (text) ==== @@ -1747,13 +1747,20 @@ dt_begin_t begin; processorid_t cpu = dtp->dt_beganon; dtrace_bufdesc_t nbuf; +#if !defined(sun) + dtrace_bufdesc_t *pbuf; +#endif int rval, i; static int max_ncpus; dtrace_optval_t size; dtp->dt_beganon = -1; +#if defined(sun) if (dt_ioctl(dtp, DTRACEIOC_BUFSNAP, buf) == -1) { +#else + if (dt_ioctl(dtp, DTRACEIOC_BUFSNAP, &buf) == -1) { +#endif /* * We really don't expect this to fail, but it is at least * technically possible for this to fail with ENOENT. In this @@ -1807,9 +1814,11 @@ return (dt_set_errno(dtp, EDT_NOMEM)); printf("%s:%s(%d): DOODAD\n",__FUNCTION__,__FILE__,__LINE__); + if (max_ncpus == 0) #ifdef DOODAD - if (max_ncpus == 0) max_ncpus = dt_sysconf(dtp, _SC_CPUID_MAX) + 1; +else + max_ncpus = 1; #endif for (i = 0; i < max_ncpus; i++) { @@ -1818,7 +1827,12 @@ if (i == cpu) continue; +#if defined(sun) if (dt_ioctl(dtp, DTRACEIOC_BUFSNAP, &nbuf) == -1) { +#else + pbuf = &nbuf; + if (dt_ioctl(dtp, DTRACEIOC_BUFSNAP, &pbuf) == -1) { +#endif /* * If we failed with ENOENT, it may be because the * CPU was unconfigured -- this is okay. Any other @@ -1887,10 +1901,12 @@ if (!dtp->dt_active) return (dt_set_errno(dtp, EINVAL)); -printf("%s:%s(%d): DOODAD\n",__FUNCTION__,__FILE__,__LINE__); +printf("%s:%s(%d): dt_sysconf _SC_CPUID_MAX\n",__FUNCTION__,__FILE__,__LINE__); + if (max_ncpus == 0) #ifdef DOODAD - if (max_ncpus == 0) max_ncpus = dt_sysconf(dtp, _SC_CPUID_MAX) + 1; +#else + max_ncpus = 1; #endif if (pf == NULL) @@ -1928,7 +1944,11 @@ if (dtp->dt_stopped && (i == dtp->dt_endedon)) continue; +#if defined(sun) if (dt_ioctl(dtp, DTRACEIOC_BUFSNAP, buf) == -1) { +#else + if (dt_ioctl(dtp, DTRACEIOC_BUFSNAP, &buf) == -1) { +#endif /* * If we failed with ENOENT, it may be because the * CPU was unconfigured -- this is okay. Any other @@ -1949,7 +1969,11 @@ buf->dtbd_cpu = dtp->dt_endedon; +#if defined(sun) if (dt_ioctl(dtp, DTRACEIOC_BUFSNAP, buf) == -1) { +#else + if (dt_ioctl(dtp, DTRACEIOC_BUFSNAP, buf) == -1) { +#endif /* * This _really_ shouldn't fail, but it is strictly speaking * possible for this to return ENOENT if the CPU that called