From owner-freebsd-stable@FreeBSD.ORG Wed Jan 14 14:17:07 2015 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5E0D7FD5 for ; Wed, 14 Jan 2015 14:17:07 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1B5757EE for ; Wed, 14 Jan 2015 14:17:07 +0000 (UTC) Received: from new-host.home (pool-173-70-85-31.nwrknj.fios.verizon.net [173.70.85.31]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id C6899B91E; Wed, 14 Jan 2015 09:17:04 -0500 (EST) Message-ID: <54B67A60.2000708@FreeBSD.org> Date: Wed, 14 Jan 2015 09:17:04 -0500 From: John Baldwin User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 MIME-Version: 1.0 To: "O'Connor, Daniel" , FreeBSD Stable Mailing List Subject: Re: DTrace and function names References: In-Reply-To: Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Wed, 14 Jan 2015 09:17:04 -0500 (EST) X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Jan 2015 14:17:07 -0000 On 1/12/15 7:20 PM, O'Connor, Daniel wrote: > Hi, > I am trying to debug why astro/gpsd uses a lot of CPU so I thought I'd try the 'hotuser' Dtrace toolkit script but the output looks like so.. > [midget 9:24] ~ >sudo /usr/local/share/DTraceToolkit/hotuser -p 37690 > Password: > Sampling... Hit Ctrl-C to end. > ^C > FUNCTION COUNT PCNT > libc.so.7`0x801631777 1 0.0% > libc.so.7`strtol 1 0.0% > libc.so.7`0x801631658 1 0.0% > libc.so.7`0x801631625 1 0.0% > libc.so.7`0x801631636 1 0.0% > libc.so.7`0x801631566 1 0.0% > libc.so.7`0x801631623 1 0.0% > gpsd`0x405ba6 1 0.0% > gpsd`0x404fd6 1 0.0% > libc.so.7`0x801631797 10 0.0% > libc.so.7`0x8016315f9 50 0.2% > libc.so.7`0x80163165c 63 0.2% > libc.so.7`0x80163179b 115 0.4% > libc.so.7`0x8016315b9 119 0.4% > libc.so.7`0x801631794 135 0.5% > libc.so.7`0x801631791 170 0.6% > libc.so.7`0x801631601 212 0.8% > libc.so.7`0x80163165d 226 0.8% > libc.so.7`0x801631757 233 0.8% > libc.so.7`0x8016315bd 235 0.8% > gpsd`0x4028bc 237 0.8% > libc.so.7`0x801631736 238 0.9% > libc.so.7`0x80163156a 239 0.9% > libc.so.7`0x801631617 243 0.9% > gpsd`0x4084ea 246 0.9% > gpsd`0x408508 251 0.9% > libc.so.7`0x8016317a0 251 0.9% > libc.so.7`0x801631571 252 0.9% > libc.so.7`0x801631749 252 0.9% > libc.so.7`0x801631583 253 0.9% > libc.so.7`0x8016315c7 256 0.9% > libc.so.7`0x801631727 259 0.9% > gpsd`0x4084fa 261 0.9% > libc.so.7`0x8016315ed 264 0.9% > libc.so.7`0x8016315a6 264 0.9% > libc.so.7`0x801631775 264 0.9% > libc.so.7`0x801631789 266 1.0% > libc.so.7`0x801631564 267 1.0% > libc.so.7`0x8016316e4 268 1.0% > libc.so.7`0x8016316eb 271 1.0% > libc.so.7`0x8016315d9 274 1.0% > libc.so.7`0x801631771 276 1.0% > libc.so.7`0x801631656 278 1.0% > libc.so.7`0x8016315dd 287 1.0% > libc.so.7`0x8016316e0 288 1.0% > libc.so.7`0x801631615 292 1.0% > libc.so.7`0x801631782 295 1.1% > libc.so.7`0x801631611 306 1.1% > libc.so.7`0x80163175c 336 1.2% > libc.so.7`0x801631790 349 1.3% > libc.so.7`0x8016315b3 485 1.7% > libc.so.7`0x80163177e 529 1.9% > libc.so.7`0x801631767 550 2.0% > libc.so.7`clock_gettime 769 2.8% > libc.so.7`0x801631764 796 2.9% > libc.so.7`0x8016315d5 800 2.9% > libc.so.7`0x80163164f 1029 3.7% > libc.so.7`0x801631607 1106 4.0% > libc.so.7`0x801631593 1335 4.8% > libc.so.7`0x8016315a0 1634 5.9% > libc.so.7`0x80163159a 1849 6.6% > libc.so.7`0x80163160c 2132 7.6% > gpsd`gpsd_report 2162 7.8% > libc.so.7`0x80163179d 3052 10.9% > > So it shows _some_ function names from libc but mostly not.. Is there a way to improve it? Build with debug symbols? For libc you can do that via: % cd /usr/src/lib/libc % make cleandir % make obj # May want to use "-O -g" to reduce inlining % make DEBUG_FLAGS="-g" depend all install For gpsd you'll have to figure out a way to get it built with extra symbols (if the port has a DEBUG option, enable that, otherwise you might have to hack the port). -- John Baldwin