From nobody Tue Dec 2 12:36:07 2025 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 4dLKyN2SWTz6KMvF for ; Tue, 02 Dec 2025 12:36:28 +0000 (UTC) (envelope-from paulf2718@gmail.com) Received: from mail-wm1-x331.google.com (mail-wm1-x331.google.com [IPv6:2a00:1450:4864:20::331]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dLKyL6w8jz3cx9 for ; Tue, 02 Dec 2025 12:36:26 +0000 (UTC) (envelope-from paulf2718@gmail.com) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20230601 header.b=PUHGpboc; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of paulf2718@gmail.com designates 2a00:1450:4864:20::331 as permitted sender) smtp.mailfrom=paulf2718@gmail.com Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-477770019e4so45506745e9.3 for ; Tue, 02 Dec 2025 04:36:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1764678980; x=1765283780; darn=freebsd.org; h=message-id:in-reply-to:to:references:date:subject:mime-version:from :from:to:cc:subject:date:message-id:reply-to; bh=oIUFAZ3wzKzUm37Xm722WyouXy1WsVR3ZAOZgEKO37Q=; b=PUHGpboccDaY5kK49jC1mfSEXWGsFXad1VfTAFeixJ6ErjIr2J+xBp+KUAed9vORY2 qC9kokJDxgLkck6aRLfy20qipigQ0bIm9by/wszZl1RdQ0iB9hTUY6QlxrLpAlH4lXp9 ErJRn8fwfMw2FNzHjxUd2GsBBVCvziQRRV9za2oVDwd7WZ0rYEbPsPQdsSScVeW7awQf o9Sj1UWV+MqPCtoLPt3KTHlAue45cqEmxPVkhca5m2Qrc/yyTON8zG4M6WMDDZPXLzVo 5fMlY1xlo8L0TAhltHhVDkv6/2alDh4DJGmXOmHoRuc4b5uxFh9fv/6Gu87AX9PJWsu5 LUWA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1764678980; x=1765283780; h=message-id:in-reply-to:to:references:date:subject:mime-version:from :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=oIUFAZ3wzKzUm37Xm722WyouXy1WsVR3ZAOZgEKO37Q=; b=sV0+OPRdpAl/NetI7jhfDmQl18Zq0JJv8oTvBI+K4nNJU4lNpJR57NK9EA7ji5r4hm 0I0JLbhJ1xhJzbYQahT6qe7Z0xcEtltCalLP2tFLe973jzsiBQEFliBrTHPG7GFnBxIE k9Q15z7farw7J2et6lY560h6a0MxJwT1koDzLgpd6aS/ej8vSeg26HUuqMd84mBZt4Y1 lzHCPpjZVBPpxqyT5RHJeGbh729TdL5x75jIpXXLRcy4BvZ6LLHO1Kz5Gsiog7RWWGwF RhXXr5zRVVqFMeDriJufyx3UBDESCCTmcy5ylM0OQxGXh6UkwTxHrK6RlNVDu6GAQNHO 5P2g== X-Gm-Message-State: AOJu0Yy2p4Wpek5Jf23CnEoGqDIlEQldZivlSP/Xr/BYRNQz0TEcIVAV 7qesLJOsMjvf30bjkcyTzmBHCwgEtkvtz55UNTeEUyi6eO9YVqwsxcn9Z/f/xw== X-Gm-Gg: ASbGncvrWDQuMxGQKbq+rWuCE8vnjxiCLnJuc27T3U1Sg7C3OQB3Jry+LlTgGDC+FBV tAABfx8DMzCK5SmvOvwVrHtN/KEaV8ZisDVRXbLSq3yMyitBOFxbc4kUgjzZoj74d7VhMLABODB LSIw56EDb9jHi2kdXGKRkTNRcFFyUsNX/4vg05K/ip4wGNLEkMeVdnNpsTKelVQiO45Vl1HCMnn jP0+WGmnuhiaATdcHuMFNKK//L406AW/aYJ2ioGVowCbC8fsbxa9UQoTd7rX+g/qMR4JKAVnnw6 rQpDtdhTjqz/S2BzWCdcewIzz0C6oWd0aydJuNz8YgEZY4nCfjTFvRwwuaUBf3kEJAorxr5zaKy 9DPSEHwYR6qGml/vfV6f7Nd80SyasEL0YDHkXi2tNwJqdsTOXTAlDocKLrUiUrANvjH8Ym78Fq7 s4B/RVkRgrG1uK0Il/SL3/L9ffHMdfZW/tO0NqdA== X-Google-Smtp-Source: AGHT+IF7A+G+3HmdiQqWZieD3PuYOVPMsRle5JYESTPQCD/LnODrIEAoPmjKrnrsVIVuLqaOKGGRVw== X-Received: by 2002:a05:600c:8b37:b0:477:9cc3:7971 with SMTP id 5b1f17b1804b1-47904b1ac02mr246133305e9.20.1764678979725; Tue, 02 Dec 2025 04:36:19 -0800 (PST) Received: from smtpclient.apple ([2a01:cb15:8545:7700:c829:df66:70db:2acc]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-47927d2cf62sm12659685e9.7.2025.12.02.04.36.18 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 02 Dec 2025 04:36:19 -0800 (PST) From: Paul Floyd Content-Type: multipart/alternative; boundary="Apple-Mail=_AD392D14-D61C-42C6-A759-6E05EC076E07" 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 (Mac OS X Mail 16.0 \(3826.700.81\)) Subject: Re: Process Profiling Date: Tue, 2 Dec 2025 13:36:07 +0100 References: To: Freebsd hackers list In-Reply-To: Message-Id: X-Mailer: Apple Mail (2.3826.700.81) X-Spamd-Bar: -- X-Spamd-Result: default: False [-2.24 / 15.00]; MIME_BAD_ATTACHMENT(1.60)[ico:image/vnd.microsoft.icon]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.84)[-0.837]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; R_SPF_ALLOW(-0.20)[+ip6:2a00:1450:4000::/36]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20230601]; MIME_GOOD(-0.10)[multipart/alternative,text/plain,multipart/related]; TO_DN_ALL(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim]; FREEMAIL_FROM(0.00)[gmail.com]; RCVD_TLS_LAST(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:+,3:~,4:~,5:~]; ARC_NA(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; FREEMAIL_ENVFROM(0.00)[gmail.com]; PREVIOUSLY_DELIVERED(0.00)[freebsd-hackers@freebsd.org]; RCVD_COUNT_TWO(0.00)[2]; FROM_EQ_ENVFROM(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; MLMMJ_DEST(0.00)[freebsd-hackers@freebsd.org]; APPLE_MAILER_COMMON(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[2a00:1450:4864:20::331:from] X-Rspamd-Queue-Id: 4dLKyL6w8jz3cx9 --Apple-Mail=_AD392D14-D61C-42C6-A759-6E05EC076E07 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On 2 Dec 2025, at 02:15, Friedrich Doku = wrote: >=20 > Hi, >=20 > How can I profile a process on freebsd? I want to see where all the = time is going, and there is no perf. Hi Friedrich The nearest thing that FreeBSD has is pmcstat. See, for instance = https://man.freebsd.org/cgi/man.cgi?query=3Dpmcstat&sektion=3D8&apropos=3D= 0&manpath=3DFreeBSD+15.0-RELEASE+and+Ports=EF=BF=BC https://wiki.freebsd.org/PmcTools=EF=BF=BC Going by the wiki page, there was active development from 2007 ro 2010 = and then not much since. I haven=E2=80=99t used it much, and also found = it quite hard to get working properly. The next thing that I would consider is Google Perftools. = https://www.freshports.org/devel/google-perftools/ You will need to rebuild your application and link with the perftools = lib. Then you will be able to perform time sampled time profiling and = heap profiling. Also for heap profiling consider heap track = https://www.freshports.org/devel/heaptrack/. No need to rebuild but you = must be profiling an exe that links dynamically with libc. Lastly Valgrind contains 4 performance measurement tools: Callgrind, = Cachegrind, Massif and DHAT. No need to rebuild and they will work with = dynamic and static exes. A+ Paul --Apple-Mail=_AD392D14-D61C-42C6-A759-6E05EC076E07 Content-Type: multipart/related; type="text/html"; boundary="Apple-Mail=_648CAF98-8508-4A6C-A7C9-28D5F5B518A1" --Apple-Mail=_648CAF98-8508-4A6C-A7C9-28D5F5B518A1 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8
On 2 Dec = 2025, at 02:15, Friedrich Doku = <friedrichdoku2030@u.northwestern.edu> wrote:

Hi,

How can I profile a process on = freebsd? I want to see where all the time is going, and there is no = perf.

Hi = Friedrich

The nearest thing that FreeBSD has is = pmcstat.

See, for instance