From owner-freebsd-hackers@FreeBSD.ORG Sun Mar 30 14:07:34 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 141C3AB7 for ; Sun, 30 Mar 2014 14:07:34 +0000 (UTC) Received: from mail-ob0-x230.google.com (mail-ob0-x230.google.com [IPv6:2607:f8b0:4003:c01::230]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D3425FB2 for ; Sun, 30 Mar 2014 14:07:33 +0000 (UTC) Received: by mail-ob0-f176.google.com with SMTP id wp18so7894925obc.7 for ; Sun, 30 Mar 2014 07:07:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=Xa0yB+4JgArHSwinHQN8w0sJIssbfrPAo6SsQHU4mVU=; b=O9aDYrzuqdQ7lWtNq6DE3bbdNGmD2x9PgenNIP3FCqbSIxYQLE5GJ0E0AudJxhzHi2 mMlF0W20FGiKsQBIfaE/7i/8vepyi8/hQqB90ZJF5YJaaKINTBWsziIcdXqW+Od5JT0H IYkVUDmDhHd21LIIATzu8sjKTG0/uuhD1m7abrLPRlY3WqW1HsD2NTNhBzeQCjmda4Qj RPoiu//B5qKX/tEehQdNfs8UfvW/AeDzzQDwuAl6162Z3iKDuwi1x5Dy5Tjk8OKRzbXW S7bTCPc7xflB1pSqx6MPIK4R/5cW+bdriI804bZL79Xc/RtR8cXM0PprF9p5YKuiTlqO VniQ== MIME-Version: 1.0 X-Received: by 10.182.192.40 with SMTP id hd8mr520400obc.50.1396188453208; Sun, 30 Mar 2014 07:07:33 -0700 (PDT) Received: by 10.76.7.199 with HTTP; Sun, 30 Mar 2014 07:07:33 -0700 (PDT) In-Reply-To: <363F98EE-AF54-475D-AF4A-F99BD3D3CCF9@gsoft.com.au> References: <363F98EE-AF54-475D-AF4A-F99BD3D3CCF9@gsoft.com.au> Date: Sun, 30 Mar 2014 10:07:33 -0400 Message-ID: Subject: Re: Profiling shared libraries From: Ryan Stone To: "Daniel O'Connor" Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable 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: Sun, 30 Mar 2014 14:07:34 -0000 On Sat, Mar 29, 2014 at 10:43 PM, Daniel O'Connor w= rote: > Hi, > I have a shared library which is loaded into a Tcl interpreter and also l= oads submodules and I would like to profile it. Unfortunately it seems gpro= f does not grok shared libraries. I did some googling and it look like Linu= x has sprof for this but I can't see a port for FreeBSD. > > Does anyone have any other ideas? > I have looked at DTrace but it's a bit fiddly to get working with my syst= ems in the field so I'd prefer a pure userland solution if possible. > > Thanks hwpmc can do it: kldload hwpmc pmcstat -S unhalted-cycles -O /tmp/samples.out sleep 10 pmcstat -R /tmp/samples.out -G /tmp/callgraph.txt