Article View: muc.lists.freebsd.hackers
Article #116AMD performance profiling on FreeBSD: introduction and call for review, testing and feedback
From: Janeri Filho, Osvaldo
Date: Mon, 23 Nov 2026 19:28
Date: Mon, 23 Nov 2026 19:28
91 lines
12041 bytes
12041 bytes
Hi all,
My name is Osvaldo. I am currently at AMD, with a team of very skilled engineers
(Andre Silva, Anderson Nascimento and Davi C.A) working on
performance monitoring and profiling for AMD processors on FreeBSD, and with
help and mentorship of Professor Ali.
We have been posting our work on Phabricator for a few months, and I
would like to introduce the project to a wider audience and invite
you to take part.
The goal is to make performance analysis on current AMD hardware
(Zen 4, Zen 5 and Zen 6) work well on FreeBSD, with the same kind of
tooling people use on other systems. Most of the work is in
hwpmc(4), libpmc and pmcstat(8), together with Ali Mashtizadeh's new
pmc(8) tool. The test suite runs in the FreeBSD CI and skips on
systems without the hardware.
Some of what has already landed in main:
- PerfMonV2 global control for the core counters
https://reviews.freebsd.org/D58256
- RAPL energy counters and the PERF class (APERF, MPERF, IRPERF)
https://reviews.freebsd.org/D58028
https://reviews.freebsd.org/D59554
- IBS fixes and Zen 6 IBS filters
https://reviews.freebsd.org/D60004
https://reviews.freebsd.org/D56914
- Core counters are now serviced when IBS claims the NMI
https://reviews.freebsd.org/D61451
- Uncore fixes for the Data Fabric and the memory controller (UMC)
https://reviews.freebsd.org/D60769
https://reviews.freebsd.org/D60771
- About 80 ATF test cases in tests/sys/pmc and tests/sys/pmc/amd
https://reviews.freebsd.org/D59549
https://reviews.freebsd.org/D61062
https://reviews.freebsd.org/D61063
And some of what is in review:
- Event grouping and multiplexing, so that more events can be
measured than there are counters
https://reviews.freebsd.org/D57630
https://reviews.freebsd.org/D57633
- IBS behaviour under high sample rates: stalled units, minimum
periods, rate limits and drop records
https://reviews.freebsd.org/D61365
https://reviews.freebsd.org/D61371
- AMD LBR v2 branch sampling, on top of Ali's branch history
interface
https://reviews.freebsd.org/D58698
https://reviews.freebsd.org/D60570
- AMD IOMMU performance counters
https://reviews.freebsd.org/D60548
- Large Increment per Cycle events
https://reviews.freebsd.org/D61053
We would welcome help in any of these ways:
- Bug reports. If you see a problem with hwpmc, pmcstat or pmc on
AMD hardware, please file it in Bugzilla. We watch Bugzilla for
PMC and AMD-related reports and try to send fixes quickly.
Replying on this list or adding us to a review works too.
- Reviews and design discussion, especially on the grouping and
multiplexing ABI, which is the largest change.
- Testing on hardware we have less access to: Zen 1 to Zen 3,
two-socket systems, and Intel or arm64 machines to catch
regressions. The tests run with:
kyua test -k /usr/tests/sys/pmc/Kyuafile
- Suggestions. If you profile on FreeBSD today, or gave up and used
another system, we would like to know what was missing.
We plan to keep the community updated through this list as larger
pieces land or when we need input on a design decision.
Thanks to Mitchell Horne, Ali Mashtizadeh, Mark Jonhston, Konstantin Belousov,
Adrian Chadd and Warner Losh for the reviews and commits so far.
Along the way we also found and fixed bugs outside of PMC, mostly
while testing on AMD hardware or reading code next to ours.
We will keep sending these as we find them.
Best regards,
Osvaldo Janeri Filho
--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-admin@muc.de
Technical Details
Message-ID:
<PH9PR12MB145095BA9FE736E642598E4821E0452@PH9PR12MB145095.namprd12.prod.outlook.com>Path:
mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!2.eu.feeder.erje.net!feeder.erje.net!news2.arglkargh.de!news.karotte.org!news.muc.de!.POSTED.news.muc.de!not-for-mailShow Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!2.eu.feeder.erje.net!feeder.erje.net!news2.arglkargh.de!news.karotte.org!news.muc.de!.POSTED.news.muc.de!not-for-mail
From: "Janeri Filho, Osvaldo" <Osvaldo.JaneriFilho@amd.com>
Newsgroups: muc.lists.freebsd.hackers
Subject: AMD performance profiling on FreeBSD: introduction and call for
review, testing and feedback
Date: Mon, 23 Nov 2026 19:28:52 +0000
Organization: Newsgate at muc.de e.V.
Approved: news-admin@muc.de
Distribution: world
Message-ID: <PH9PR12MB145095BA9FE736E642598E4821E0452@PH9PR12MB145095.namprd12.prod.outlook.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
Injection-Info: news.muc.de; posting-host="news.muc.de:193.149.48.2";
logging-data="26101"; mail-complaints-to="news-admin@muc.de"
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim;
t=1795462262;
h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
to:to:cc:mime-version:mime-version:content-type:content-type:
content-transfer-encoding:content-transfer-encoding:list-id:list-help:
list-owner:list-unsubscribe:list-subscribe:list-post;
bh=wkRD5xPBB88UcsAL6jOWDA++t3WHTOFiJU7T103P3tk=;
b=hpkwUOkWWM03ILvWHuL6KMK1lSTdwByLNon2zghmqe6/kWzFo4yTodTmY8fHdJMj4rhWmA
occxfN62fdEWjAhL0b6wsBv4CXnZLf/zzDT84AP+iXhy0MO2MnYVJNfZHhgCRsF7SVjAk2
MY+JgnJbXDzIXiZKM2ELrof4YcKQjt3k47gsPlAipwRm+CsOOe0+q+X+9zmskB4F9cFaqg
HnEF6guQTznE89T9HbES0Leglaj2dRfisBpi0N6Tc5NIpiUiwx9RliQBesGN+CbH6H+C5T
sxtqPhSoll0coRv5JEFUcqArmdFKQ7mkkOKEA+I2nCrMokoy2vt106LkZ60yFQ==
X-Original-To: freebsd-hackers@mlmmj.nyi.freebsd.org
Authentication-Results: mx1.freebsd.org;
dkim=pass header.d=amd.com header.s=selector1 header.b=uFPtdBOF;
spf=pass (mx1.freebsd.org: domain of Osvaldo.JaneriFilho@amd.com designates 40.107.200.64 as permitted sender) smtp.mailfrom=Osvaldo.JaneriFilho@amd.com;
dmarc=pass (policy=quarantine) header.from=amd.com;
arc=pass ("microsoft.com:s=arcselector10001:i=1")
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;
h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
bh=wkRD5xPBB88UcsAL6jOWDA++t3WHTOFiJU7T103P3tk=;
b=uFPtdBOFH6W3CFqzAEyEki0Aa7n4WWwrCuyRrjO4jcdwzmoPFl1oWMEL3oAJpZo9KjG/HgCW5xYUa05KPtO+46sqk9LTSEIiMTs+kx51uOP1eN2CZnwNJJQl2jE7hZtU7+UC8rW2J5LE0oC/CPjTeaf7oyuCKr093NRIUWELeIA=
Thread-Topic: AMD performance profiling on FreeBSD: introduction and call for
review, testing and feedback
Thread-Index: AQHde4AAGdIRW4ME1UKxLxWMfzz5MA==
Accept-Language: en-US
Content-Language: en-US
x-ms-publictraffictype: Email
x-ms-traffictypediagnostic: PH9PR12MB145095:EE_|CHXPR12MB999220:EE_
x-ms-office365-filtering-correlation-id: 05121fcd-00f6-4a5f-9d82-08df499801eb
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam: BCL:0;ARA:13230040|23010399003|376014|1800799024|366016|261102123227099003|261026140227099003|261026121527099003|261022105027099003|261022075727099003|261028144727099003|261021121427099003|38070700021|11063799006|56012099006|10067099003|261009223027099003|18002099003;
x-microsoft-antispam-message-info: Nnny9clehKVFZnvVhn5A/tFLBkh2Y8kqOo2mY6Io3LlwInrNkk9EVfqN1dfzWSfzvTGjMxNvCFvDI7+OWTW0/6eedyXmNMAcPvemxH6TYykwhuTCM+VIFLZQ0CEXMuMJMZjz3DBi3Wog+H58v9LLWS65QMrz/8wjTYNvzzltyZCEULW8IMbIj1+G1cZjGY4zo1XFQmxJKyHlZ7igbp7FJE92yUie7Ov2w5q+ZscgQ9t/kgaZ7QFCZ8d2r056E+qPId9Z2FK6ZdYtPAC8qOlEd1oX8j9KGLKPukZxdI02PKNsJCnXWUQVzXIsuSndQI3W4AQEVrRhpov1SQPQGVEQjVbd23+434OeygS8scycyeohnXZF2tn/PxpUHZxCxr8UPL1grHaUXBIFFRknJ1k7S6Vptspn4NYiwDfUh2QN7TZAu9jZEmt4NhXCiiI4AQoscQcmhBzaVG/XCDhdD5/onKm98WVarP20Oq2xAwFvy8yc3A43mVc3IOvu0Y7nezczbfKzhfGPhOnHjNVY6BNojROlZwx1Togq4PSqxYy4aFULlaVw3FSaz35lBAHQvooPkKWfu1FqLGmK2wOR5st9/RangQc7vw+oWUjOlCMklfGGAFc19xxVnWn2eriHzdjgapJzRJopry+3Y79XEDVJ+EY38aoC7irktoekSsdX2k4=
x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH9PR12MB145095.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(23010399003)(376014)(1800799024)(366016)(261102123227099003)(261026140227099003)(261026121527099003)(261022105027099003)(261022075727099003)(261028144727099003)(261021121427099003)(38070700021)(11063799006)(56012099006)(10067099003)(261009223027099003)(18002099003);DIR:OUT;SFP:1101;
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0: TLE8x6Fm/b2oOpAP2hWJ2yTVOeXnZ9bvYaulkuhvUhArPCRm2p1nBjK1VBrKdTQcWk5D+kNVDxNN/0PeR28fei770p45ODu8L3shQ33UE0KygDl3W53yqZI0b2LB254Xj+TJyLX1oLIlp4LfRWtKqAADq8ORZ4PmW66yaam7pSp6UmlvdKKf1wH25IxVoNHYf+JJAKgxgm2tm9bUSxSJPcc6ZzClDmdbDX9L6av9+bE6ZixLHorQUUCt5BST/j+ev0V5N/Dmbri5Vp6cbj33Qg8SK52T0oWdxGD/FxMRSJbSDGfzFrLuOKn1qX0UuKitq3+6wuIEkVSN/EWvxHto3sLWM3rr4Q1AxD80ASfq7iVavAUiO6DPQkGwnu6Y3xcl4yDzAXVI9L7YBGEjMTg477xUalLBeLJWmqZJrPVmHiYr383J+uYX10V0KlYYXT3POXrr9529j8BHh8s30F6PkkDZY0we3zktcKxrCozsZezzKYSDQFv2cfHHnGiM2+PwryGeocqXY36hhwfuGX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puJjyZIN+xyLJcCsVWEnLHRwDtltlJ0+YVctAwhvh8QcwgTg80/uO5wUifqTGfxf/HBsEPt/tIELArQ9q75K5gKzIVN11kE6Ua/n8pkQOT+12fvd
Precedence: list
X-OriginatorOrg: amd.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: PH9PR12MB145095.namprd12.prod.outlook.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 05121fcd-00f6-4a5f-9d82-08df499801eb
X-MS-Exchange-CrossTenant-originalarrivaltime: 23 Nov 2026 19:28:52.5820
(UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 3dd8961f-e488-4e60-8e11-a82d994e183d
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: 7iVEj9ipAYfE/Rp8pZC7gTeNBOTIdE3/1FPWeHAZotJtU8FxGNqr+Z2pdi+fDGMpGOe70KxdzMTYlgcUZJpmxA==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: CHXPR12MB999220
X-Rspamd-Queue-Id: 4jYGFz60kpz4S6f
X-Spamd-Bar: /
X-Spamd-Result: default: False [0.00 / 15.00];
INTRODUCTION(2.00)[];
ARC_ALLOW(-1.00)[microsoft.com:s=arcselector10001:i=1];
DMARC_POLICY_ALLOW(-0.50)[amd.com,quarantine];
R_SPF_ALLOW(-0.20)[+ip4:40.107.0.0/16];
R_DKIM_ALLOW(-0.20)[amd.com:s=selector1];
MIME_GOOD(-0.10)[text/plain];
TO_DN_ALL(0.00)[];
ASN(0.00)[asn:8075, ipnet:40.104.0.0/14, country:US];
FROM_HAS_DN(0.00)[];
MISSING_XM_UA(0.00)[];
MIME_TRACE(0.00)[0:+];
TO_MATCH_ENVRCPT_ALL(0.00)[];
FROM_EQ_ENVFROM(0.00)[];
MLMMJ_DEST(0.00)[freebsd-hackers@freebsd.org];
RCVD_TLS_LAST(0.00)[];
RWL_MAILSPIKE_POSSIBLE(0.00)[40.107.200.64:from];
RCVD_COUNT_TWO(0.00)[2];
RCPT_COUNT_ONE(0.00)[1];
DKIM_TRACE(0.00)[amd.com:+]
X-Newsgate-Id: f02c70b8849f+
X-No-Archive: Yes