From owner-freebsd-hackers@FreeBSD.ORG Tue Apr 1 02:00:19 2014 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 8F45F496 for ; Tue, 1 Apr 2014 02:00:19 +0000 (UTC) Received: from cain.gsoft.com.au (cain.gsoft.com.au [203.31.81.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E656E21B for ; Tue, 1 Apr 2014 02:00:18 +0000 (UTC) Received: from ur.gsoft.com.au (Ur.gsoft.com.au [203.31.81.34]) (authenticated bits=0) by cain.gsoft.com.au (8.14.4/8.14.3) with ESMTP id s311xhLZ058662 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Tue, 1 Apr 2014 12:29:57 +1030 (CST) (envelope-from doconnor@gsoft.com.au) Subject: Re: Profiling shared libraries Mime-Version: 1.0 (Mac OS X Mail 7.2 \(1874\)) Content-Type: multipart/signed; boundary="Apple-Mail=_A76B0579-FC20-4FB9-B170-A3DAF3B83C13"; protocol="application/pgp-signature"; micalg=pgp-sha1 From: "Daniel O'Connor" In-Reply-To: Date: Tue, 1 Apr 2014 12:29:56 +1030 Message-Id: References: <363F98EE-AF54-475D-AF4A-F99BD3D3CCF9@gsoft.com.au> To: Ryan Stone X-Mailer: Apple Mail (2.1874) X-Spam-Score: -3.551 () ALL_TRUSTED,BAYES_00,RP_MATCHES_RCVD X-Scanned-By: MIMEDefang 2.67 on 203.31.81.10 Cc: FreeBSD Hackers X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Apr 2014 02:00:19 -0000 --Apple-Mail=_A76B0579-FC20-4FB9-B170-A3DAF3B83C13 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=iso-8859-1 On 31 Mar 2014, at 0:37, Ryan Stone wrote: > On Sat, Mar 29, 2014 at 10:43 PM, Daniel O'Connor = wrote: >> Hi, >> I have a shared library which is loaded into a Tcl interpreter and = also loads submodules and I would like to profile it. Unfortunately it = seems gprof does not grok shared libraries. I did some googling and it = look like Linux has sprof for this but I can't see a port for FreeBSD. >>=20 >> Does anyone have any other ideas? >> I have looked at DTrace but it's a bit fiddly to get working with my = systems in the field so I'd prefer a pure userland solution if possible. >>=20 >> Thanks >=20 > hwpmc can do it: >=20 > kldload hwpmc > pmcstat -S unhalted-cycles -O /tmp/samples.out sleep 10 > pmcstat -R /tmp/samples.out -G /tmp/callgraph.txt Great, thanks! -- Daniel O'Connor software and network engineer for Genesis Software - http://www.gsoft.com.au "The nice thing about standards is that there are so many of them to choose from." -- Andrew Tanenbaum GPG Fingerprint - 5596 B766 97C0 0E94 4347 295E E593 DC20 7B3F CE8C --Apple-Mail=_A76B0579-FC20-4FB9-B170-A3DAF3B83C13 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - http://gpgtools.org iD8DBQFTOh2c5ZPcIHs/zowRAjBeAKCIApGXtDcxGCFnZyaHOi3Q2tRdMQCfTkSe VFv7TfTUvJ9sUWw5xHAHXZg= =++Dn -----END PGP SIGNATURE----- --Apple-Mail=_A76B0579-FC20-4FB9-B170-A3DAF3B83C13--