From owner-freebsd-hackers Tue May 14 21:15:20 2002 Delivered-To: freebsd-hackers@freebsd.org Received: from resnet.uoregon.edu (resnet.uoregon.edu [128.223.122.47]) by hub.freebsd.org (Postfix) with ESMTP id 9F3D537B404 for ; Tue, 14 May 2002 21:15:17 -0700 (PDT) Received: from localhost (dwhite@localhost) by resnet.uoregon.edu (8.11.3/8.10.1) with ESMTP id g4F4FGI71668; Tue, 14 May 2002 21:15:17 -0700 (PDT) Date: Tue, 14 May 2002 21:15:16 -0700 (PDT) From: Doug White To: Zhihui Zhang Cc: freebsd-hackers@FreeBSD.ORG Subject: Re: Collect process sleeping statistics In-Reply-To: Message-ID: <20020514211310.I70761-100000@resnet.uoregon.edu> X-All-Your-Base: are belong to us MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Mon, 13 May 2002, Zhihui Zhang wrote: > A process can sleep for various reasons such as memory, I/O etc. Is there > a way to collect statistics about how long it sleeps for different > reasons? Thanks. I don't think it's actually accounted for anywhere, but if a process does go to sleep the WCHAN will be filled in and visible in top and ps. You could write a program to collect the WCHANs every so often and build some course stats. And if you really wanted to get fancy it might not be too hard to build a scheduler or hz-driven procedure to log them directly in the kernel. Doug White | FreeBSD: The Power to Serve dwhite@resnet.uoregon.edu | www.FreeBSD.org To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message