From owner-freebsd-questions@FreeBSD.ORG Thu May 31 08:18:44 2007 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 031CD16A41F for ; Thu, 31 May 2007 08:18:44 +0000 (UTC) (envelope-from kayama@personal-media.co.jp) Received: from net1.personal-media.co.jp (net1.personal-media.co.jp [61.197.224.164]) by mx1.freebsd.org (Postfix) with ESMTP id C1E3E13C45A for ; Thu, 31 May 2007 08:18:43 +0000 (UTC) (envelope-from kayama@personal-media.co.jp) Received: from pcsv1.personal-media.co.jp (net2 [192.168.201.168]) by net1.personal-media.co.jp (Postfix) with ESMTP id 703ADAE13E for ; Thu, 31 May 2007 17:18:42 +0900 (JST) Received: from localhost (r53 [192.9.200.153]) by pcsv1.personal-media.co.jp (Postfix) with ESMTP id 638533598A for ; Thu, 31 May 2007 17:18:42 +0900 (JST) Date: Thu, 31 May 2007 17:18:42 +0900 (GMT-9) Message-Id: <20070531.171842.91755455.kayama@personal-media.co.jp> To: freebsd-questions@freebsd.org From: Akihiro KAYAMA In-Reply-To: <20070531032505.GB26400@ayn.mi.celestial.com> References: <465DB587.6010109@mac.com> <20070531.114515.133762361.kayama@personal-media.co.jp> <20070531032505.GB26400@ayn.mi.celestial.com> X-Mailer: Mew version 3.3 on Emacs 21.2 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Subject: Re: wall-clock time profiling X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 May 2007 08:18:44 -0000 In article <20070531032505.GB26400@ayn.mi.celestial.com>, Bill Campbell writes: freebsd> On Thu, May 31, 2007, Akihiro KAYAMA wrote: freebsd> >In article <465DB587.6010109@mac.com>, freebsd> >Chuck Swiger writes: freebsd> > freebsd> >cswiger> Akihiro KAYAMA wrote: freebsd> >cswiger> > Hi all. freebsd> >cswiger> > freebsd> >cswiger> > What is the right way to measure wall-clock time in profiling on FreeBSD? freebsd> >cswiger> freebsd> >cswiger> The time shell builtin command or "/usr/bin/time -l _program_"? freebsd> >cswiger> freebsd> >cswiger> The latter variant displays the rusage struct (ie, from "man getrusage")? freebsd> > freebsd> >Thanks for your response. freebsd> > freebsd> >Yes, we can know whether the program is I/O bound or CPU bound by freebsd> >time(1). But it is still unclear which part of the program is really freebsd> >waiting for I/O. So profiling is needed for tuning, although CPU time freebsd> >profiling gives me non-distinct result on I/O bound programs. It is freebsd> >reason why I want wall-clock time profiling. freebsd> freebsd> Wall clock time doesn't generally tell you anything reliably freebsd> useful on a multi-tasking system as it's very dependent on other freebsd> system activity. I had many fights back in the mid '70s with freebsd> people in accounting who wanted to bill wall-clock time on freebsd> Burroughs main frames which generally had 20 programs in the mix freebsd> at any time (I guess they were accustomed to IBM 360s that freebsd> couldn't walk and chew gum at the same time :-). Yes, I know UNIX was born as TSS in 1970. And today I occupy my FreeBSD box. It is not necessary to share it with my colleagues. Thanks to Moore's Law and so many FreeBSD guys. It is easy to prepare a dedicated machine for debugging purpose and run a test program only. Daemons are still running in background but they are almost asleep (load averages: 0.00) so will not be critical on wall-clock time profiling. Wall-clock time profiling will be useful to know what routines/system calls take time in complex code, especially I/O related routines. -- Akihiro KAYAMA