From owner-freebsd-current@FreeBSD.ORG Mon Dec 3 17:09:54 2007 Return-Path: Delivered-To: current@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3D3C316A468 for ; Mon, 3 Dec 2007 17:09:54 +0000 (UTC) (envelope-from julian@elischer.org) Received: from outG.internet-mail-service.net (outG.internet-mail-service.net [216.240.47.230]) by mx1.freebsd.org (Postfix) with ESMTP id 2312A13C45D for ; Mon, 3 Dec 2007 17:09:53 +0000 (UTC) (envelope-from julian@elischer.org) Received: from mx0.idiom.com (HELO idiom.com) (216.240.32.160) by out.internet-mail-service.net (qpsmtpd/0.40) with ESMTP; Mon, 03 Dec 2007 09:09:53 -0800 X-Client-Authorized: MaGic Cook1e X-Client-Authorized: MaGic Cook1e X-Client-Authorized: MaGic Cook1e X-Client-Authorized: MaGic Cook1e Received: from julian-mac.elischer.org (home.elischer.org [216.240.48.38]) by idiom.com (Postfix) with ESMTP id E0B75126BA8; Mon, 3 Dec 2007 09:09:49 -0800 (PST) Message-ID: <47543861.8050107@elischer.org> Date: Mon, 03 Dec 2007 09:09:53 -0800 From: Julian Elischer User-Agent: Thunderbird 2.0.0.9 (Macintosh/20071031) MIME-Version: 1.0 To: Robert Watson References: <20071202233435.G74097@fledge.watson.org> <20071203032422.GC30756@heff.fud.org.nz> <20071203090800.U74097@fledge.watson.org> <20071203093531.GA31649@heff.fud.org.nz> <20071203102219.N79674@fledge.watson.org> In-Reply-To: <20071203102219.N79674@fledge.watson.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: hackers@FreeBSD.org, current@FreeBSD.org, Andrew Thompson Subject: Re: procstat(1) committed to CVS HEAD X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Dec 2007 17:09:54 -0000 Robert Watson wrote: > > On Mon, 3 Dec 2007, Andrew Thompson wrote: > >>>> I would like to give some feedback. I listed the threads of proc 12 >>>> which >>>> is intr, >>>> >>>> # procstat -t 12 >>>> PID TID COMM CPU PRI STATE WCHAN >>>> 12 100003 intr 0 40 wait - >>>> 12 100004 intr 0 52 wait - >>>> 12 100030 intr 0 16 wait - >>>> [...] >>>> 12 100036 intr 0 36 wait - >>>> 12 100037 intr 0 24 wait - >>>> >>>> I had expected it to show the thread name such as 'irq14: ata0', is >>>> this possible (and a good thing to do)? >>> >>> I just print out the 'comm' field returned by the generic sysctl, and >>> I notice that top(1) with -S is now having the same problem as >>> procstat(1). I think this is a kernel bug in how we initialize or >>> otherwise handle thread names, and fairly recent, as it's not present >>> on my 7.0BETA2 box. If I had to guess, it's that these are now 'true >>> threads' under the single 'intr' proc, and that we're not exporting >>> the thread name? >> >> Changing to ki_ocomm gets the desired result for single and >> multithreaded processes. > > I wonder if we should be renaming ki_ocomm to ki_tdcomm or ki_tdname? we probably should now, originally there was still a used fo it somewhere but I think it's probably been fixed by now (that was many years ago). ki_tdname woudl be best. or better still, make a scheme where we actually returned thread info separate from process info. > > Robert N M Watson > Computer Laboratory > University of Cambridge > >> >> >> Andrew >> >> Index: procstat_threads.c >> =================================================================== >> RCS file: /home/ncvs/src/usr.bin/procstat/procstat_threads.c,v >> retrieving revision 1.1 >> diff -u -p -r1.1 procstat_threads.c >> --- procstat_threads.c 2 Dec 2007 23:31:45 -0000 1.1 >> +++ procstat_threads.c 3 Dec 2007 06:06:46 -0000 >> @@ -82,8 +82,8 @@ procstat_threads(pid_t pid, struct kinfo >> kipp = &kip[i]; >> printf("%5d ", pid); >> printf("%6d ", kipp->ki_tid); >> - printf("%-20s ", strlen(kipp->ki_comm) ? >> - kipp->ki_comm : "-"); >> + printf("%-20s ", strlen(kipp->ki_ocomm) ? >> + kipp->ki_ocomm : "-"); >> if (kipp->ki_oncpu != 255) >> printf("%3d ", kipp->ki_oncpu); >> else if (kipp->ki_lastcpu != 255) >> >> > _______________________________________________ > freebsd-current@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-current > To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org"