From owner-freebsd-threads@FreeBSD.ORG Wed Feb 1 20:31:58 2006 Return-Path: X-Original-To: freebsd-threads@freebsd.org Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E652B16A420; Wed, 1 Feb 2006 20:31:58 +0000 (GMT) (envelope-from julian@elischer.org) Received: from a50.ironport.com (a50.ironport.com [63.251.108.112]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7D71F43D60; Wed, 1 Feb 2006 20:31:58 +0000 (GMT) (envelope-from julian@elischer.org) Received: from unknown (HELO [10.251.17.229]) ([10.251.17.229]) by a50.ironport.com with ESMTP; 01 Feb 2006 12:31:58 -0800 Message-ID: <43E11ABD.6050503@elischer.org> Date: Wed, 01 Feb 2006 12:31:57 -0800 From: Julian Elischer User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.7.11) Gecko/20050727 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Daniel Eischen References: In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Cc: Ilya E Veretenkin , freebsd-threads@freebsd.org Subject: Re: getting particular thread cpu time X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Feb 2006 20:31:59 -0000 Daniel Eischen wrote: >On Wed, 1 Feb 2006, Julian Elischer wrote: > > > >>Daniel Eischen wrote: >> >> >> >>>Libpthread is M:N by default, so the kernel doesn't know about >>>userland threads. >>> >>> >>> >>> >>though we might think about ways that we can get that information.. >>maybe a way that the user thread scheduler can be asked for the info? >> >> > >We don't currently maintain per-thread system and user time. >It's not just that either, there has to be some way to identify >each thread and the kernel would need that info (name, thread >id, ??) also. You _could_ add pthread_getrusage_np(), or >something like that, to the threads libraries which would >make it visible to the application, but I hesitate to think >this information would be useful to the kernel so that ps >and top can show it. I think ps and top should just show >the kernel entities and that's it. I wouldn't strongly >oppose making these utilities show userland thread info >as long as it didn't impact performance. > > I was thinking of a tool to help developers do usage monitoring on their programs. as a debugging aid.. We DO put usage information into the KSE mailbox do we not? when you come back from a kernel call you should find stats there from memory. (however I'm not going to go look now as I need to get on with $REALJOB and have promised myself that this will wait until I get enough time to do teh stats properly.