From owner-freebsd-current@FreeBSD.ORG Tue Mar 21 18:30:18 2006 Return-Path: X-Original-To: current@freebsd.org Delivered-To: freebsd-current@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8357A16A420; Tue, 21 Mar 2006 18:30:18 +0000 (UTC) (envelope-from gallatin@cs.duke.edu) Received: from duke.cs.duke.edu (duke.cs.duke.edu [152.3.140.1]) by mx1.FreeBSD.org (Postfix) with ESMTP id C873843D62; Tue, 21 Mar 2006 18:30:11 +0000 (GMT) (envelope-from gallatin@cs.duke.edu) Received: from grasshopper.cs.duke.edu (grasshopper.cs.duke.edu [152.3.145.30]) by duke.cs.duke.edu (8.13.4/8.13.4) with ESMTP id k2LIUAbT016648 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 21 Mar 2006 13:30:10 -0500 (EST) Received: (from gallatin@localhost) by grasshopper.cs.duke.edu (8.12.9p2/8.12.9/Submit) id k2LIU5iS061413; Tue, 21 Mar 2006 13:30:05 -0500 (EST) (envelope-from gallatin) From: Andrew Gallatin MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <17440.17965.497455.777452@grasshopper.cs.duke.edu> Date: Tue, 21 Mar 2006 13:30:05 -0500 (EST) To: "Joseph Koshy" In-Reply-To: <84dead720603202346t6fe1e94cve033bf002dffa90a@mail.gmail.com> References: <20060223143856.O9642@fledge.watson.org> <17405.53911.686306.362353@grasshopper.cs.duke.edu> <84dead720603202346t6fe1e94cve033bf002dffa90a@mail.gmail.com> X-Mailer: VM 6.75 under 21.1 (patch 12) "Channel Islands" XEmacs Lucid Cc: Robert Watson , current@freebsd.org Subject: Re: The sixty second pmc howto 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: Tue, 21 Mar 2006 18:30:18 -0000 Joseph Koshy writes: > >>>> "ag" == "Andrew Gallatin " said: > > ag> My only problem with hwpmc is that it will not work for kernel > ag> modules. > > The following patch implements support for profiling of > dynamically loaded kernel modules and dlopen()'ed (userland) > shared objects. Cool! It seems to work, though not the way I was hoping for :( When I profile my module, I do: % sudo pmcstat -S unhalted-cycles -O sample.out % pmcstat -R sample.out -g This leaves me with one .gmon file for each loaded module: % ls -l k8-bu-cpu-clk-unhalted/ total 1566 -rw-r--r-- 1 gallatin wheel 19070 Mar 21 13:11 hwpmc.ko.gmon -rw-r--r-- 1 gallatin wheel 8892 Mar 21 13:11 if_myri10ge.ko.gmon -rw-r--r-- 1 gallatin wheel 1547196 Mar 21 13:11 kernel.gmon For a few modules, I suppose it is OK. But it makes it hard to see the "big picture" when a number of modules are loaded. Is there any chance you have enough information to hack together a view similar to oprofile's opreport -l? Or (even better) opreport -ld Drew