Date: Fri, 8 Dec 2017 16:25:05 +0000 (UTC) From: Mark Johnston <markj@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r326697 - stable/11/sys/cddl/dev/dtrace Message-ID: <201712081625.vB8GP5QW005730@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: markj Date: Fri Dec 8 16:25:05 2017 New Revision: 326697 URL: https://svnweb.freebsd.org/changeset/base/326697 Log: MFC r326286: Don't use pcpu_find() to determine if a CPU ID is valid. Modified: stable/11/sys/cddl/dev/dtrace/dtrace_ioctl.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/cddl/dev/dtrace/dtrace_ioctl.c ============================================================================== --- stable/11/sys/cddl/dev/dtrace/dtrace_ioctl.c Fri Dec 8 16:12:45 2017 (r326696) +++ stable/11/sys/cddl/dev/dtrace/dtrace_ioctl.c Fri Dec 8 16:25:05 2017 (r326697) @@ -236,10 +236,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); @@ -801,11 +799,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?201712081625.vB8GP5QW005730>