From owner-svn-src-all@FreeBSD.ORG Wed Dec 3 15:53:28 2008 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E687F1065680; Wed, 3 Dec 2008 15:53:28 +0000 (UTC) (envelope-from prvs=julian=216e3e3bb@elischer.org) Received: from smtp-outbound.ironport.com (smtp-outbound.ironport.com [63.251.108.112]) by mx1.freebsd.org (Postfix) with ESMTP id 24D658FC14; Wed, 3 Dec 2008 15:53:27 +0000 (UTC) (envelope-from prvs=julian=216e3e3bb@elischer.org) Received: from unknown (HELO julian-mac.elischer.org) ([10.251.60.27]) by smtp-outbound.ironport.com with ESMTP; 03 Dec 2008 07:24:57 -0800 Message-ID: <4936A4C8.7010906@elischer.org> Date: Wed, 03 Dec 2008 07:24:56 -0800 From: Julian Elischer User-Agent: Thunderbird 2.0.0.18 (Macintosh/20081105) MIME-Version: 1.0 To: Konstantin Belousov References: <200812031510.mB3FAV29094116@svn.freebsd.org> In-Reply-To: <200812031510.mB3FAV29094116@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-releng@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r185581 - releng/7.1/share/man/man9 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Dec 2008 15:53:29 -0000 Konstantin Belousov wrote: > Author: kib > Date: Wed Dec 3 15:10:31 2008 > New Revision: 185581 > URL: http://svn.freebsd.org/changeset/base/185581 > > Log: > MFC r185474: > > Clarify the reason to not use the volatile string as an argument to CTR > macros. Note the logging of file and line. > > Approved by: re (hrs) > > Modified: > releng/7.1/share/man/man9/ (props changed) > releng/7.1/share/man/man9/ktr.9 > > Modified: releng/7.1/share/man/man9/ktr.9 > ============================================================================== > --- releng/7.1/share/man/man9/ktr.9 Wed Dec 3 15:07:17 2008 (r185580) > +++ releng/7.1/share/man/man9/ktr.9 Wed Dec 3 15:10:31 2008 (r185581) > @@ -24,7 +24,7 @@ > .\" > .\" $FreeBSD$ > .\" > -.Dd December 27, 2005 > +.Dd November 30, 2008 > .Dt KTR 9 > .Os > .Sh NAME > @@ -84,9 +84,16 @@ Following the > .Fa format > string are zero to five arguments referenced by > .Fa format . > +Each event is logged with a file name and source line number of the > +originating CTR call, and a timestamp in addition to the log message. > +.Pp > +The event is stored in the circular buffer with supplied arguments as is, > +and formatting is done at the dump time. > +Do not use pointers to the objects with limited lifetime, for instance, > +strings, because the pointer may become invalid when buffer is printed. > +.Pp You might even expand more on this.. "In particular remember that process poineters and other structures that can get recycled should NOT be passed as they may be recycled before they are evaluated at dump time." I've seen proc* in htere before now.. > Note that the different macros differ only in the number of arguments each > one takes, as indicated by its name. > -Each event is logged with a timestamp in addition to the log message. > .Pp > The > .Va ktr_entries > @@ -121,13 +128,11 @@ mi_switch() > * Pick a new current process and record its start time. > */ > ... > - CTR3(KTR_PROC, "mi_switch: old proc %p (pid %d, %s)", p, p->p_pid, > - p->p_comm); > + CTR3(KTR_PROC, "mi_switch: old proc %p (pid %d)", p, p->p_pid); > ... > cpu_switch(); > ... > - CTR3(KTR_PROC, "mi_switch: new proc %p (pid %d, %s)", p, p->p_pid, > - p->p_comm); > + CTR3(KTR_PROC, "mi_switch: new proc %p (pid %d)", p, p->p_pid); > ... > } > .Ed