Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 27 Nov 2017 18:42:23 +0000 (UTC)
From:      Mark Johnston <markj@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r326286 - head/sys/cddl/dev/dtrace
Message-ID:  <201711271842.vARIgNCk007369@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: markj
Date: Mon Nov 27 18:42:23 2017
New Revision: 326286
URL: https://svnweb.freebsd.org/changeset/base/326286

Log:
  Don't use pcpu_find() to determine if a CPU ID is valid.
  
  This addresses assertion failures after r326218.
  
  MFC after:	1 week

Modified:
  head/sys/cddl/dev/dtrace/dtrace_ioctl.c

Modified: head/sys/cddl/dev/dtrace/dtrace_ioctl.c
==============================================================================
--- head/sys/cddl/dev/dtrace/dtrace_ioctl.c	Mon Nov 27 17:54:17 2017	(r326285)
+++ head/sys/cddl/dev/dtrace/dtrace_ioctl.c	Mon Nov 27 18:42:23 2017	(r326286)
@@ -231,10 +231,8 @@ dtrace_ioctl(struct cdev *dev, u_long cmd, caddr_t add
 		    "DTRACEIOC_AGGSNAP":"DTRACEIOC_BUFSNAP",
 		    curcpu, desc.dtbd_cpu);
 
-		if (desc.dtbd_cpu >= NCPU)
+		if (desc.dtbd_cpu >= MAXCPU || CPU_ABSENT(desc.dtbd_cpu))
 			return (ENOENT);
-		if (pcpu_find(desc.dtbd_cpu) == NULL)
-			return (ENOENT);
 
 		mutex_enter(&dtrace_lock);
 
@@ -797,11 +795,7 @@ dtrace_ioctl(struct cdev *dev, u_long cmd, caddr_t add
 		nerrs = state->dts_errors;
 		dstate = &state->dts_vstate.dtvs_dynvars;
 
-		for (i = 0; i < NCPU; i++) {
-#ifndef illumos
-			if (pcpu_find(i) == NULL)
-				continue;
-#endif
+		CPU_FOREACH(i) {
 			dtrace_dstate_percpu_t *dcpu = &dstate->dtds_percpu[i];
 
 			stat->dtst_dyndrops += dcpu->dtdsc_drops;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201711271842.vARIgNCk007369>