From owner-freebsd-threads@FreeBSD.ORG Tue May 11 14:32:58 2004 Return-Path: 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 F256D16A4CE for ; Tue, 11 May 2004 14:32:57 -0700 (PDT) Received: from mail6.speakeasy.net (mail6.speakeasy.net [216.254.0.206]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9BBB543D41 for ; Tue, 11 May 2004 14:32:57 -0700 (PDT) (envelope-from jhb@FreeBSD.org) Received: (qmail 8432 invoked from network); 11 May 2004 21:32:57 -0000 Received: from dsl027-160-063.atl1.dsl.speakeasy.net (HELO server.baldwin.cx) ([216.27.160.63]) (envelope-sender ) encrypted SMTP for ; 11 May 2004 21:32:57 -0000 Received: from 10.50.40.205 (gw1.twc.weather.com [216.133.140.1]) by server.baldwin.cx (8.12.11/8.12.11) with ESMTP id i4BLWsp0006894; Tue, 11 May 2004 17:32:54 -0400 (EDT) (envelope-from jhb@FreeBSD.org) From: John Baldwin To: threads@FreeBSD.org Date: Tue, 11 May 2004 17:33:19 -0400 User-Agent: KMail/1.6 MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Message-Id: <200405111733.19783.jhb@FreeBSD.org> X-Spam-Checker-Version: SpamAssassin 2.63 (2004-01-11) on server.baldwin.cx cc: Bruce Evans Subject: Threads and userland profliing... X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 May 2004 21:32:58 -0000 Currently in the pstats structure we have a uprof substructure that holds various values used for userland processing. Does anyone know what parts of that structure are supposed to be per-process and which are supposed to be per-thread? pr_addr and pr_ticks seem to be definite per-thread items, but the other values I'm not sure of. Specifically, is the userland table that pr_base, pr_size, pr_off, and pr_scale refer to per-thread or is it supposed to be shared among all threads in a process? If it's shared, do we need to be using casuptr() or something similar in addupc_intr() instead of a separate fetch and store? addupc_task() also has a race window between the copyin() and copyout() as well if it is shared. If its private, then I suppose each thread has to call profil(2) and gprof is supposed to be smart enough to make that happen? Does POSIX have anything to say regarding threads and profil(2)? I'm trying to lock this small structure and I'd like to know if all of uprof should be per-thread or just pr_addr and pr_ticks. P.S. Please cc me on replies as I am not subscribed. -- John Baldwin <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve" = http://www.FreeBSD.org