From nobody Sat Feb 03 07:14:28 2024 X-Original-To: freebsd-hackers@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TRkRD4XpGz58XS6 for ; Sat, 3 Feb 2024 07:14:32 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Received: from omta002.cacentral1.a.cloudfilter.net (omta002.cacentral1.a.cloudfilter.net [3.97.99.33]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "Client", Issuer "CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TRkRD2SRLz4DJF for ; Sat, 3 Feb 2024 07:14:32 +0000 (UTC) (envelope-from cy.schubert@cschubert.com) Authentication-Results: mx1.freebsd.org; none Received: from shw-obgw-4002a.ext.cloudfilter.net ([10.228.9.250]) by cmsmtp with ESMTPS id VxLgr9flkGAIJWAERrMfUP; Sat, 03 Feb 2024 07:14:31 +0000 Received: from spqr.komquats.com ([70.66.152.170]) by cmsmtp with ESMTPSA id WAEPrRgcG9Cr4WAEQr87B5; Sat, 03 Feb 2024 07:14:31 +0000 X-Authority-Analysis: v=2.4 cv=etl8zZpX c=1 sm=1 tr=0 ts=65bde7d7 a=y8EK/9tc/U6QY+pUhnbtgQ==:117 a=y8EK/9tc/U6QY+pUhnbtgQ==:17 a=xqWC_Br6kY4A:10 a=IkcTkHD0fZMA:10 a=k7vzHIieQBIA:10 a=fV8ZZk05AAAA:8 a=TeXQEi0gAAAA:8 a=YxBL1-UpAAAA:8 a=6I5d2MoRAAAA:8 a=EkcXrb_YAAAA:8 a=62Dx-lNWg2fSEhm-ccwA:9 a=QEXdDO2ut3YA:10 a=QFyySfyjxHkA:10 a=bW4SNCYk5CwG5Z2S0tlZ:22 a=bEhy0igz1TKSDeFmpLWy:22 a=Ia-lj3WSrqcvXOmTRaiG:22 a=IjZwj45LgO3ly-622nXo:22 a=LK5xJRSDVpKd5WXXoEvA:22 Received: from slippy.cwsent.com (slippy [10.1.1.91]) by spqr.komquats.com (Postfix) with ESMTP id 42412400; Fri, 2 Feb 2024 23:14:29 -0800 (PST) Received: from slippy (localhost [IPv6:::1]) by slippy.cwsent.com (Postfix) with ESMTP id 280ABDC; Fri, 2 Feb 2024 23:14:29 -0800 (PST) Date: Fri, 2 Feb 2024 23:14:28 -0800 From: Cy Schubert To: "Chuck Tuffli" Cc: freebsd-hackers@freebsd.org Subject: Re: Profiling applications Message-ID: <20240202231428.7c711308@slippy> In-Reply-To: References: Organization: KOMQUATS X-Mailer: Claws Mail 3.19.1 (GTK+ 2.24.33; amd64-portbld-freebsd15.0) List-Id: Technical discussions relating to FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-hackers List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-hackers@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-CMAE-Envelope: MS4xfLiWp6OT/4sozQqZxnfd2ojGNW4DNnY6PGr5Wih4sYL8uuVvjK6asNVrC87kGa35a71Co3jkSNbfWLFONMjxfUrZi2CjFGgGkBMVTxhAzj0FTShce9NN iiZ8Y0F0tbzvZmY0yZc3ClRjy2z6UCQm66+fITkDaqZbmHDjW+8DdNo4u+jGSk9Cvj1A4gTkzA9d6l12CEtokzpPcITXEn7IKIyux3R347Maps8QnpqKSY6z CjFJQpER44BmUestmxJjFQ== X-Rspamd-Queue-Id: 4TRkRD2SRLz4DJF X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:16509, ipnet:3.96.0.0/15, country:US] On Fri, 02 Feb 2024 16:16:26 -0800 "Chuck Tuffli" wrote: > What is the recommended way of profiling applications on FreeBSD these da= ys? I=E2=80=99m looking for information like =E2=80=9C28% of the execution = time is spent in function X=E2=80=9D. >=20 > =E2=80=94chuck=20 Try DTrace. The DTrace book (if you can get your hands on it) is a good source of information about profiling. Oracle (formerly Sun) has some good resources. https://ekamperi.github.io/Geant4/dtrace.html may provide some pointers. Brendan Gregg's (Brendan wrote DTrace) flame FlameGraph is another option, though it displays hot PIDs, probably not what you're looking for. The DTrace Tookit is in ports. There are some DTrace code samples there. Once you know where your app is spending its time you can add USDT probes to allow you to capture snapshots of data structures at points in time. --=20 Cheers, Cy Schubert FreeBSD UNIX: Web: https://FreeBSD.org NTP: Web: https://nwtime.org e^(i*pi)+1=3D0