From owner-svn-src-head@FreeBSD.ORG Mon Jul 30 22:48:36 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id F11131065670; Mon, 30 Jul 2012 22:48:35 +0000 (UTC) (envelope-from davide.italiano@gmail.com) Received: from mail-vb0-f54.google.com (mail-vb0-f54.google.com [209.85.212.54]) by mx1.freebsd.org (Postfix) with ESMTP id 7ABAB8FC12; Mon, 30 Jul 2012 22:48:35 +0000 (UTC) Received: by vbmv11 with SMTP id v11so6300227vbm.13 for ; Mon, 30 Jul 2012 15:48:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type; bh=M36M6m73AM/v+BUrisplv/aYE9WjQizm4AUYl1WcGsI=; b=HowAR4a67sECK5HGn975HJiFpyfcNh2Q9To7/UVdQg7q4ZaEpZ1h4KEAljkYMkkqp7 K9kJS25Ipn4+RoNS36Kj0L+Pa3ueOWFhKUdlpkb/PvhjhxQzNH62DLEvW0l2uiUGwOAN DH4pE+urw7SZ29u8u3HRttQYoLSxdqLNinoVQyzGjkKqQ/OAEgzTM/MC+7r4ryUCQJYf DdphOoA79QOTW5n93yw3aXIr+Vgp05r/3hbN1DnuMfOAseap0irrSx8pLVL6NVfIySI7 75U289f7sOCIE0aTupY3UloSO8MUFO2BW6FeukmffAnqYKfio8sKsOgDNtvtcwulydcz gXNg== MIME-Version: 1.0 Received: by 10.52.71.79 with SMTP id s15mr11049523vdu.86.1343688514800; Mon, 30 Jul 2012 15:48:34 -0700 (PDT) Sender: davide.italiano@gmail.com Received: by 10.58.196.170 with HTTP; Mon, 30 Jul 2012 15:48:34 -0700 (PDT) In-Reply-To: <201207302246.q6UMkgcA053639@svn.freebsd.org> References: <201207302246.q6UMkgcA053639@svn.freebsd.org> Date: Tue, 31 Jul 2012 00:48:34 +0200 X-Google-Sender-Auth: B4Ow7mcCRKQK2sE5XYltxqpiItM Message-ID: From: Davide Italiano To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 Cc: Subject: Re: svn commit: r238925 - in head/sys: conf kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Jul 2012 22:48:36 -0000 On Tue, Jul 31, 2012 at 12:46 AM, Davide Italiano wrote: > Author: davide > Date: Mon Jul 30 22:46:42 2012 > New Revision: 238925 > URL: http://svn.freebsd.org/changeset/base/238925 > > Log: > Until now KTR_ENTRIES, which defines the size of circular buffer used in > ktr(4), was constrained to be a power of two. Remove this constraint and > update sys/conf/NOTES accordingly. > > Reviewed by: jhb > Approved by: gnn (mentor) > Sponsored by: Google Summer of Code 2012 > > Modified: > head/sys/conf/NOTES > head/sys/kern/kern_ktr.c > > Modified: head/sys/conf/NOTES > ============================================================================== > --- head/sys/conf/NOTES Mon Jul 30 21:58:28 2012 (r238924) > +++ head/sys/conf/NOTES Mon Jul 30 22:46:42 2012 (r238925) > @@ -435,7 +435,7 @@ options KTRACE_REQUEST_POOL=101 > # > # KTR is a kernel tracing facility imported from BSD/OS. It is > # enabled with the KTR option. KTR_ENTRIES defines the number of > -# entries in the circular trace buffer; it must be a power of two. > +# entries in the circular trace buffer; it may be an arbitrary number. > # KTR_COMPILE defines the mask of events to compile into the kernel as > # defined by the KTR_* constants in . KTR_MASK defines the > # initial value of the ktr_mask variable which determines at runtime > > Modified: head/sys/kern/kern_ktr.c > ============================================================================== > --- head/sys/kern/kern_ktr.c Mon Jul 30 21:58:28 2012 (r238924) > +++ head/sys/kern/kern_ktr.c Mon Jul 30 22:46:42 2012 (r238925) > @@ -283,7 +283,7 @@ ktr_tracepoint(u_int mask, const char *f > { > do { > saveindex = ktr_idx; > - newindex = (saveindex + 1) & (KTR_ENTRIES - 1); > + newindex = (saveindex + 1) % KTR_ENTRIES; > } while (atomic_cmpset_rel_int(&ktr_idx, saveindex, newindex) == 0); > entry = &ktr_buf[saveindex]; > } > @@ -338,7 +338,7 @@ static int db_mach_vtrace(void); > DB_SHOW_COMMAND(ktr, db_ktr_all) > { > > - tstate.cur = (ktr_idx - 1) & (KTR_ENTRIES - 1); > + tstate.cur = (ktr_idx - 1) % KTR_ENTRIES; > tstate.first = -1; > db_ktr_verbose = 0; > db_ktr_verbose |= (strchr(modif, 'v') != NULL) ? 2 : 0; I forget this: MFC after: 3 days.